diff --git a/.env b/.env new file mode 100644 index 000000000..d9482516b --- /dev/null +++ b/.env @@ -0,0 +1,8 @@ +# Compose supports declaring default environment variables in an environment file named .env placed in the folder docker-compose command is executed from (current working directory). +# Compose expects each line in an env file to be in VAR=VAL format. Lines beginning with # (i.e. comments) are ignored, as are blank lines. +# Note: Values present in the environment at runtime will always override those defined inside the .env file. Similarly, values passed via command-line arguments take precedence as well. + +# The IP below should be swapped to your real IP or DNS name, like 192.168.88.248, etc. if testing from remote browsers or mobile devices + +ESHOP_EXTERNAL_DNS_NAME_OR_IP=localhost +ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=10.121.122.92 \ No newline at end of file diff --git a/README.md b/README.md index 5c87323e1..770dfb0bf 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,10 @@ Sample .NET Core reference application, powered by Microsoft, based on a simplif > **IMPORTANT:** The current state of this sample application is **ALPHA**, consider it version a 0.1 foundational version, therefore, many areas could be improved and change significantly while refactoring current code and implementing new features. **Feedback with improvements and pull requests from the community will be highly appreciated and accepted.** > > This reference application proposes a simplified microservice oriented architecture implementation to introduce technologies like .NET Core with Docker containers through a comprehensive application. However, this reference application it is not trying to solve all the problems in a large and mission-critical distributed system, it is just a bootstrap for developers to easily get started in the world of Docker containers and microservices with .NET Core. ->

For example, the next step (still not covered here) after understanding Docker containers and microservices is to select a microservice cluster/orchestrator like Docker Swarm, Kubernetes or DC/OS (in Azure Container Service) or Azure Service Fabric which in most of the cases will require additional partial changes to your application's configuration (although the present architecture should work on most orchestrators with small changes). In the future we might fork this project and make multiple versions targeting specific microservice cluster/orchestrators.

+>

For example, the next step (still not covered in eShopOnContainers) after understanding Docker containers and microservices development with .NET Core, is to select a microservice cluster/orchestrator like Docker Swarm, Kubernetes or DC/OS (in Azure Container Service) or Azure Service Fabric which in most of the cases will require additional partial changes to your application's configuration (although the present architecture should work on most orchestrators with small changes). +> Or moving your databases to HA cloud services, or implementing your EventBus with Azure Service Bus or any other production ready Service Bus in the market. +>

In the future we might fork this project and make multiple versions targeting specific microservice cluster/orchestrators plus using additional cloud infrastructure.

+> > Read the planned Roadmap and Milestones for future releases of eShopOnContainers within the Wiki for further info about possible new implementations and provide feedback at the ISSUES section if you'd like to see any specific scenario implemented or improved. Also, feel free to discuss on any current issue. **Architecture overview**: This reference application is cross-platform either at the server and client side, thanks to .NET Core services capable of running on Linux or Windows containers depending on your Docker host, and to Xamarin for mobile apps running on Android, iOS or Windows/UWP plus any browser for the client web apps. @@ -17,7 +20,7 @@ The plan is to add asynchronous communication for data updates propagation acros

-Additional miroservice styles with other frameworks and No-SQL databases will be added, eventually. This is a great opportunity for pull requests from the community, like a new microservice using Nancy, or even other languages like Node, Go, Python or data containers with MongoDB with Azure DocDB compatibility, Postgress, RavenDB, Event Store, MySql, etc. You name it! :) +Additional miroservice styles with other frameworks and No-SQL databases will be added, eventually. This is a great opportunity for pull requests from the community, like a new microservice using Nancy, or even other languages like Node, Go, Python or data containers with MongoDB with Azure DocDB compatibility, PostgreSQL, RavenDB, Event Store, MySql, etc. You name it! :) > ### Important Note on Database Servers/Containers > In this solution's current configuration for a development environment, the SQL databases are automatically deployed with sample data into a single SQL Server for Linux container (a single shared Docker container for SQL databases) so the whole solution can be up and running without any dependency to any cloud or specific server. Each database could also be deployed as a single Docker container, but then you'd need more then 8GB or memory RAM assigned to Docker in your development machine in order to be able to run 3 SQL Server Docker containers in your Docker Linux host in "Docker for Windows" or "Docker for Mac" development environments. @@ -55,13 +58,13 @@ The screenshot below shows the VS Solution structure for those microservices/con Finally, those microservices are consumed by multiple client web and mobile apps, as described below.
-*MVC Application (ASP.NET Core)*: Its an MVC 6 application where you can find interesting scenarios on how to consume HTTP-based microservices from C# running in the server side, as it is a typical ASP.NET Core MVC application. Since it is a server-side application, access to other containers/microservices is done within the internal Docker Host network with its internal name resolution. +*MVC Application (ASP.NET Core)*: Its an MVC application where you can find interesting scenarios on how to consume HTTP-based microservices from C# running in the server side, as it is a typical ASP.NET Core MVC application. Since it is a server-side application, access to other containers/microservices is done within the internal Docker Host network with its internal name resolution.
-*SPA (Single Page Application)*: Providing similar "eShop business functionality" but developed with Angular 2, Typescript and slightly using ASP.NET Core MVC 6. This is another approach for client web applications to be used when you want to have a more modern client behavior which is not behaving with the typical browser round-trip on every action but behaving like a Single-Page-Application which is more similar to a desktop app usage experience. The consumption of the HTTP-based microservices is done from TypeScript/JavaScript in the client browser, so the client calls to the microservices come from out of the Docker Host internal network (Like from your network or even from the Internet). +*SPA (Single Page Application)*: Providing similar "eShop business functionality" but developed with Angular 2, Typescript and slightly using ASP.NET Core MVC. This is another approach for client web applications to be used when you want to have a more modern client behavior which is not behaving with the typical browser round-trip on every action but behaving like a Single-Page-Application which is more similar to a desktop app usage experience. The consumption of the HTTP-based microservices is done from TypeScript/JavaScript in the client browser, so the client calls to the microservices come from out of the Docker Host internal network (Like from your network or even from the Internet).
-*Xamarin Mobile App (For iOS, Android and Windows/UWP)*: It is a client mobile app supporting the most common mobilee OS platforms (iOS, Android and Windows/UWP). In this case, the consumption of the microservices is done from C# but running on the client devices, so out of the Docker Host internal network (Like from your network or even the Internet). +*Xamarin Mobile App (For iOS, Android and Windows/UWP)*: It is a client mobile app supporting the most common mobile OS platforms (iOS, Android and Windows/UWP). In this case, the consumption of the microservices is done from C# but running on the client devices, so out of the Docker Host internal network (Like from your network or even the Internet). @@ -85,5 +88,9 @@ The Windows Containers scenario is currently being implemented/tested yet The app was also partially tested on "Docker for Mac" using a development MacOS machine with .NET Core and VS Code installed, which is still a scenario using Linux containers running on the VM setup in the Mac by the "Docker for Windows" setup. But further testing and feedback on Mac environments and Windows Containers, from the community, will be appreciated. ## Sending feedback and pull requests -As mentioned, ew'd love to get your feedback, improvements and ideas. -Create new issues at the issues section and/or send emails to cesardl@microsoft.com +As mentioned, we'd appreciate to your feedback, improvements and ideas. +You can create new issues at the issues section, do pull requests and/or send emails to eshop_feedback@service.microsoft.com + +## Questions +[QUESTION] Answer +1 if the solution is working for you (Through VS2017 or CLI environment): +https://github.com/dotnet/eShopOnContainers/issues/107 diff --git a/docker-compose.local.build.yml b/cli-linux/docker-compose.local.build.yml similarity index 100% rename from docker-compose.local.build.yml rename to cli-linux/docker-compose.local.build.yml diff --git a/cli-linux/prepare-spa-app.sh b/cli-linux/prepare-spa-app.sh new file mode 100644 index 000000000..6fc15a0f0 --- /dev/null +++ b/cli-linux/prepare-spa-app.sh @@ -0,0 +1,7 @@ + +# Build SPA app +pushd $(pwd)/src/Web/WebSPA +npm rebuild node-sass +#npm run build:prod + + diff --git a/docker-compose.ci.build.yml b/docker-compose.ci.build.yml index 0a4b6e345..ef9705c8e 100644 --- a/docker-compose.ci.build.yml +++ b/docker-compose.ci.build.yml @@ -6,4 +6,5 @@ services: volumes: - .:/src working_dir: /src - command: /bin/bash -c "dotnet restore ./eShopOnContainers-ServicesAndWebApps.sln && dotnet publish ./eShopOnContainers-ServicesAndWebApps.sln -c Release -o ./obj/Docker/publish" + command: /bin/bash -c "pushd ./src/Web/WebSPA && npm rebuild node-sass && pushd ./../../.. && dotnet restore ./eShopOnContainers-ServicesAndWebApps.sln && dotnet publish ./eShopOnContainers-ServicesAndWebApps.sln -c Release -o ./obj/Docker/publish" + diff --git a/docker-compose.dcproj b/docker-compose.dcproj index 91d4a272e..f7f04c5b4 100644 --- a/docker-compose.dcproj +++ b/docker-compose.dcproj @@ -11,6 +11,9 @@ docker-compose.yml + + docker-compose.yml + docker-compose.yml diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 2fe32722e..3f3d5994f 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -1,5 +1,11 @@ version: '2' +# The default docker-compose.override file can use the "localhost" as the external name for testing web apps within the same dev machine. +# The ESHOP_EXTERNAL_DNS_NAME_OR_IP environment variable is taken, by default, from the ".env" file defined like: +# ESHOP_EXTERNAL_DNS_NAME_OR_IP=localhost +# but values present in the environment vars at runtime will always override those defined inside the .env file +# An external IP or DNS name has to be used (instead localhost and the 10.0.75.1 IP) when testing the Web apps and the Xamarin apps from remote machines/devices using the same WiFi, for instance. + services: basket.api: @@ -17,7 +23,7 @@ services: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:5101 - ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word - - ExternalCatalogBaseUrl=http://localhost:5101 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105. + - ExternalCatalogBaseUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5101 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105. - EventBusConnection=rabbitmq ports: - "5101:5101" @@ -26,9 +32,9 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:5105 - - SpaClient=http://localhost:5104 + - SpaClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5104 - ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word - - MvcClient=http://localhost:5100 #Local: You need to open your local dev-machine firewall at range 5100-5105. + - MvcClient=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your local dev-machine firewall at range 5100-5105. ports: - "5105:5105" @@ -46,10 +52,10 @@ services: environment: - ASPNETCORE_ENVIRONMENT=Development - ASPNETCORE_URLS=http://0.0.0.0:5104 - - CatalogUrl=http://localhost:5101 - - OrderingUrl=http://localhost:5102 - - IdentityUrl=http://localhost:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105. - - BasketUrl=http://localhost:5103 + - CatalogUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5101 + - OrderingUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5102 + - IdentityUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105. + - BasketUrl=http://${ESHOP_EXTERNAL_DNS_NAME_OR_IP}:5103 ports: - "5104:5104" @@ -59,8 +65,9 @@ services: - ASPNETCORE_URLS=http://0.0.0.0:5100 - CatalogUrl=http://catalog.api:5101 - OrderingUrl=http://ordering.api:5102 - - IdentityUrl=http://10.0.75.1:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105. - BasketUrl=http://basket.api:5103 + - IdentityUrl=http://10.0.75.1:5105 #Local: Use 10.0.75.1 in a "Docker for Windows" environment, if using "localhost" from browser. + #Remote: Use ${ESHOP_EXTERNAL_DNS_NAME_OR_IP} if using external IP or DNS name from browser. ports: - "5100:5100" diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 000000000..14d8114ea --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,80 @@ +version: '2' + +# The Production docker-compose file has to have the external/real IPs or DNS names for the services +# The ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP environment variable is taken, by default, from the ".env" file defined like: +# ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP=192.168.88.248 +# but values present in the environment vars at runtime will always override those defined inside the .env file +# An external IP or DNS name has to be used when testing the Web apps and the Xamarin apps from remote machines/devices using the same WiFi, for instance. +# +# Set ASPNETCORE_ENVIRONMENT=Development to get errors while testing. +# +# You need to start it with the following CLI command: +# docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d + +services: + + basket.api: + environment: + - ASPNETCORE_ENVIRONMENT=Production + - ASPNETCORE_URLS=http://0.0.0.0:5103 + - ConnectionString=basket.data + - identityUrl=http://identity.api:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. + ports: + - "5103:5103" + + catalog.api: + environment: + - ASPNETCORE_ENVIRONMENT=Production + - ASPNETCORE_URLS=http://0.0.0.0:5101 + - ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word + - ExternalCatalogBaseUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5101 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. + ports: + - "5101:5101" + + identity.api: + environment: + - ASPNETCORE_ENVIRONMENT=Production + - ASPNETCORE_URLS=http://0.0.0.0:5105 + - SpaClient=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5104 + - ConnectionStrings__DefaultConnection=Server=sql.data;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word + - MvcClient=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5100 #Local: You need to open your host's firewall at range 5100-5105. + ports: + - "5105:5105" + + ordering.api: + environment: + - ASPNETCORE_ENVIRONMENT=Production + - ASPNETCORE_URLS=http://0.0.0.0:5102 + - ConnectionString=Server=sql.data;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word + - identityUrl=http://identity.api:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. + ports: + - "5102:5102" + + webspa: + environment: + - ASPNETCORE_ENVIRONMENT=Production + - ASPNETCORE_URLS=http://0.0.0.0:5104 + - CatalogUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5101 + - OrderingUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5102 + - IdentityUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: You need to open your host's firewall at range 5100-5105. at range 5100-5105. + - BasketUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5103 + ports: + - "5104:5104" + + webmvc: + environment: + - ASPNETCORE_ENVIRONMENT=Production + - ASPNETCORE_URLS=http://0.0.0.0:5100 + - CatalogUrl=http://catalog.api:5101 + - OrderingUrl=http://ordering.api:5102 + - IdentityUrl=http://${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}:5105 #Local: Use ${ESHOP_PROD_EXTERNAL_DNS_NAME_OR_IP}, if using external IP or DNS name from browser. + - BasketUrl=http://basket.api:5103 + ports: + - "5100:5100" + + sql.data: + environment: + - SA_PASSWORD=Pass@word + - ACCEPT_EULA=Y + ports: + - "5433:1433" \ No newline at end of file diff --git a/docs/architecting-and-developing-containerized-and-microservice-based-net-applications-ebook-early-draft.pdf b/docs/architecting-and-developing-containerized-and-microservice-based-net-applications-ebook-early-draft.pdf index 14f6fac3f..948d628e5 100644 Binary files a/docs/architecting-and-developing-containerized-and-microservice-based-net-applications-ebook-early-draft.pdf and b/docs/architecting-and-developing-containerized-and-microservice-based-net-applications-ebook-early-draft.pdf differ diff --git a/eShopOnContainers-ServicesAndWebApps.sln b/eShopOnContainers-ServicesAndWebApps.sln index 539aec7b0..6d59a9a18 100644 --- a/eShopOnContainers-ServicesAndWebApps.sln +++ b/eShopOnContainers-ServicesAndWebApps.sln @@ -38,8 +38,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebMVC", "src\Web\WebMVC\We EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ordering.Infrastructure", "src\Services\Ordering\Ordering.Infrastructure\Ordering.Infrastructure.csproj", "{95F1F07C-4D92-4742-BD07-E5B805AAB651}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests", "test\Services\FunctionalTests\FunctionalTests.csproj", "{621E7211-58D0-45FD-9600-1CB490BD930E}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTest", "test\Services\UnitTest\UnitTest.csproj", "{7796F5D8-31FC-45A4-B673-19DE5BA194CF}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Identity.API", "src\Services\Identity\Identity.API\Identity.API.csproj", "{A579E108-5445-403D-A407-339AC4D1611B}" @@ -48,6 +46,10 @@ Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-co EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebSPA", "src\Web\WebSPA\WebSPA.csproj", "{F16E3C6A-1C94-4EAB-BE91-099618060B68}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests", "test\Services\IntegrationTests\IntegrationTests.csproj", "{5B810E3D-112E-4857-B197-F09D2FD41E27}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests", "test\Services\FunctionalTests\FunctionalTests.csproj", "{CFE2FACB-4538-4B99-8A10-306F3882952D}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{47857844-D05A-4C37-BFB2-AF19B7EC418D}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "src\Services\Common\Infrastructure\Infrastructure.csproj", "{B08BA891-ABA2-4BD5-80E8-40B7546C3BE0}" @@ -258,54 +260,6 @@ Global {95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x64.Build.0 = Release|Any CPU {95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x86.ActiveCfg = Release|Any CPU {95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x86.Build.0 = Release|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|x64.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|x86.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|Any CPU.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|ARM.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|ARM.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|iPhone.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|x64.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|x64.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|x86.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.AppStore|x86.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|ARM.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|ARM.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|iPhone.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|x64.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|x64.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|x86.ActiveCfg = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Debug|x86.Build.0 = Debug|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Release|Any CPU.Build.0 = Release|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Release|ARM.ActiveCfg = Release|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Release|ARM.Build.0 = Release|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Release|iPhone.ActiveCfg = Release|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Release|iPhone.Build.0 = Release|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Release|x64.ActiveCfg = Release|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Release|x64.Build.0 = Release|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Release|x86.ActiveCfg = Release|Any CPU - {621E7211-58D0-45FD-9600-1CB490BD930E}.Release|x86.Build.0 = Release|Any CPU {7796F5D8-31FC-45A4-B673-19DE5BA194CF}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU {7796F5D8-31FC-45A4-B673-19DE5BA194CF}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU {7796F5D8-31FC-45A4-B673-19DE5BA194CF}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU @@ -498,6 +452,102 @@ Global {F16E3C6A-1C94-4EAB-BE91-099618060B68}.Release|x64.Build.0 = Release|Any CPU {F16E3C6A-1C94-4EAB-BE91-099618060B68}.Release|x86.ActiveCfg = Release|Any CPU {F16E3C6A-1C94-4EAB-BE91-099618060B68}.Release|x86.Build.0 = Release|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.AppStore|ARM.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.AppStore|iPhone.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.AppStore|x64.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.AppStore|x64.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.AppStore|x86.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.AppStore|x86.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Debug|ARM.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Debug|ARM.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Debug|iPhone.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Debug|x64.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Debug|x64.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Debug|x86.ActiveCfg = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Debug|x86.Build.0 = Debug|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Release|Any CPU.Build.0 = Release|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Release|ARM.ActiveCfg = Release|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Release|ARM.Build.0 = Release|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Release|iPhone.ActiveCfg = Release|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Release|iPhone.Build.0 = Release|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Release|x64.ActiveCfg = Release|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Release|x64.Build.0 = Release|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Release|x86.ActiveCfg = Release|Any CPU + {5B810E3D-112E-4857-B197-F09D2FD41E27}.Release|x86.Build.0 = Release|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.AppStore|ARM.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.AppStore|iPhone.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.AppStore|x64.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.AppStore|x64.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.AppStore|x86.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.AppStore|x86.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Debug|ARM.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Debug|ARM.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Debug|iPhone.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Debug|x64.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Debug|x64.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Debug|x86.ActiveCfg = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Debug|x86.Build.0 = Debug|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Release|Any CPU.Build.0 = Release|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Release|ARM.ActiveCfg = Release|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Release|ARM.Build.0 = Release|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Release|iPhone.ActiveCfg = Release|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Release|iPhone.Build.0 = Release|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Release|x64.ActiveCfg = Release|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Release|x64.Build.0 = Release|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Release|x86.ActiveCfg = Release|Any CPU + {CFE2FACB-4538-4B99-8A10-306F3882952D}.Release|x86.Build.0 = Release|Any CPU {B08BA891-ABA2-4BD5-80E8-40B7546C3BE0}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU {B08BA891-ABA2-4BD5-80E8-40B7546C3BE0}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU {B08BA891-ABA2-4BD5-80E8-40B7546C3BE0}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU @@ -564,11 +614,11 @@ Global {F5598DCB-6DDE-4661-AD9D-A55612DA7E76} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B} {F0333D8E-0B27-42B7-B2C6-78F3657624E2} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04} {95F1F07C-4D92-4742-BD07-E5B805AAB651} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B} - {621E7211-58D0-45FD-9600-1CB490BD930E} = {EF0337F2-ED00-4643-89FD-EE10863F1870} {7796F5D8-31FC-45A4-B673-19DE5BA194CF} = {EF0337F2-ED00-4643-89FD-EE10863F1870} {A579E108-5445-403D-A407-339AC4D1611B} = {24CD3B53-141E-4A07-9B0D-796641E1CF78} {F16E3C6A-1C94-4EAB-BE91-099618060B68} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04} - {47857844-D05A-4C37-BFB2-AF19B7EC418D} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8} - {B08BA891-ABA2-4BD5-80E8-40B7546C3BE0} = {47857844-D05A-4C37-BFB2-AF19B7EC418D} + {5B810E3D-112E-4857-B197-F09D2FD41E27} = {EF0337F2-ED00-4643-89FD-EE10863F1870} + {CFE2FACB-4538-4B99-8A10-306F3882952D} = {EF0337F2-ED00-4643-89FD-EE10863F1870} + {B08BA891-ABA2-4BD5-80E8-40B7546C3BE0} = {EF0337F2-ED00-4643-89FD-EE10863F1870} EndGlobalSection EndGlobal diff --git a/eShopOnContainers.sln b/eShopOnContainers.sln index 9b3746fe5..33d6e2812 100644 --- a/eShopOnContainers.sln +++ b/eShopOnContainers.sln @@ -65,7 +65,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ordering.Infrastructure", " EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{02DF7FEE-C302-433D-A6CD-237A2569F236}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTests", "test\Services\FunctionalTests\FunctionalTests.csproj", "{621E7211-58D0-45FD-9600-1CB490BD930E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests", "test\Services\IntegrationTests\IntegrationTests.csproj", "{621E7211-58D0-45FD-9600-1CB490BD930E}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.UITests", "src\Mobile\eShopOnContainers\eShopOnContainers.UITests\eShopOnContainers.UITests.csproj", "{E3B18084-842C-4B80-8E4A-A7E588EC3137}" EndProject diff --git a/img/ebook_arch_dev_microservices_containers_cover.png b/img/ebook_arch_dev_microservices_containers_cover.png index 82db27bb9..1837354b5 100644 Binary files a/img/ebook_arch_dev_microservices_containers_cover.png and b/img/ebook_arch_dev_microservices_containers_cover.png differ diff --git a/img/exploring-to-production-ready.png b/img/exploring-to-production-ready.png new file mode 100644 index 000000000..f6d1dd672 Binary files /dev/null and b/img/exploring-to-production-ready.png differ diff --git a/src/Console/eShopConsole/Program.cs b/src/Console/eShopConsole/Program.cs deleted file mode 100644 index f647bc2d5..000000000 --- a/src/Console/eShopConsole/Program.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Linq; -using Microsoft.eShopOnContainers.Services.Ordering.SqlData.UnitOfWork; -using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel; -using Microsoft.eShopOnContainers.Services.Ordering.Domain.Contracts; -using Microsoft.eShopOnContainers.Services.Ordering.SqlData.Repositories; -using Microsoft.EntityFrameworkCore; - -namespace eShopConsole -{ - public class Program - { - public static void Main(string[] args) - { - //// All contexts that share the same service provider will share the same database - - ////Using InMemory DB - ////var options = DbContextUtil.CreateNewContextOptionsForInMemoryDB(); - - ////Using Sql Server - //var options = DbContextUtil.CreateNewContextOptionsForSqlDb(); - - //// Run the test against one instance of the context - //using (var context = new OrderingDbContext(options)) - //{ - // IOrderRepository orderRepository = new OrderRepository(context); - - // //Create generic Address ValueObject - // Address sampleAddress = new Address("15703 NE 61st Ct.", - // "Redmond", - // "Washington", - // "WA", - // "United States", - // "US", - // "98052", - // 47.661492, - // -122.131309 - // ); - // //Create sample Orders - // Order order1 = new Order(Guid.NewGuid(), sampleAddress, sampleAddress); - - // //Add a few OrderItems - // order1.AddNewOrderItem(Guid.NewGuid(), 2, 25, 30); - // order1.AddNewOrderItem(Guid.NewGuid(), 1, 58, 0); - // order1.AddNewOrderItem(Guid.NewGuid(), 1, 60, 0); - // order1.AddNewOrderItem(Guid.NewGuid(), 3, 12, 0); - // order1.AddNewOrderItem(Guid.NewGuid(), 5, 3, 0); - - // orderRepository.Add(order1); - // orderRepository.UnitOfWork.CommitAsync(); - - // //With no Async Repository - // //context.Orders.Add(order1); - // //context.SaveChanges(); - - //} - - ////// Use a separate instance of the context to verify correct data was saved to database - //using (var context = new OrderingDbContext(options)) - //{ - // var orders = context.Orders - // .Include(o => o.ShippingAddress) - // .Include(o => o.BillingAddress) - // .ToList(); - - // string cityName = orders.First().ShippingAddress.City; - // Console.WriteLine("City name retreived from SQL Server: "+cityName); - //} - } - } -} diff --git a/src/Console/eShopConsole/Properties/AssemblyInfo.cs b/src/Console/eShopConsole/Properties/AssemblyInfo.cs deleted file mode 100644 index 4c33ef24d..000000000 --- a/src/Console/eShopConsole/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("eShopConsole")] -[assembly: AssemblyTrademark("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("c10c7b69-ce4f-4167-928e-33b7fa1dffc7")] diff --git a/src/Console/eShopConsole/Properties/launchSettings.json b/src/Console/eShopConsole/Properties/launchSettings.json deleted file mode 100644 index 11c1111af..000000000 --- a/src/Console/eShopConsole/Properties/launchSettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "profiles": { - "Docker": { - "executablePath": "%WINDIR%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", - "commandLineArgs": "-ExecutionPolicy RemoteSigned .\\DockerTask.ps1 -Run -Environment $(Configuration) -Machine '$(DockerMachineName)'" - } - } -} \ No newline at end of file diff --git a/src/Console/eShopConsole/eShopConsole.xproj b/src/Console/eShopConsole/eShopConsole.xproj deleted file mode 100644 index 16b79ebb7..000000000 --- a/src/Console/eShopConsole/eShopConsole.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - c10c7b69-ce4f-4167-928e-33b7fa1dffc7 - eShopConsole - .\obj - .\bin\ - v4.6 - - - 2.0 - - - \ No newline at end of file diff --git a/src/Console/eShopConsole/project.json b/src/Console/eShopConsole/project.json deleted file mode 100644 index f953c60fe..000000000 --- a/src/Console/eShopConsole/project.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": "1.0.0-*", - "buildOptions": { - "emitEntryPoint": true, - "debugType": "portable" - }, - "dependencies": { - "Microsoft.EntityFrameworkCore": "1.0.0", - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.0" - }, - "Ordering.Domain": "1.0.0-*", - }, - "frameworks": { - "netcoreapp1.0": { - "imports": "dnxcore50" - } - }, - "publishOptions": { - "include": [ - "docker-compose.yml", - "docker-compose.debug.yml", - "Dockerfile.debug", - "Dockerfile", - ".dockerignore" - ] - } -} \ No newline at end of file diff --git a/src/Mobile/AndroidSDKManager.ps1 b/src/Mobile/AndroidSDKManager.ps1 new file mode 100644 index 000000000..653ef74e4 --- /dev/null +++ b/src/Mobile/AndroidSDKManager.ps1 @@ -0,0 +1,39 @@ +$AndroidToolPath = "${env:ProgramFiles(x86)}\Android\android-sdk\tools\android.bat" +if (!(Test-Path $AndroidToolPath)) { + $AndroidToolPath = "$env:localappdata\Android\android-sdk\tools\android.bat" +} elseif (!(Test-Path $AndroidToolPath)) { + Write-Error "Unable to find Android SDK Manager tools." + return +} + +Function Get-AndroidSDKs() { + $output = & $AndroidToolPath list sdk --all + $sdks = $output |% { + if ($_ -match '(?\d+)- (?.+), revision (?[\d\.]+)') { + $sdk = New-Object PSObject + Add-Member -InputObject $sdk -MemberType NoteProperty -Name Index -Value $Matches.index + Add-Member -InputObject $sdk -MemberType NoteProperty -Name Name -Value $Matches.sdk + Add-Member -InputObject $sdk -MemberType NoteProperty -Name Revision -Value $Matches.revision + $sdk + } + } + $sdks +} + +Function Install-AndroidSDK() { + [CmdletBinding()] + Param( + [Parameter(Mandatory=$true, Position=0)] + [PSObject[]]$sdks + ) + + $sdkIndexes = $sdks |% { $_.Index } + $sdkIndexArgument = [string]::Join(',', $sdkIndexes) + Echo 'y' | & $AndroidToolPath update sdk -u -a -t $sdkIndexArgument +} + +# Example usage: +# $sdks = Get-AndroidSDKs |? { $_.name -like 'sdk platform*API 10*' -or $_.name -like 'google apis*api 10' } +# Install-AndroidSDK -sdks $sdks + +# https://github.com/AArnott \ No newline at end of file diff --git a/src/Mobile/README.md b/src/Mobile/README.md index 8dffe3d3c..4f9262e9b 100644 --- a/src/Mobile/README.md +++ b/src/Mobile/README.md @@ -16,6 +16,7 @@ This project exercises the following platforms, frameworks or features: * Xamarin.Forms * XAML + * Behaviors * Bindings * Converters * Central Styles @@ -39,10 +40,10 @@ The app targets **three** platforms: * iOS * Android * Universal Windows Platform (UWP) - * UWP supported only in Visual Studio, not Xamarin Studio + * UWP supported only in Visual Studio, not Xamarin Studio or Visual Studio for MacOS -As of 19/12/2016, eShopOnContainers features **89.2% code share** (7.2% iOS / 16.7% Android / 8.7% Windows). +As of 07/03/2017, eShopOnContainers features **89.2% code share** (7.2% iOS / 16.7% Android / 8.7% Windows). ##Licenses @@ -55,12 +56,12 @@ This project uses some third-party assets with a license that requires attributi - [SlideOverKit](https://github.com/XAM-Consulting/SlideOverKit): by XAM-Consulting ## Requirements -### Requirements for Jan. 2017 version of eShopOnContainers +### Requirements for March 2017 version of eShopOnContainers * [Visual Studio __2015__](https://www.visualstudio.com/en-us/products/vs-2015-product-editions.aspx) (14.0 or higher) to compile C# 6 langage features (or Visual Studio MacOS) * Xamarin add-ons for Visual Studio (available via the Visual Studio installer) * __Visual Studio Community Edition is fully supported!__ -* Android SDK Tools 25.2.3 or higher +* [Android SDK Tools](https://developer.xamarin.com/guides/android/getting_started/installation/windows/) 25.2.3 or higher * JDK 8.0 ## Setup @@ -154,4 +155,4 @@ In the configuration window of the machine, go to the Compatibility section and Migrate to a physical computer with a different processor version ## Copyright and license -* Code and documentation copyright 2016 Microsoft Corp. Code released under the [MIT license](https://opensource.org/licenses/MIT). \ No newline at end of file +* Code and documentation copyright 2017 Microsoft Corp. Code released under the [MIT license](https://opensource.org/licenses/MIT). \ No newline at end of file diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml index 2c3a9c859..b1ed2ea4f 100644 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml +++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/App.xaml @@ -106,6 +106,7 @@ + " + - this.menuElement.innerHTML + - ""; - var width = 16; - var height = 16; - this.popup = window.createPopup(); - __wpm.menu = this; - var popupDocument = this.popup.document; - popupDocument.write(menuHTML); - this.popup.show(0, 0, width, height); - var popupBody = popupDocument.body; - width = popupBody.scrollWidth; - height = popupBody.scrollHeight; - if (width < this.menuLabelElement.offsetWidth) { - width = this.menuLabelElement.offsetWidth + 16; - } - if (this.menuElement.innerHTML.indexOf("progid:DXImageTransform.Microsoft.Shadow") != -1) { - popupBody.style.paddingRight = "4px"; - } - popupBody.__wpm = __wpm; - popupBody.__wpmDeleteWarning = __wpmDeleteWarning; - popupBody.__wpmCloseProviderWarning = __wpmCloseProviderWarning; - popupBody.popup = this.popup; - this.popup.hide(); - this.popup.show(0, this.menuLabelElement.offsetHeight, width, height, this.menuLabelElement); -} -function WebPartMenu_Hide() { - if (__wpm.menu == this) { - __wpm.menu = null; - if ((typeof(this.popup) != "undefined") && (this.popup != null)) { - this.popup.hide(); - this.popup = null; - } - } -} -function WebPartMenu_Hover() { - if (this.labelHoverClassName != "") { - this.menuLabelElement.className = this.menuLabelElement.className + " " + this.labelHoverClassName; - } - if (this.labelHoverColor != "") { - this.menuLabelElement.style.color = this.labelHoverColor; - } -} -function WebPartMenu_Unhover() { - if (this.labelHoverClassName != "") { - this.menuLabelElement.style.textDecoration = this.oldTextDecoration; - this.menuLabelElement.className = this.oldClassName; - } - if (this.labelHoverColor != "") { - this.menuLabelElement.style.color = this.oldColor; - } -} -function WebPartMenu_OnClick() { - var menu = window.event.srcElement.__menu; - if ((typeof(menu) != "undefined") && (menu != null)) { - window.event.returnValue = false; - window.event.cancelBubble = true; - menu.Show(); - } -} -function WebPartMenu_OnKeyPress() { - if (window.event.keyCode == 13) { - var menu = window.event.srcElement.__menu; - if ((typeof(menu) != "undefined") && (menu != null)) { - window.event.returnValue = false; - window.event.cancelBubble = true; - menu.Show(); - } - } -} -function WebPartMenu_OnMouseEnter() { - var menu = window.event.srcElement.__menu; - if ((typeof(menu) != "undefined") && (menu != null)) { - menu.Hover(); - } -} -function WebPartMenu_OnMouseLeave() { - var menu = window.event.srcElement.__menu; - if ((typeof(menu) != "undefined") && (menu != null)) { - menu.Unhover(); - } -} -function WebPartManager() { - this.overlayContainerElement = null; - this.zones = new Array(); - this.dragState = null; - this.menu = null; - this.draggedWebPart = null; - this.AddZone = WebPartManager_AddZone; - this.IsDragDropEnabled = WebPartManager_IsDragDropEnabled; - this.DragDrop = WebPartManager_DragDrop; - this.InitiateWebPartDragDrop = WebPartManager_InitiateWebPartDragDrop; - this.CompleteWebPartDragDrop = WebPartManager_CompleteWebPartDragDrop; - this.ContinueWebPartDragDrop = WebPartManager_ContinueWebPartDragDrop; - this.ProcessWebPartDragEnter = WebPartManager_ProcessWebPartDragEnter; - this.ProcessWebPartDragOver = WebPartManager_ProcessWebPartDragOver; - this.ProcessWebPartDrop = WebPartManager_ProcessWebPartDrop; - this.ShowHelp = WebPartManager_ShowHelp; - this.ExportWebPart = WebPartManager_ExportWebPart; - this.Execute = WebPartManager_Execute; - this.SubmitPage = WebPartManager_SubmitPage; - this.UpdatePositions = WebPartManager_UpdatePositions; - window.attachEvent("onunload", WebPartManager_Dispose); -} -function WebPartManager_Dispose() { - for (var i = 0; i < __wpm.zones.length; i++) { - __wpm.zones[i].Dispose(); - } - window.detachEvent("onunload", WebPartManager_Dispose); -} -function WebPartManager_AddZone(zoneElement, uniqueID, isVertical, allowLayoutChange, highlightColor) { - var zoneIndex = this.zones.length; - var zone = new Zone(zoneElement, zoneIndex, uniqueID, isVertical, allowLayoutChange, highlightColor); - this.zones[zoneIndex] = zone; - return zone; -} -function WebPartManager_IsDragDropEnabled() { - return ((typeof(this.overlayContainerElement) != "undefined") && (this.overlayContainerElement != null)); -} -function WebPartManager_DragDrop() { - if ((typeof(this.draggedWebPart) != "undefined") && (this.draggedWebPart != null)) { - var tempWebPart = this.draggedWebPart; - this.draggedWebPart = null; - tempWebPart.dragDrop(); - window.setTimeout("__wpClearSelection()", 0); - } -} -function WebPartManager_InitiateWebPartDragDrop(webPartElement) { - var webPart = webPartElement.__webPart; - this.UpdatePositions(); - this.dragState = new WebPartDragState(webPartElement, "move"); - var location = __wpGetPageEventLocation(window.event, true); - var overlayContainerElement = this.overlayContainerElement; - overlayContainerElement.style.left = location.x - webPartElement.offsetWidth / 2; - overlayContainerElement.style.top = location.y + 4 + (webPartElement.clientTop ? webPartElement.clientTop : 0); - overlayContainerElement.style.display = "block"; - overlayContainerElement.style.width = webPartElement.offsetWidth; - overlayContainerElement.style.height = webPartElement.offsetHeight; - overlayContainerElement.appendChild(webPartElement.cloneNode(true)); - if (webPart.allowZoneChange == false) { - webPart.zone.allowDrop = true; - } - else { - for (var i = 0; i < __wpm.zones.length; i++) { - var zone = __wpm.zones[i]; - if (zone.allowLayoutChange) { - zone.allowDrop = true; - } - } - } - document.body.attachEvent("ondragover", Zone_OnDragOver); - return "move"; -} -function WebPartManager_CompleteWebPartDragDrop() { - var dragState = this.dragState; - this.dragState = null; - if ((typeof(dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) { - dragState.dropZoneElement.__zone.ToggleDropCues(false, dragState.dropIndex, false); - } - document.body.detachEvent("ondragover", Zone_OnDragOver); - for (var i = 0; i < __wpm.zones.length; i++) { - __wpm.zones[i].allowDrop = false; - } - this.overlayContainerElement.removeChild(this.overlayContainerElement.firstChild); - this.overlayContainerElement.style.display = "none"; - if ((typeof(dragState) != "undefined") && (dragState != null) && (dragState.dropped == true)) { - var currentZone = dragState.webPartElement.__webPart.zone; - var currentZoneIndex = dragState.webPartElement.__webPart.zoneIndex; - if ((currentZone != dragState.dropZoneElement.__zone) || - ((currentZoneIndex != dragState.dropIndex) && - (currentZoneIndex != (dragState.dropIndex - 1)))) { - var eventTarget = dragState.dropZoneElement.__zone.uniqueID; - var eventArgument = "Drag:" + dragState.webPartElement.id + ":" + dragState.dropIndex; - this.SubmitPage(eventTarget, eventArgument); - } - } -} -function WebPartManager_ContinueWebPartDragDrop() { - var dragState = this.dragState; - if ((typeof(dragState) != "undefined") && (dragState != null)) { - var style = this.overlayContainerElement.style; - var location = __wpGetPageEventLocation(window.event, true); - style.left = location.x - dragState.webPartElement.offsetWidth / 2; - style.top = location.y + 4 + (dragState.webPartElement.clientTop ? dragState.webPartElement.clientTop : 0); - } -} -function WebPartManager_Execute(script) { - if (this.menu) { - this.menu.Hide(); - } - var scriptReference = new Function(script); - return (scriptReference() != false); -} -function WebPartManager_ProcessWebPartDragEnter() { - var dragState = __wpm.dragState; - if ((typeof(dragState) != "undefined") && (dragState != null)) { - var currentEvent = window.event; - var newDropZoneElement = Zone_GetParentZoneElement(currentEvent.srcElement); - if ((typeof(newDropZoneElement.__zone) == "undefined") || (newDropZoneElement.__zone == null) || - (newDropZoneElement.__zone.allowDrop == false)) { - newDropZoneElement = null; - } - var newDropIndex = -1; - if ((typeof(newDropZoneElement) != "undefined") && (newDropZoneElement != null)) { - newDropIndex = newDropZoneElement.__zone.GetWebPartIndex(__wpGetPageEventLocation(currentEvent, false)); - if (newDropIndex == -1) { - newDropZoneElement = null; - } - } - if (dragState.dropZoneElement != newDropZoneElement) { - if ((typeof(dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) { - dragState.dropZoneElement.__zone.ToggleDropCues(false, dragState.dropIndex, false); - } - dragState.dropZoneElement = newDropZoneElement; - dragState.dropIndex = newDropIndex; - if ((typeof(newDropZoneElement) != "undefined") && (newDropZoneElement != null)) { - newDropZoneElement.__zone.ToggleDropCues(true, newDropIndex, false); - } - } - else if (dragState.dropIndex != newDropIndex) { - if (dragState.dropIndex != -1) { - dragState.dropZoneElement.__zone.ToggleDropCues(false, dragState.dropIndex, false); - } - dragState.dropIndex = newDropIndex; - if ((typeof(newDropZoneElement) != "undefined") && (newDropZoneElement != null)) { - newDropZoneElement.__zone.ToggleDropCues(true, newDropIndex, false); - } - } - if ((typeof(dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) { - currentEvent.dataTransfer.effectAllowed = dragState.effect; - } - return true; - } - return false; -} -function WebPartManager_ProcessWebPartDragOver() { - var dragState = __wpm.dragState; - var currentEvent = window.event; - var handled = false; - if ((typeof(dragState) != "undefined") && (dragState != null) && - (typeof(dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) { - var dropZoneElement = Zone_GetParentZoneElement(currentEvent.srcElement); - if ((typeof(dropZoneElement) != "undefined") && (dropZoneElement != null) && (dropZoneElement.__zone.allowDrop == false)) { - dropZoneElement = null; - } - if (((typeof(dropZoneElement) == "undefined") || (dropZoneElement == null)) && - (typeof(dragState.dropZoneElement) != "undefined") && (dragState.dropZoneElement != null)) { - dragState.dropZoneElement.__zone.ToggleDropCues(false, __wpm.dragState.dropIndex, false); - dragState.dropZoneElement = null; - dragState.dropIndex = -1; - } - else if ((typeof(dropZoneElement) != "undefined") && (dropZoneElement != null)) { - var location = __wpGetPageEventLocation(currentEvent, false); - var newDropIndex = dropZoneElement.__zone.GetWebPartIndex(location); - if (newDropIndex == -1) { - dropZoneElement = null; - } - if (dragState.dropZoneElement != dropZoneElement) { - if ((dragState.dropIndex != -1) || (typeof(dropZoneElement) == "undefined") || (dropZoneElement == null)) { - dragState.dropZoneElement.__zone.ToggleDropCues(false, __wpm.dragState.dropIndex, false); - } - dragState.dropZoneElement = dropZoneElement; - } - else { - dragState.dropZoneElement.__zone.ToggleDropCues(false, dragState.dropIndex, true); - } - dragState.dropIndex = newDropIndex; - if ((typeof(dropZoneElement) != "undefined") && (dropZoneElement != null)) { - dropZoneElement.__zone.ToggleDropCues(true, newDropIndex, false); - } - } - handled = true; - } - if ((typeof(dragState) == "undefined") || (dragState == null) || - (typeof(dragState.dropZoneElement) == "undefined") || (dragState.dropZoneElement == null)) { - currentEvent.dataTransfer.effectAllowed = "none"; - } - return handled; -} -function WebPartManager_ProcessWebPartDrop() { - var dragState = this.dragState; - if ((typeof(dragState) != "undefined") && (dragState != null)) { - var currentEvent = window.event; - var dropZoneElement = Zone_GetParentZoneElement(currentEvent.srcElement); - if ((typeof(dropZoneElement) != "undefined") && (dropZoneElement != null) && (dropZoneElement.__zone.allowDrop == false)) { - dropZoneElement = null; - } - if ((typeof(dropZoneElement) != "undefined") && (dropZoneElement != null) && (dragState.dropZoneElement == dropZoneElement)) { - dragState.dropped = true; - } - return true; - } - return false; -} -function WebPartManager_ShowHelp(helpUrl, helpMode) { - if ((typeof(this.menu) != "undefined") && (this.menu != null)) { - this.menu.Hide(); - } - if (helpMode == 0 || helpMode == 1) { - if (helpMode == 0) { - var dialogInfo = "edge: Sunken; center: yes; help: no; resizable: yes; status: no"; - window.showModalDialog(helpUrl, null, dialogInfo); - } - else { - window.open(helpUrl, null, "scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no"); - } - } - else if (helpMode == 2) { - window.location = helpUrl; - } -} -function WebPartManager_ExportWebPart(exportUrl, warn, confirmOnly) { - if (warn == true && __wpmExportWarning.length > 0 && this.personalizationScopeShared != true) { - if (confirm(__wpmExportWarning) == false) { - return false; - } - } - if (confirmOnly == false) { - window.location = exportUrl; - } - return true; -} -function WebPartManager_UpdatePositions() { - for (var i = 0; i < this.zones.length; i++) { - this.zones[i].UpdatePosition(); - } -} -function WebPartManager_SubmitPage(eventTarget, eventArgument) { - if ((typeof(this.menu) != "undefined") && (this.menu != null)) { - this.menu.Hide(); - } - __doPostBack(eventTarget, eventArgument); -} diff --git a/src/Web/Catalog.WebForms/Catalog.WebForms/Scripts/WebForms/WebUIValidation.js b/src/Web/Catalog.WebForms/Catalog.WebForms/Scripts/WebForms/WebUIValidation.js deleted file mode 100644 index 3b612ff01..000000000 --- a/src/Web/Catalog.WebForms/Catalog.WebForms/Scripts/WebForms/WebUIValidation.js +++ /dev/null @@ -1,684 +0,0 @@ -//CdnPath=http://ajax.aspnetcdn.com/ajax/4.5.1/1/WebUIValidation.js -var Page_ValidationVer = "125"; -var Page_IsValid = true; -var Page_BlockSubmit = false; -var Page_InvalidControlToBeFocused = null; -var Page_TextTypes = /^(text|password|file|search|tel|url|email|number|range|color|datetime|date|month|week|time|datetime-local)$/i; -function ValidatorUpdateDisplay(val) { - if (typeof(val.display) == "string") { - if (val.display == "None") { - return; - } - if (val.display == "Dynamic") { - val.style.display = val.isvalid ? "none" : "inline"; - return; - } - } - if ((navigator.userAgent.indexOf("Mac") > -1) && - (navigator.userAgent.indexOf("MSIE") > -1)) { - val.style.display = "inline"; - } - val.style.visibility = val.isvalid ? "hidden" : "visible"; -} -function ValidatorUpdateIsValid() { - Page_IsValid = AllValidatorsValid(Page_Validators); -} -function AllValidatorsValid(validators) { - if ((typeof(validators) != "undefined") && (validators != null)) { - var i; - for (i = 0; i < validators.length; i++) { - if (!validators[i].isvalid) { - return false; - } - } - } - return true; -} -function ValidatorHookupControlID(controlID, val) { - if (typeof(controlID) != "string") { - return; - } - var ctrl = document.getElementById(controlID); - if ((typeof(ctrl) != "undefined") && (ctrl != null)) { - ValidatorHookupControl(ctrl, val); - } - else { - val.isvalid = true; - val.enabled = false; - } -} -function ValidatorHookupControl(control, val) { - if (typeof(control.tagName) != "string") { - return; - } - if (control.tagName != "INPUT" && control.tagName != "TEXTAREA" && control.tagName != "SELECT") { - var i; - for (i = 0; i < control.childNodes.length; i++) { - ValidatorHookupControl(control.childNodes[i], val); - } - return; - } - else { - if (typeof(control.Validators) == "undefined") { - control.Validators = new Array; - var eventType; - if (control.type == "radio") { - eventType = "onclick"; - } else { - eventType = "onchange"; - if (typeof(val.focusOnError) == "string" && val.focusOnError == "t") { - ValidatorHookupEvent(control, "onblur", "ValidatedControlOnBlur(event); "); - } - } - ValidatorHookupEvent(control, eventType, "ValidatorOnChange(event); "); - if (Page_TextTypes.test(control.type)) { - ValidatorHookupEvent(control, "onkeypress", - "event = event || window.event; if (!ValidatedTextBoxOnKeyPress(event)) { event.cancelBubble = true; if (event.stopPropagation) event.stopPropagation(); return false; } "); - } - } - control.Validators[control.Validators.length] = val; - } -} -function ValidatorHookupEvent(control, eventType, functionPrefix) { - var ev = control[eventType]; - if (typeof(ev) == "function") { - ev = ev.toString(); - ev = ev.substring(ev.indexOf("{") + 1, ev.lastIndexOf("}")); - } - else { - ev = ""; - } - control[eventType] = new Function("event", functionPrefix + " " + ev); -} -function ValidatorGetValue(id) { - var control; - control = document.getElementById(id); - if (typeof(control.value) == "string") { - return control.value; - } - return ValidatorGetValueRecursive(control); -} -function ValidatorGetValueRecursive(control) -{ - if (typeof(control.value) == "string" && (control.type != "radio" || control.checked == true)) { - return control.value; - } - var i, val; - for (i = 0; i twoDigitCutoffYear) ? (cutoffYearCentury - 100 + year) : (cutoffYearCentury + year)); - } - var num, cleanInput, m, exp; - if (dataType == "Integer") { - exp = /^\s*[-\+]?\d+\s*$/; - if (op.match(exp) == null) - return null; - num = parseInt(op, 10); - return (isNaN(num) ? null : num); - } - else if(dataType == "Double") { - exp = new RegExp("^\\s*([-\\+])?(\\d*)\\" + val.decimalchar + "?(\\d*)\\s*$"); - m = op.match(exp); - if (m == null) - return null; - if (m[2].length == 0 && m[3].length == 0) - return null; - cleanInput = (m[1] != null ? m[1] : "") + (m[2].length>0 ? m[2] : "0") + (m[3].length>0 ? "." + m[3] : ""); - num = parseFloat(cleanInput); - return (isNaN(num) ? null : num); - } - else if (dataType == "Currency") { - var hasDigits = (val.digits > 0); - var beginGroupSize, subsequentGroupSize; - var groupSizeNum = parseInt(val.groupsize, 10); - if (!isNaN(groupSizeNum) && groupSizeNum > 0) { - beginGroupSize = "{1," + groupSizeNum + "}"; - subsequentGroupSize = "{" + groupSizeNum + "}"; - } - else { - beginGroupSize = subsequentGroupSize = "+"; - } - exp = new RegExp("^\\s*([-\\+])?((\\d" + beginGroupSize + "(\\" + val.groupchar + "\\d" + subsequentGroupSize + ")+)|\\d*)" - + (hasDigits ? "\\" + val.decimalchar + "?(\\d{0," + val.digits + "})" : "") - + "\\s*$"); - m = op.match(exp); - if (m == null) - return null; - if (m[2].length == 0 && hasDigits && m[5].length == 0) - return null; - cleanInput = (m[1] != null ? m[1] : "") + m[2].replace(new RegExp("(\\" + val.groupchar + ")", "g"), "") + ((hasDigits && m[5].length > 0) ? "." + m[5] : ""); - num = parseFloat(cleanInput); - return (isNaN(num) ? null : num); - } - else if (dataType == "Date") { - var yearFirstExp = new RegExp("^\\s*((\\d{4})|(\\d{2}))([-/]|\\. ?)(\\d{1,2})\\4(\\d{1,2})\\.?\\s*$"); - m = op.match(yearFirstExp); - var day, month, year; - if (m != null && (((typeof(m[2]) != "undefined") && (m[2].length == 4)) || val.dateorder == "ymd")) { - day = m[6]; - month = m[5]; - year = (m[2].length == 4) ? m[2] : GetFullYear(parseInt(m[3], 10)); - } - else { - if (val.dateorder == "ymd"){ - return null; - } - var yearLastExp = new RegExp("^\\s*(\\d{1,2})([-/]|\\. ?)(\\d{1,2})(?:\\s|\\2)((\\d{4})|(\\d{2}))(?:\\s\u0433\\.|\\.)?\\s*$"); - m = op.match(yearLastExp); - if (m == null) { - return null; - } - if (val.dateorder == "mdy") { - day = m[3]; - month = m[1]; - } - else { - day = m[1]; - month = m[3]; - } - year = ((typeof(m[5]) != "undefined") && (m[5].length == 4)) ? m[5] : GetFullYear(parseInt(m[6], 10)); - } - month -= 1; - var date = new Date(year, month, day); - if (year < 100) { - date.setFullYear(year); - } - return (typeof(date) == "object" && year == date.getFullYear() && month == date.getMonth() && day == date.getDate()) ? date.valueOf() : null; - } - else { - return op.toString(); - } -} -function ValidatorCompare(operand1, operand2, operator, val) { - var dataType = val.type; - var op1, op2; - if ((op1 = ValidatorConvert(operand1, dataType, val)) == null) - return false; - if (operator == "DataTypeCheck") - return true; - if ((op2 = ValidatorConvert(operand2, dataType, val)) == null) - return true; - switch (operator) { - case "NotEqual": - return (op1 != op2); - case "GreaterThan": - return (op1 > op2); - case "GreaterThanEqual": - return (op1 >= op2); - case "LessThan": - return (op1 < op2); - case "LessThanEqual": - return (op1 <= op2); - default: - return (op1 == op2); - } -} -function CompareValidatorEvaluateIsValid(val) { - var value = ValidatorGetValue(val.controltovalidate); - if (ValidatorTrim(value).length == 0) - return true; - var compareTo = ""; - if ((typeof(val.controltocompare) != "string") || - (typeof(document.getElementById(val.controltocompare)) == "undefined") || - (null == document.getElementById(val.controltocompare))) { - if (typeof(val.valuetocompare) == "string") { - compareTo = val.valuetocompare; - } - } - else { - compareTo = ValidatorGetValue(val.controltocompare); - } - var operator = "Equal"; - if (typeof(val.operator) == "string") { - operator = val.operator; - } - return ValidatorCompare(value, compareTo, operator, val); -} -function CustomValidatorEvaluateIsValid(val) { - var value = ""; - if (typeof(val.controltovalidate) == "string") { - value = ValidatorGetValue(val.controltovalidate); - if ((ValidatorTrim(value).length == 0) && - ((typeof(val.validateemptytext) != "string") || (val.validateemptytext != "true"))) { - return true; - } - } - var args = { Value:value, IsValid:true }; - if (typeof(val.clientvalidationfunction) == "string") { - eval(val.clientvalidationfunction + "(val, args) ;"); - } - return args.IsValid; -} -function RegularExpressionValidatorEvaluateIsValid(val) { - var value = ValidatorGetValue(val.controltovalidate); - if (ValidatorTrim(value).length == 0) - return true; - var rx = new RegExp(val.validationexpression); - var matches = rx.exec(value); - return (matches != null && value == matches[0]); -} -function ValidatorTrim(s) { - var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/); - return (m == null) ? "" : m[1]; -} -function RequiredFieldValidatorEvaluateIsValid(val) { - return (ValidatorTrim(ValidatorGetValue(val.controltovalidate)) != ValidatorTrim(val.initialvalue)) -} -function RangeValidatorEvaluateIsValid(val) { - var value = ValidatorGetValue(val.controltovalidate); - if (ValidatorTrim(value).length == 0) - return true; - return (ValidatorCompare(value, val.minimumvalue, "GreaterThanEqual", val) && - ValidatorCompare(value, val.maximumvalue, "LessThanEqual", val)); -} -function ValidationSummaryOnSubmit(validationGroup) { - if (typeof(Page_ValidationSummaries) == "undefined") - return; - var summary, sums, s; - var headerSep, first, pre, post, end; - for (sums = 0; sums < Page_ValidationSummaries.length; sums++) { - summary = Page_ValidationSummaries[sums]; - if (!summary) continue; - summary.style.display = "none"; - if (!Page_IsValid && IsValidationGroupMatch(summary, validationGroup)) { - var i; - if (summary.showsummary != "False") { - summary.style.display = ""; - if (typeof(summary.displaymode) != "string") { - summary.displaymode = "BulletList"; - } - switch (summary.displaymode) { - case "List": - headerSep = "
"; - first = ""; - pre = ""; - post = "
"; - end = ""; - break; - case "BulletList": - default: - headerSep = ""; - first = "

"; - break; - case "SingleParagraph": - headerSep = " "; - first = ""; - pre = ""; - post = " "; - end = "
"; - break; - } - s = ""; - if (typeof(summary.headertext) == "string") { - s += summary.headertext + headerSep; - } - s += first; - for (i=0; i= 0) { - Page_Validators.splice(index, 1); - } - } - function addNormalizedAttribute(name, normalizedName) { - normalizedAttributes[name.toLowerCase()] = normalizedName; - } - function parseSpecificAttribute(selector, attribute, validatorsArray) { - return $(selector).find("[" + attribute + "='true']").each(function (index, element) { - addValidationExpando(element); - element.dispose = function () { dispose(element); element.dispose = null; }; - if ($.inArray(element, validatorsArray) === -1) { - validatorsArray.push(element); - } - }).length; - } - function parse(selector) { - var length = parseSpecificAttribute(selector, dataValidationAttribute, Page_Validators); - length += parseSpecificAttribute(selector, dataValidationSummaryAttribute, Page_ValidationSummaries); - return length; - } - function loadValidators() { - if (typeof (ValidatorOnLoad) === "function") { - ValidatorOnLoad(); - } - if (typeof (ValidatorOnSubmit) === "undefined") { - window.ValidatorOnSubmit = function () { - return Page_ValidationActive ? ValidatorCommonOnSubmit() : true; - }; - } - } - function registerUpdatePanel() { - if (window.Sys && Sys.WebForms && Sys.WebForms.PageRequestManager) { - var prm = Sys.WebForms.PageRequestManager.getInstance(), - postBackElement, endRequestHandler; - if (prm.get_isInAsyncPostBack()) { - endRequestHandler = function (sender, args) { - if (parse(document)) { - loadValidators(); - } - prm.remove_endRequest(endRequestHandler); - endRequestHandler = null; - }; - prm.add_endRequest(endRequestHandler); - } - prm.add_beginRequest(function (sender, args) { - postBackElement = args.get_postBackElement(); - }); - prm.add_pageLoaded(function (sender, args) { - var i, panels, valFound = 0; - if (typeof (postBackElement) === "undefined") { - return; - } - panels = args.get_panelsUpdated(); - for (i = 0; i < panels.length; i++) { - valFound += parse(panels[i]); - } - panels = args.get_panelsCreated(); - for (i = 0; i < panels.length; i++) { - valFound += parse(panels[i]); - } - if (valFound) { - loadValidators(); - } - }); - } - } - $(function () { - if (typeof (Page_Validators) === "undefined") { - window.Page_Validators = []; - } - if (typeof (Page_ValidationSummaries) === "undefined") { - window.Page_ValidationSummaries = []; - } - if (typeof (Page_ValidationActive) === "undefined") { - window.Page_ValidationActive = false; - } - $.WebFormValidator = { - addNormalizedAttribute: addNormalizedAttribute, - parse: parse - }; - if (parse(document)) { - loadValidators(); - } - registerUpdatePanel(); - }); - } (jQuery)); -} \ No newline at end of file diff --git a/src/Web/Catalog.WebForms/Catalog.WebForms/Scripts/bootstrap.js b/src/Web/Catalog.WebForms/Catalog.WebForms/Scripts/bootstrap.js deleted file mode 100644 index 5aa9982ed..000000000 --- a/src/Web/Catalog.WebForms/Catalog.WebForms/Scripts/bootstrap.js +++ /dev/null @@ -1,2014 +0,0 @@ -/* NUGET: BEGIN LICENSE TEXT - * - * Microsoft grants you the right to use these script files for the sole - * purpose of either: (i) interacting through your browser with the Microsoft - * website or online service, subject to the applicable licensing or use - * terms; or (ii) using the files as included with a Microsoft product subject - * to that product's license terms. Microsoft reserves all other rights to the - * files not expressly granted by Microsoft, whether by implication, estoppel - * or otherwise. Insofar as a script file is dual licensed under GPL, - * Microsoft neither took the code under GPL nor distributes it thereunder but - * under the terms set out in this paragraph. All notices and licenses - * below are for informational purposes only. - * - * NUGET: END LICENSE TEXT */ - -/** -* bootstrap.js v3.0.0 by @fat and @mdo -* Copyright 2013 Twitter Inc. -* http://www.apache.org/licenses/LICENSE-2.0 -*/ -if (!jQuery) { throw new Error("Bootstrap requires jQuery") } - -/* ======================================================================== - * Bootstrap: transition.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#transitions - * ======================================================================== - * Copyright 2013 Twitter, Inc. - * - * 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 ($) { "use strict"; - - // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) - // ============================================================ - - function transitionEnd() { - var el = document.createElement('bootstrap') - - var transEndEventNames = { - 'WebkitTransition' : 'webkitTransitionEnd' - , 'MozTransition' : 'transitionend' - , 'OTransition' : 'oTransitionEnd otransitionend' - , 'transition' : 'transitionend' - } - - for (var name in transEndEventNames) { - if (el.style[name] !== undefined) { - return { end: transEndEventNames[name] } - } - } - } - - // http://blog.alexmaccaw.com/css-transitions - $.fn.emulateTransitionEnd = function (duration) { - var called = false, $el = this - $(this).one($.support.transition.end, function () { called = true }) - var callback = function () { if (!called) $($el).trigger($.support.transition.end) } - setTimeout(callback, duration) - return this - } - - $(function () { - $.support.transition = transitionEnd() - }) - -}(window.jQuery); - -/* ======================================================================== - * Bootstrap: alert.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#alerts - * ======================================================================== - * Copyright 2013 Twitter, Inc. - * - * 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 ($) { "use strict"; - - // ALERT CLASS DEFINITION - // ====================== - - var dismiss = '[data-dismiss="alert"]' - var Alert = function (el) { - $(el).on('click', dismiss, this.close) - } - - Alert.prototype.close = function (e) { - var $this = $(this) - var selector = $this.attr('data-target') - - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 - } - - var $parent = $(selector) - - if (e) e.preventDefault() - - if (!$parent.length) { - $parent = $this.hasClass('alert') ? $this : $this.parent() - } - - $parent.trigger(e = $.Event('close.bs.alert')) - - if (e.isDefaultPrevented()) return - - $parent.removeClass('in') - - function removeElement() { - $parent.trigger('closed.bs.alert').remove() - } - - $.support.transition && $parent.hasClass('fade') ? - $parent - .one($.support.transition.end, removeElement) - .emulateTransitionEnd(150) : - removeElement() - } - - - // ALERT PLUGIN DEFINITION - // ======================= - - var old = $.fn.alert - - $.fn.alert = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.alert') - - if (!data) $this.data('bs.alert', (data = new Alert(this))) - if (typeof option == 'string') data[option].call($this) - }) - } - - $.fn.alert.Constructor = Alert - - - // ALERT NO CONFLICT - // ================= - - $.fn.alert.noConflict = function () { - $.fn.alert = old - return this - } - - - // ALERT DATA-API - // ============== - - $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) - -}(window.jQuery); - -/* ======================================================================== - * Bootstrap: button.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#buttons - * ======================================================================== - * Copyright 2013 Twitter, Inc. - * - * 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 ($) { "use strict"; - - // BUTTON PUBLIC CLASS DEFINITION - // ============================== - - var Button = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Button.DEFAULTS, options) - } - - Button.DEFAULTS = { - loadingText: 'loading...' - } - - Button.prototype.setState = function (state) { - var d = 'disabled' - var $el = this.$element - var val = $el.is('input') ? 'val' : 'html' - var data = $el.data() - - state = state + 'Text' - - if (!data.resetText) $el.data('resetText', $el[val]()) - - $el[val](data[state] || this.options[state]) - - // push to event loop to allow forms to submit - setTimeout(function () { - state == 'loadingText' ? - $el.addClass(d).attr(d, d) : - $el.removeClass(d).removeAttr(d); - }, 0) - } - - Button.prototype.toggle = function () { - var $parent = this.$element.closest('[data-toggle="buttons"]') - - if ($parent.length) { - var $input = this.$element.find('input') - .prop('checked', !this.$element.hasClass('active')) - .trigger('change') - if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active') - } - - this.$element.toggleClass('active') - } - - - // BUTTON PLUGIN DEFINITION - // ======================== - - var old = $.fn.button - - $.fn.button = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.button') - var options = typeof option == 'object' && option - - if (!data) $this.data('bs.button', (data = new Button(this, options))) - - if (option == 'toggle') data.toggle() - else if (option) data.setState(option) - }) - } - - $.fn.button.Constructor = Button - - - // BUTTON NO CONFLICT - // ================== - - $.fn.button.noConflict = function () { - $.fn.button = old - return this - } - - - // BUTTON DATA-API - // =============== - - $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') - $btn.button('toggle') - e.preventDefault() - }) - -}(window.jQuery); - -/* ======================================================================== - * Bootstrap: carousel.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#carousel - * ======================================================================== - * Copyright 2012 Twitter, Inc. - * - * 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 ($) { "use strict"; - - // CAROUSEL CLASS DEFINITION - // ========================= - - var Carousel = function (element, options) { - this.$element = $(element) - this.$indicators = this.$element.find('.carousel-indicators') - this.options = options - this.paused = - this.sliding = - this.interval = - this.$active = - this.$items = null - - this.options.pause == 'hover' && this.$element - .on('mouseenter', $.proxy(this.pause, this)) - .on('mouseleave', $.proxy(this.cycle, this)) - } - - Carousel.DEFAULTS = { - interval: 5000 - , pause: 'hover' - , wrap: true - } - - Carousel.prototype.cycle = function (e) { - e || (this.paused = false) - - this.interval && clearInterval(this.interval) - - this.options.interval - && !this.paused - && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) - - return this - } - - Carousel.prototype.getActiveIndex = function () { - this.$active = this.$element.find('.item.active') - this.$items = this.$active.parent().children() - - return this.$items.index(this.$active) - } - - Carousel.prototype.to = function (pos) { - var that = this - var activeIndex = this.getActiveIndex() - - if (pos > (this.$items.length - 1) || pos < 0) return - - if (this.sliding) return this.$element.one('slid', function () { that.to(pos) }) - if (activeIndex == pos) return this.pause().cycle() - - return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) - } - - Carousel.prototype.pause = function (e) { - e || (this.paused = true) - - if (this.$element.find('.next, .prev').length && $.support.transition.end) { - this.$element.trigger($.support.transition.end) - this.cycle(true) - } - - this.interval = clearInterval(this.interval) - - return this - } - - Carousel.prototype.next = function () { - if (this.sliding) return - return this.slide('next') - } - - Carousel.prototype.prev = function () { - if (this.sliding) return - return this.slide('prev') - } - - Carousel.prototype.slide = function (type, next) { - var $active = this.$element.find('.item.active') - var $next = next || $active[type]() - var isCycling = this.interval - var direction = type == 'next' ? 'left' : 'right' - var fallback = type == 'next' ? 'first' : 'last' - var that = this - - if (!$next.length) { - if (!this.options.wrap) return - $next = this.$element.find('.item')[fallback]() - } - - this.sliding = true - - isCycling && this.pause() - - var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) - - if ($next.hasClass('active')) return - - if (this.$indicators.length) { - this.$indicators.find('.active').removeClass('active') - this.$element.one('slid', function () { - var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) - $nextIndicator && $nextIndicator.addClass('active') - }) - } - - if ($.support.transition && this.$element.hasClass('slide')) { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $next.addClass(type) - $next[0].offsetWidth // force reflow - $active.addClass(direction) - $next.addClass(direction) - $active - .one($.support.transition.end, function () { - $next.removeClass([type, direction].join(' ')).addClass('active') - $active.removeClass(['active', direction].join(' ')) - that.sliding = false - setTimeout(function () { that.$element.trigger('slid') }, 0) - }) - .emulateTransitionEnd(600) - } else { - this.$element.trigger(e) - if (e.isDefaultPrevented()) return - $active.removeClass('active') - $next.addClass('active') - this.sliding = false - this.$element.trigger('slid') - } - - isCycling && this.cycle() - - return this - } - - - // CAROUSEL PLUGIN DEFINITION - // ========================== - - var old = $.fn.carousel - - $.fn.carousel = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.carousel') - var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) - var action = typeof option == 'string' ? option : options.slide - - if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) - if (typeof option == 'number') data.to(option) - else if (action) data[action]() - else if (options.interval) data.pause().cycle() - }) - } - - $.fn.carousel.Constructor = Carousel - - - // CAROUSEL NO CONFLICT - // ==================== - - $.fn.carousel.noConflict = function () { - $.fn.carousel = old - return this - } - - - // CAROUSEL DATA-API - // ================= - - $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { - var $this = $(this), href - var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 - var options = $.extend({}, $target.data(), $this.data()) - var slideIndex = $this.attr('data-slide-to') - if (slideIndex) options.interval = false - - $target.carousel(options) - - if (slideIndex = $this.attr('data-slide-to')) { - $target.data('bs.carousel').to(slideIndex) - } - - e.preventDefault() - }) - - $(window).on('load', function () { - $('[data-ride="carousel"]').each(function () { - var $carousel = $(this) - $carousel.carousel($carousel.data()) - }) - }) - -}(window.jQuery); - -/* ======================================================================== - * Bootstrap: collapse.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#collapse - * ======================================================================== - * Copyright 2012 Twitter, Inc. - * - * 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 ($) { "use strict"; - - // COLLAPSE PUBLIC CLASS DEFINITION - // ================================ - - var Collapse = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Collapse.DEFAULTS, options) - this.transitioning = null - - if (this.options.parent) this.$parent = $(this.options.parent) - if (this.options.toggle) this.toggle() - } - - Collapse.DEFAULTS = { - toggle: true - } - - Collapse.prototype.dimension = function () { - var hasWidth = this.$element.hasClass('width') - return hasWidth ? 'width' : 'height' - } - - Collapse.prototype.show = function () { - if (this.transitioning || this.$element.hasClass('in')) return - - var startEvent = $.Event('show.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - var actives = this.$parent && this.$parent.find('> .panel > .in') - - if (actives && actives.length) { - var hasData = actives.data('bs.collapse') - if (hasData && hasData.transitioning) return - actives.collapse('hide') - hasData || actives.data('bs.collapse', null) - } - - var dimension = this.dimension() - - this.$element - .removeClass('collapse') - .addClass('collapsing') - [dimension](0) - - this.transitioning = 1 - - var complete = function () { - this.$element - .removeClass('collapsing') - .addClass('in') - [dimension]('auto') - this.transitioning = 0 - this.$element.trigger('shown.bs.collapse') - } - - if (!$.support.transition) return complete.call(this) - - var scrollSize = $.camelCase(['scroll', dimension].join('-')) - - this.$element - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) - [dimension](this.$element[0][scrollSize]) - } - - Collapse.prototype.hide = function () { - if (this.transitioning || !this.$element.hasClass('in')) return - - var startEvent = $.Event('hide.bs.collapse') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - var dimension = this.dimension() - - this.$element - [dimension](this.$element[dimension]()) - [0].offsetHeight - - this.$element - .addClass('collapsing') - .removeClass('collapse') - .removeClass('in') - - this.transitioning = 1 - - var complete = function () { - this.transitioning = 0 - this.$element - .trigger('hidden.bs.collapse') - .removeClass('collapsing') - .addClass('collapse') - } - - if (!$.support.transition) return complete.call(this) - - this.$element - [dimension](0) - .one($.support.transition.end, $.proxy(complete, this)) - .emulateTransitionEnd(350) - } - - Collapse.prototype.toggle = function () { - this[this.$element.hasClass('in') ? 'hide' : 'show']() - } - - - // COLLAPSE PLUGIN DEFINITION - // ========================== - - var old = $.fn.collapse - - $.fn.collapse = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.collapse') - var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) - - if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.collapse.Constructor = Collapse - - - // COLLAPSE NO CONFLICT - // ==================== - - $.fn.collapse.noConflict = function () { - $.fn.collapse = old - return this - } - - - // COLLAPSE DATA-API - // ================= - - $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { - var $this = $(this), href - var target = $this.attr('data-target') - || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - var $target = $(target) - var data = $target.data('bs.collapse') - var option = data ? 'toggle' : $this.data() - var parent = $this.attr('data-parent') - var $parent = parent && $(parent) - - if (!data || !data.transitioning) { - if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') - $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') - } - - $target.collapse(option) - }) - -}(window.jQuery); - -/* ======================================================================== - * Bootstrap: dropdown.js v3.0.0 - * http://twbs.github.com/bootstrap/javascript.html#dropdowns - * ======================================================================== - * Copyright 2012 Twitter, Inc. - * - * 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 ($) { "use strict"; - - // DROPDOWN CLASS DEFINITION - // ========================= - - var backdrop = '.dropdown-backdrop' - var toggle = '[data-toggle=dropdown]' - var Dropdown = function (element) { - var $el = $(element).on('click.bs.dropdown', this.toggle) - } - - Dropdown.prototype.toggle = function (e) { - var $this = $(this) - - if ($this.is('.disabled, :disabled')) return - - var $parent = getParent($this) - var isActive = $parent.hasClass('open') - - clearMenus() - - if (!isActive) { - if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { - // if mobile we we use a backdrop because click events don't delegate - $('