diff --git a/website/source/api/libraries.html.md b/website/source/api/libraries.html.md
index e52f1cb889..97fe237603 100644
--- a/website/source/api/libraries.html.md
+++ b/website/source/api/libraries.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "HTTP API: Libraries"
-sidebar_current: "docs-http-libraries"
+sidebar_title: "Client Libraries"
+sidebar_current: "api-http-libraries"
description: |-
List of official and community contributed libraries for interacting with the Vault HTTP API.
---
diff --git a/website/source/api/index.html.md b/website/source/api/overview.html.md
similarity index 99%
rename from website/source/api/index.html.md
rename to website/source/api/overview.html.md
index e5843c3845..f2bef9704b 100644
--- a/website/source/api/index.html.md
+++ b/website/source/api/overview.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "HTTP API"
-sidebar_current: "docs-http-overview"
+sidebar_title: "Overview"
+sidebar_current: "api-http-overview"
description: |-
Vault has an HTTP API that can be used to control every aspect of Vault.
---
diff --git a/website/source/api/relatedtools.html.md b/website/source/api/relatedtools.html.md
index 2b8c91f45b..921c965a7a 100644
--- a/website/source/api/relatedtools.html.md
+++ b/website/source/api/relatedtools.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Related Tools"
-sidebar_current: "docs-http-related"
+sidebar_title: "Related Tools"
+sidebar_current: "api-http-related"
description: |-
Short list of third-party tools that work with or are related to Vault.
---
diff --git a/website/source/api/secret/ad/index.html.md b/website/source/api/secret/ad/index.html.md
index f6ebac61de..93307ee13e 100644
--- a/website/source/api/secret/ad/index.html.md
+++ b/website/source/api/secret/ad/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Active Directory - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-active-directory"
+sidebar_title: "Active Directory"
+sidebar_current: "api-http-secret-active-directory"
description: |-
This is the API documentation for the Vault Active Directory secrets engine.
---
diff --git a/website/source/api/secret/alicloud/index.html.md b/website/source/api/secret/alicloud/index.html.md
index 3d886da8a0..0ecbe853d2 100644
--- a/website/source/api/secret/alicloud/index.html.md
+++ b/website/source/api/secret/alicloud/index.html.md
@@ -1,6 +1,7 @@
---
layout: "api"
page_title: "AliCloud - Secrets Engines - HTTP API"
+sidebar_title: "AliCloud"
sidebar_current: "docs-http-secret-alicloud"
description: |-
This is the API documentation for the Vault AliCloud secrets engine.
@@ -211,4 +212,4 @@ $ curl \
"secret_key": "wyLTSmsyPGP1ohvvw8xYgB29dlGI8KMiH2pKCNZ9",
"security_token": "CAESrAIIARKAAShQquMnLIlbvEcIxO6wCoqJufs8sWwieUxu45hS9AvKNEte8KRUWiJWJ6Y+YHAPgNwi7yfRecMFydL2uPOgBI7LDio0RkbYLmJfIxHM2nGBPdml7kYEOXmJp2aDhbvvwVYIyt/8iES/R6N208wQh0Pk2bu+/9dvalp6wOHF4gkFGhhTVFMuTDRhQlNDU0pWTXVLZzVVMXZGRHciBTQzMjc0KgVhbGljZTCpnJjwySk6BlJzYU1ENUJuCgExGmkKBUFsbG93Eh8KDEFjdGlvbkVxdWFscxIGQWN0aW9uGgcKBW9zczoqEj8KDlJlc291cmNlRXF1YWxzEghSZXNvdXJjZRojCiFhY3M6b3NzOio6NDMyNzQ6c2FtcGxlYm94L2FsaWNlLyo="
}
-```
\ No newline at end of file
+```
diff --git a/website/source/api/secret/aws/index.html.md b/website/source/api/secret/aws/index.html.md
index c14aec6fcf..5ce143c257 100644
--- a/website/source/api/secret/aws/index.html.md
+++ b/website/source/api/secret/aws/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "AWS - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-aws"
+sidebar_title: "AWS"
+sidebar_current: "api-http-secret-aws"
description: |-
This is the API documentation for the Vault AWS secrets engine.
---
diff --git a/website/source/api/secret/azure/index.html.md b/website/source/api/secret/azure/index.html.md
index f8e8bb4fa9..f51832ccdf 100644
--- a/website/source/api/secret/azure/index.html.md
+++ b/website/source/api/secret/azure/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Azure - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-azure"
+sidebar_title: "Azure"
+sidebar_current: "api-http-secret-azure"
description: |-
This is the API documentation for the Vault Azure secrets engine.
---
@@ -111,9 +112,10 @@ $ curl \
## Create/Update Role
-Create or update a Vault role. The provided Azure roles must exist
-for this call to succeed. See the Azure secrets [roles docs][roles]
-for more information about roles.
+Create or update a Vault role. Either `application_object_id` or
+`azure_roles` must be provided, and these resources must exist for this
+call to succeed. See the Azure secrets [roles docs][roles] for more
+information about roles.
| Method | Path | Produces |
| :------- | :------------------------| :------------------------ |
@@ -122,9 +124,12 @@ for more information about roles.
### Parameters
-- `azure_roles` (`string: `) - List of Azure roles to be assigned to the generated service
+- `azure_roles` (`string: ""`) - List of Azure roles to be assigned to the generated service
principal. The array must be in JSON format, properly escaped as a string. See [roles docs][roles]
for details on role definition.
+- `application_object_id` (`string: ""`) - Application Object ID for an existing service principal that will
+ be used instead of creating dynamic service principals. If present, `azure_roles` will be ignored. See
+ [roles docs][roles] for details on role definition.
- `ttl` (`string: ""`) – Specifies the default TTL for service principals generated using this role.
Accepts time suffixed strings ("1h") or an integer number of seconds. Defaults to the system/engine default TTL time.
- `max_ttl` (`string: ""`) – Specifies the maximum TTL for service principals generated using this role. Accepts time
diff --git a/website/source/api/secret/cassandra/index.html.md b/website/source/api/secret/cassandra/index.html.md
index 3d094981cb..8753472f8c 100644
--- a/website/source/api/secret/cassandra/index.html.md
+++ b/website/source/api/secret/cassandra/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Cassandra - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-cassandra"
+sidebar_title: "Cassandra DEPRECATED"
+sidebar_current: "api-http-secret-cassandra"
description: |-
This is the API documentation for the Vault Cassandra secrets engine.
---
diff --git a/website/source/api/secret/consul/index.html.md b/website/source/api/secret/consul/index.html.md
index d158063fcb..2817d28898 100644
--- a/website/source/api/secret/consul/index.html.md
+++ b/website/source/api/secret/consul/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Consul - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-consul"
+sidebar_title: "Consul"
+sidebar_current: "api-http-secret-consul"
description: |-
This is the API documentation for the Vault Consul secrets engine.
---
diff --git a/website/source/api/secret/cubbyhole/index.html.md b/website/source/api/secret/cubbyhole/index.html.md
index 34970ee635..80428c2086 100644
--- a/website/source/api/secret/cubbyhole/index.html.md
+++ b/website/source/api/secret/cubbyhole/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Cubbyhole - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-cubbyhole"
+sidebar_title: "Cubbyhole"
+sidebar_current: "api-http-secret-cubbyhole"
description: |-
This is the API documentation for the Vault Cubbyhole secrets engine.
---
diff --git a/website/source/api/secret/databases/cassandra.html.md b/website/source/api/secret/databases/cassandra.html.md
index c5d5e67579..ba691cccc3 100644
--- a/website/source/api/secret/databases/cassandra.html.md
+++ b/website/source/api/secret/databases/cassandra.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Cassandra - Database - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-databases-cassandra"
+sidebar_title: "Cassandra"
+sidebar_current: "api-http-secret-databases-cassandra"
description: |-
The Cassandra plugin for Vault's database secrets engine generates database credentials to access Cassandra servers.
---
diff --git a/website/source/api/secret/databases/hanadb.html.md b/website/source/api/secret/databases/hanadb.html.md
index 28622bab1d..ac93c76627 100644
--- a/website/source/api/secret/databases/hanadb.html.md
+++ b/website/source/api/secret/databases/hanadb.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
-page_title: "HANA - Database - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-databases-hanadb"
+page_title: "HANA - Database - Secrets Engines - HTTP API"
+sidebar_title: "HanaDB"
+sidebar_current: "api-http-secret-databases-hanadb"
description: |-
The HANA plugin for Vault's database secrets engine generates database credentials to access HANA servers.
---
diff --git a/website/source/api/secret/databases/index.html.md b/website/source/api/secret/databases/index.html.md
index 22583d2805..e9cad95607 100644
--- a/website/source/api/secret/databases/index.html.md
+++ b/website/source/api/secret/databases/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Database - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-databases"
+sidebar_title: "Databases"
+sidebar_current: "api-http-secret-databases"
description: |-
Top page for database secrets engine information
---
diff --git a/website/source/api/secret/databases/mongodb.html.md b/website/source/api/secret/databases/mongodb.html.md
index 26dce1a1cd..da631c3a8e 100644
--- a/website/source/api/secret/databases/mongodb.html.md
+++ b/website/source/api/secret/databases/mongodb.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "MongoDB - Database - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-databases-mongodb"
+sidebar_title: "MongoDB"
+sidebar_current: "api-http-secret-databases-mongodb"
description: |-
The MongoDB plugin for Vault's database secrets engine generates database credentials to access MongoDB servers.
---
diff --git a/website/source/api/secret/databases/mssql.html.md b/website/source/api/secret/databases/mssql.html.md
index 2e4e61e261..82c84c1707 100644
--- a/website/source/api/secret/databases/mssql.html.md
+++ b/website/source/api/secret/databases/mssql.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "MSSQL - Database - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-databases-mssql"
+sidebar_title: "MSSQL"
+sidebar_current: "api-http-secret-databases-mssql"
description: |-
The MSSQL plugin for Vault's database secrets engine generates database credentials to access MSSQL servers.
---
diff --git a/website/source/api/secret/databases/mysql-maria.html.md b/website/source/api/secret/databases/mysql-maria.html.md
index 24a9f8056d..a1b0942580 100644
--- a/website/source/api/secret/databases/mysql-maria.html.md
+++ b/website/source/api/secret/databases/mysql-maria.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "MySQL/MariaDB - Database - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-databases-mysql-maria"
+sidebar_title: "MySQL/MariaDB"
+sidebar_current: "api-http-secret-databases-mysql-maria"
description: |-
The MySQL/MariaDB plugin for Vault's database secrets engine generates database credentials to access MySQL and MariaDB servers.
---
diff --git a/website/source/api/secret/databases/oracle.html.md b/website/source/api/secret/databases/oracle.html.md
index 5f72f79e66..473c1118fc 100644
--- a/website/source/api/secret/databases/oracle.html.md
+++ b/website/source/api/secret/databases/oracle.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Oracle - Database - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-databases-oracle-maria"
+sidebar_title: "Oracle"
+sidebar_current: "api-http-secret-databases-oracle-maria"
description: |-
The Oracle plugin for Vault's database secrets engine generates database credentials to access Oracle servers.
---
diff --git a/website/source/api/secret/databases/postgresql.html.md b/website/source/api/secret/databases/postgresql.html.md
index 0efe5e3871..97e4bab10d 100644
--- a/website/source/api/secret/databases/postgresql.html.md
+++ b/website/source/api/secret/databases/postgresql.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "PostgreSQL - Database - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-databases-postgresql"
+sidebar_title: "PostgreSQL"
+sidebar_current: "api-http-secret-databases-postgresql"
description: |-
The PostgreSQL plugin for Vault's database secrets engine generates database credentials to access PostgreSQL servers.
---
diff --git a/website/source/api/secret/gcp/index.html.md b/website/source/api/secret/gcp/index.html.md
index 74e944f6c3..291b762b21 100644
--- a/website/source/api/secret/gcp/index.html.md
+++ b/website/source/api/secret/gcp/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Google Cloud - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-gcp"
+sidebar_title: "Google Cloud"
+sidebar_current: "api-http-secret-gcp"
description: |-
This is the API documentation for the Vault Google Cloud secrets engine.
---
diff --git a/website/source/api/secret/identity/entity-alias.html.md b/website/source/api/secret/identity/entity-alias.html.md
index d47df2384f..4659c3b10a 100644
--- a/website/source/api/secret/identity/entity-alias.html.md
+++ b/website/source/api/secret/identity/entity-alias.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Identity Secret Backend: Entity Alias - HTTP API"
-sidebar_current: "docs-http-secret-identity-entity-alias"
+sidebar_title: "Entity Alias"
+sidebar_current: "api-http-secret-identity-entity-alias"
description: |-
This is the API documentation for managing entity aliases in the identity store.
---
diff --git a/website/source/api/secret/identity/entity.html.md b/website/source/api/secret/identity/entity.html.md
index 0f5b2d3304..86dc4b0c01 100644
--- a/website/source/api/secret/identity/entity.html.md
+++ b/website/source/api/secret/identity/entity.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Identity Secret Backend: Entity - HTTP API"
-sidebar_current: "docs-http-secret-identity-entity"
+sidebar_title: "Entity"
+sidebar_current: "api-http-secret-identity-entity"
description: |-
This is the API documentation for managing entities in the identity store.
---
diff --git a/website/source/api/secret/identity/group-alias.html.md b/website/source/api/secret/identity/group-alias.html.md
index 0b84b69e4d..38f3fea6ac 100644
--- a/website/source/api/secret/identity/group-alias.html.md
+++ b/website/source/api/secret/identity/group-alias.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Identity Secret Backend: Group Alias - HTTP API"
-sidebar_current: "docs-http-secret-identity-group-alias"
+sidebar_title: "Group Alias"
+sidebar_current: "api-http-secret-identity-group-alias"
description: |-
This is the API documentation for managing the group aliases in the identity store.
---
diff --git a/website/source/api/secret/identity/group.html.md b/website/source/api/secret/identity/group.html.md
index f478d5dde1..c9010f577a 100644
--- a/website/source/api/secret/identity/group.html.md
+++ b/website/source/api/secret/identity/group.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Identity Secret Backend: Group - HTTP API"
-sidebar_current: "docs-http-secret-identity-group"
+sidebar_title: "Group"
+sidebar_current: "api-http-secret-identity-group"
description: |-
This is the API documentation for managing groups in the identity store.
---
diff --git a/website/source/api/secret/identity/identity-groups.html.md b/website/source/api/secret/identity/identity-groups.html.md
index 1921aeabc7..d4f9d33868 100644
--- a/website/source/api/secret/identity/identity-groups.html.md
+++ b/website/source/api/secret/identity/identity-groups.html.md
@@ -1,7 +1,7 @@
---
layout: "api"
page_title: "/identity/groups - HTTP API"
-sidebar_current: "docs-http-secret-identity-groups"
+sidebar_current: "api-http-secret-identity-groups"
description: |-
This is the API documentation for the identity groups.
---
diff --git a/website/source/api/secret/identity/index.html.md b/website/source/api/secret/identity/index.html.md
index 7a3527da43..3b806d53db 100644
--- a/website/source/api/secret/identity/index.html.md
+++ b/website/source/api/secret/identity/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Identity - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-identity"
+sidebar_title: "Identity"
+sidebar_current: "api-http-secret-identity"
description: |-
This is the API documentation for the Vault Identity secrets engine.
---
diff --git a/website/source/api/secret/identity/lookup.html.md b/website/source/api/secret/identity/lookup.html.md
index 0b212c4957..2c514c9287 100644
--- a/website/source/api/secret/identity/lookup.html.md
+++ b/website/source/api/secret/identity/lookup.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Identity Secret Backend: Lookup - HTTP API"
-sidebar_current: "docs-http-secret-identity-lookup"
+sidebar_title: "Lookup"
+sidebar_current: "api-http-secret-identity-lookup"
description: |-
This is the API documentation for entity and group lookups from identity
store.
diff --git a/website/source/api/secret/index.html.md b/website/source/api/secret/index.html.md
index 3398185b80..81ed4ae97b 100644
--- a/website/source/api/secret/index.html.md
+++ b/website/source/api/secret/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret"
+sidebar_title: "Secrets Engines"
+sidebar_current: "api-http-secret"
description: |-
Each secrets engine publishes its own set of API paths and methods. These
endpoints are documented in this section.
diff --git a/website/source/api/secret/kv/index.html.md b/website/source/api/secret/kv/index.html.md
index 9ba152aed6..68e2620307 100644
--- a/website/source/api/secret/kv/index.html.md
+++ b/website/source/api/secret/kv/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "KV - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-kv"
+sidebar_title: "Key/Value"
+sidebar_current: "api-http-secret-kv"
description: |-
This is the API documentation for the Vault KV secrets engine.
---
diff --git a/website/source/api/secret/kv/kv-v1.html.md b/website/source/api/secret/kv/kv-v1.html.md
index b84d79c351..034c38eb36 100644
--- a/website/source/api/secret/kv/kv-v1.html.md
+++ b/website/source/api/secret/kv/kv-v1.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "KV - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-kv-v1"
+sidebar_title: "K/V Version 1"
+sidebar_current: "api-http-secret-kv-v1"
description: |-
This is the API documentation for the Vault KV secrets engine.
---
diff --git a/website/source/api/secret/kv/kv-v2.html.md b/website/source/api/secret/kv/kv-v2.html.md
index 1ce6825848..53539f974b 100644
--- a/website/source/api/secret/kv/kv-v2.html.md
+++ b/website/source/api/secret/kv/kv-v2.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "KV - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-kv-v2"
+sidebar_title: "K/V Version 2"
+sidebar_current: "api-http-secret-kv-v2"
description: |-
This is the API documentation for the Vault KV secrets engine.
---
diff --git a/website/source/api/secret/mongodb/index.html.md b/website/source/api/secret/mongodb/index.html.md
index 26fa8c6965..2e91021bb4 100644
--- a/website/source/api/secret/mongodb/index.html.md
+++ b/website/source/api/secret/mongodb/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "MongoDB - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-mongodb"
+sidebar_title: "MongoDB DEPRECATED"
+sidebar_current: "api-http-secret-mongodb"
description: |-
This is the API documentation for the Vault MongoDB secrets engine.
---
diff --git a/website/source/api/secret/mssql/index.html.md b/website/source/api/secret/mssql/index.html.md
index b438e42634..53456a9068 100644
--- a/website/source/api/secret/mssql/index.html.md
+++ b/website/source/api/secret/mssql/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "MSSQL - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-mssql"
+sidebar_title: "MSSQL DEPRECATED"
+sidebar_current: "api-http-secret-mssql"
description: |-
This is the API documentation for the Vault MSSQL secrets engine.
---
diff --git a/website/source/api/secret/mysql/index.html.md b/website/source/api/secret/mysql/index.html.md
index ca2d02e5e9..20b5688de0 100644
--- a/website/source/api/secret/mysql/index.html.md
+++ b/website/source/api/secret/mysql/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "MySQL - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-mysql"
+sidebar_title: "MySQL DEPRECATED"
+sidebar_current: "api-http-secret-mysql"
description: |-
This is the API documentation for the Vault MySQL secrets engine.
---
diff --git a/website/source/api/secret/nomad/index.html.md b/website/source/api/secret/nomad/index.html.md
index d7e84c2b47..8a71ac346e 100644
--- a/website/source/api/secret/nomad/index.html.md
+++ b/website/source/api/secret/nomad/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Nomad Secret Backend - HTTP API"
-sidebar_current: "docs-http-secret-nomad"
+sidebar_title: "Nomad"
+sidebar_current: "api-http-secret-nomad"
description: |-
This is the API documentation for the Vault Nomad secret backend.
---
diff --git a/website/source/api/secret/pki/index.html.md b/website/source/api/secret/pki/index.html.md
index c038c110f4..705c816a7a 100644
--- a/website/source/api/secret/pki/index.html.md
+++ b/website/source/api/secret/pki/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "PKI - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-pki"
+sidebar_title: "PKI"
+sidebar_current: "api-http-secret-pki"
description: |-
This is the API documentation for the Vault PKI secrets engine.
---
diff --git a/website/source/api/secret/postgresql/index.html.md b/website/source/api/secret/postgresql/index.html.md
index 3d51eaad05..cd10a7ed67 100644
--- a/website/source/api/secret/postgresql/index.html.md
+++ b/website/source/api/secret/postgresql/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "PostgreSQL - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-postgresql"
+sidebar_title: "PostgreSQL DEPRECATED"
+sidebar_current: "api-http-secret-postgresql"
description: |-
This is the API documentation for the Vault PostgreSQL secrets engine.
---
diff --git a/website/source/api/secret/rabbitmq/index.html.md b/website/source/api/secret/rabbitmq/index.html.md
index 66f2069eb3..8ef1976e57 100644
--- a/website/source/api/secret/rabbitmq/index.html.md
+++ b/website/source/api/secret/rabbitmq/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "RabbitMQ - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-rabbitmq"
+sidebar_title: "RabbitMQ"
+sidebar_current: "api-http-secret-rabbitmq"
description: |-
This is the API documentation for the Vault RabbitMQ secrets engine.
---
diff --git a/website/source/api/secret/ssh/index.html.md b/website/source/api/secret/ssh/index.html.md
index bdc0b110b8..43ebf026e3 100644
--- a/website/source/api/secret/ssh/index.html.md
+++ b/website/source/api/secret/ssh/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "SSH - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-ssh"
+sidebar_title: "SSH"
+sidebar_current: "api-http-secret-ssh"
description: |-
This is the API documentation for the Vault SSH secrets engine.
---
diff --git a/website/source/api/secret/totp/index.html.md b/website/source/api/secret/totp/index.html.md
index f86265f23d..56d87a2017 100644
--- a/website/source/api/secret/totp/index.html.md
+++ b/website/source/api/secret/totp/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "TOTP - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-totp"
+sidebar_title: "TOTP"
+sidebar_current: "api-http-secret-totp"
description: |-
This is the API documentation for the Vault TOTP secrets engine.
---
diff --git a/website/source/api/secret/transit/index.html.md b/website/source/api/secret/transit/index.html.md
index 537ee546ed..7ead2315ce 100644
--- a/website/source/api/secret/transit/index.html.md
+++ b/website/source/api/secret/transit/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "Transit - Secrets Engines - HTTP API"
-sidebar_current: "docs-http-secret-transit"
+sidebar_title: "Transit"
+sidebar_current: "api-http-secret-transit"
description: |-
This is the API documentation for the Vault Transit secrets engine.
---
diff --git a/website/source/api/system/audit-hash.html.md b/website/source/api/system/audit-hash.html.md
index 81688bf252..58c6a564c0 100644
--- a/website/source/api/system/audit-hash.html.md
+++ b/website/source/api/system/audit-hash.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
-page_title: /sys/audit-hash - HTTP API"
-sidebar_current: "docs-http-system-audit-hash"
+page_title: "/sys/audit-hash - HTTP API"
+sidebar_title: "/sys/audit-hash"
+sidebar_current: "api-http-system-audit-hash"
description: |-
The `/sys/audit-hash` endpoint is used to hash data using an audit device's
hash function and salt.
@@ -25,9 +26,9 @@ any binary data returned from an API call (such as a DER-format certificate) is
base64-encoded by the Vault server in the response. As a result such information
should also be base64-encoded to supply into the `input` parameter.
-| Method | Path | Produces |
-| :------- | :---------------------- | :--------------------- |
-| `POST` | `/sys/audit-hash/:path` | `204 (empty body)` |
+| Method | Path | Produces |
+| :----- | :---------------------- | :----------------- |
+| `POST` | `/sys/audit-hash/:path` | `204 (empty body)` |
### Parameters
diff --git a/website/source/api/system/audit.html.md b/website/source/api/system/audit.html.md
index 15e998e653..b1670d375f 100644
--- a/website/source/api/system/audit.html.md
+++ b/website/source/api/system/audit.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/audit - HTTP API"
-sidebar_current: "docs-http-system-audit/"
+sidebar_title: "/sys/audit"
+sidebar_current: "api-http-system-audit/"
description: |-
The `/sys/audit` endpoint is used to enable and disable audit devices.
---
diff --git a/website/source/api/system/auth.html.md b/website/source/api/system/auth.html.md
index 6647dca986..6bccbe9d29 100644
--- a/website/source/api/system/auth.html.md
+++ b/website/source/api/system/auth.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/auth - HTTP API"
-sidebar_current: "docs-http-system-auth"
+sidebar_title: "/sys/auth"
+sidebar_current: "api-http-system-auth"
description: |-
The `/sys/auth` endpoint is used to manage auth methods in Vault.
---
diff --git a/website/source/api/system/capabilities-accessor.html.md b/website/source/api/system/capabilities-accessor.html.md
index 12a04e0414..f5bc1c7284 100644
--- a/website/source/api/system/capabilities-accessor.html.md
+++ b/website/source/api/system/capabilities-accessor.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/capabilities-accessor - HTTP API"
-sidebar_current: "docs-http-system-capabilities-accessor"
+sidebar_title: "/sys/capabilities-accessor"
+sidebar_current: "api-http-system-capabilities-accessor"
description: |-
The `/sys/capabilities-accessor` endpoint is used to fetch the capabilities of
the token associated with an accessor, on the given paths.
diff --git a/website/source/api/system/capabilities-self.html.md b/website/source/api/system/capabilities-self.html.md
index 4763dd6be6..6c7acf7584 100644
--- a/website/source/api/system/capabilities-self.html.md
+++ b/website/source/api/system/capabilities-self.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/capabilities-self - HTTP API"
-sidebar_current: "docs-http-system-capabilities-self"
+sidebar_title: "/sys/capabilities-self"
+sidebar_current: "api-http-system-capabilities-self"
description: |-
The `/sys/capabilities-self` endpoint is used to fetch the capabilities of
client token on the given paths.
diff --git a/website/source/api/system/capabilities.html.md b/website/source/api/system/capabilities.html.md
index 3d6c202a64..27dc21c53c 100644
--- a/website/source/api/system/capabilities.html.md
+++ b/website/source/api/system/capabilities.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/capabilities - HTTP API"
-sidebar_current: "docs-http-system-capabilities/"
+sidebar_title: "/sys/capabilities"
+sidebar_current: "api-http-system-capabilities/"
description: |-
The `/sys/capabilities` endpoint is used to fetch the capabilities of a token
on the given paths.
diff --git a/website/source/api/system/config-auditing.html.md b/website/source/api/system/config-auditing.html.md
index c288a3e5c1..9813d54407 100644
--- a/website/source/api/system/config-auditing.html.md
+++ b/website/source/api/system/config-auditing.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/config/auditing - HTTP API"
-sidebar_current: "docs-http-system-config-auditing"
+sidebar_title: "/sys/config/auditing"
+sidebar_current: "api-http-system-config-auditing"
description: |-
The `/sys/config/auditing` endpoint is used to configure auditing settings.
---
diff --git a/website/source/api/system/config-control-group.html.md b/website/source/api/system/config-control-group.html.md
index 5f26c2763a..7397dda480 100644
--- a/website/source/api/system/config-control-group.html.md
+++ b/website/source/api/system/config-control-group.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/config/control-group - HTTP API"
-sidebar_current: "docs-http-system-config-control-group"
+sidebar_title: "/sys/config/control-group"
+sidebar_current: "api-http-system-config-control-group"
description: |-
The '/sys/config/control-group' endpoint configures control groups.
---
diff --git a/website/source/api/system/config-cors.html.md b/website/source/api/system/config-cors.html.md
index 34ec5cbb21..2caa89dda4 100644
--- a/website/source/api/system/config-cors.html.md
+++ b/website/source/api/system/config-cors.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/config/cors - HTTP API"
-sidebar_current: "docs-http-system-config-cors"
+sidebar_title: "/sys/config/cors"
+sidebar_current: "api-http-system-config-cors"
description: |-
The '/sys/config/cors' endpoint configures how the Vault server responds to cross-origin requests.
---
diff --git a/website/source/api/system/config-ui.html.md b/website/source/api/system/config-ui.html.md
index 2b079ab772..2acad87a1c 100644
--- a/website/source/api/system/config-ui.html.md
+++ b/website/source/api/system/config-ui.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/config/ui - HTTP API"
-sidebar_current: "docs-http-system-config-ui"
+sidebar_title: "/sys/config/ui"
+sidebar_current: "api-http-system-config-ui"
description: |-
The '/sys/config/ui' endpoint configures the UI.
---
diff --git a/website/source/api/system/control-group.html.md b/website/source/api/system/control-group.html.md
index 8623f23eed..1782df4eee 100644
--- a/website/source/api/system/control-group.html.md
+++ b/website/source/api/system/control-group.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/control-group - HTTP API"
-sidebar_current: "docs-http-system-control-group"
+sidebar_title: "/sys/control-group"
+sidebar_current: "api-http-system-control-group"
description: |-
The '/sys/control-group' endpoint handles the Control Group workflow.
---
diff --git a/website/source/api/system/generate-root.html.md b/website/source/api/system/generate-root.html.md
index eda3efcc4f..4ce18e76d5 100644
--- a/website/source/api/system/generate-root.html.md
+++ b/website/source/api/system/generate-root.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/generate-root - HTTP API"
-sidebar_current: "docs-http-system-generate-root"
+sidebar_title: "/sys/generate-root"
+sidebar_current: "api-http-system-generate-root"
description: |-
The `/sys/generate-root/` endpoints are used to create a new root key for
Vault.
diff --git a/website/source/api/system/health.html.md b/website/source/api/system/health.html.md
index f21095e252..627149e619 100644
--- a/website/source/api/system/health.html.md
+++ b/website/source/api/system/health.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/health - HTTP API"
-sidebar_current: "docs-http-system-health"
+sidebar_title: "/sys/health"
+sidebar_current: "api-http-system-health"
description: |-
The `/sys/health` endpoint is used to check the health status of Vault.
---
diff --git a/website/source/api/system/index.html.md b/website/source/api/system/index.html.md
index e81c8e9b97..9b269378e7 100644
--- a/website/source/api/system/index.html.md
+++ b/website/source/api/system/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "System Backend - HTTP API"
-sidebar_current: "docs-http-system"
+sidebar_title: "System Backend"
+sidebar_current: "api-http-system"
description: |-
The system backend is a default backend in Vault that is mounted at the `/sys`
endpoint. This endpoint cannot be disabled or moved, and is used to configure
diff --git a/website/source/api/system/init.html.md b/website/source/api/system/init.html.md
index b97df17e35..2de11f2acc 100644
--- a/website/source/api/system/init.html.md
+++ b/website/source/api/system/init.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/init - HTTP API"
-sidebar_current: "docs-http-system-init"
+sidebar_title: "/sys/init"
+sidebar_current: "api-http-system-init"
description: |-
The `/sys/init` endpoint is used to initialize a new Vault.
---
diff --git a/website/source/api/system/internal-ui-mounts.html.md b/website/source/api/system/internal-ui-mounts.html.md
index 8960eb57b4..941bd99509 100644
--- a/website/source/api/system/internal-ui-mounts.html.md
+++ b/website/source/api/system/internal-ui-mounts.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/internal/ui/mounts - HTTP API"
-sidebar_current: "docs-http-system-internal-ui-mounts"
+sidebar_title: "/sys/internal/ui/mounts"
+sidebar_current: "api-http-system-internal-ui-mounts"
description: |-
The `/sys/internal/ui/mounts` endpoint is used to manage mount listing visibility.
---
diff --git a/website/source/api/system/key-status.html.md b/website/source/api/system/key-status.html.md
index ac6fea277b..e8b1743919 100644
--- a/website/source/api/system/key-status.html.md
+++ b/website/source/api/system/key-status.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/key-status - HTTP API"
-sidebar_current: "docs-http-system-key-status"
+sidebar_title: "/sys/key-status"
+sidebar_current: "api-http-system-key-status"
description: |-
The `/sys/key-status` endpoint is used to query info about the current
encryption key of Vault.
diff --git a/website/source/api/system/leader.html.md b/website/source/api/system/leader.html.md
index bd4105d205..79d5c13269 100644
--- a/website/source/api/system/leader.html.md
+++ b/website/source/api/system/leader.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/leader - HTTP API"
-sidebar_current: "docs-http-system-leader"
+sidebar_title: "/sys/leader"
+sidebar_current: "api-http-system-leader"
description: |-
The `/sys/leader` endpoint is used to check the high availability status and
current leader of Vault.
diff --git a/website/source/api/system/leases.html.md b/website/source/api/system/leases.html.md
index 2b1ac3e9eb..d6841914b3 100644
--- a/website/source/api/system/leases.html.md
+++ b/website/source/api/system/leases.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/leases - HTTP API"
-sidebar_current: "docs-http-system-leases"
+sidebar_title: "/sys/leases"
+sidebar_current: "api-http-system-leases"
description: |-
The `/sys/leases` endpoints are used to view and manage leases.
---
diff --git a/website/source/api/system/license.html.md b/website/source/api/system/license.html.md
index 933d277973..038efb65d0 100644
--- a/website/source/api/system/license.html.md
+++ b/website/source/api/system/license.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/license - HTTP API"
-sidebar_current: "docs-http-system-license"
+sidebar_title: "/sys/license"
+sidebar_current: "api-http-system-license"
description: |-
The `/sys/license` endpoint is used to view and update the license used in
Vault.
diff --git a/website/source/api/system/mfa.html.md b/website/source/api/system/mfa/index.html.md
similarity index 55%
rename from website/source/api/system/mfa.html.md
rename to website/source/api/system/mfa/index.html.md
index 7a07f6412a..cb18a74cf1 100644
--- a/website/source/api/system/mfa.html.md
+++ b/website/source/api/system/mfa/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/mfa - HTTP API"
-sidebar_current: "docs-http-system-mfa"
+sidebar_title: "/sys/mfa"
+sidebar_current: "api-http-system-mfa"
description: |-
The '/sys/mfa' endpoint focuses on managing MFA behaviors in Vault Enterprise MFA.
---
@@ -12,10 +13,10 @@ description: |-
## Supported MFA types.
-- [TOTP](/api/system/mfa-totp.html)
+* [TOTP](/api/system/mfa-totp.html)
-- [Okta](/api/system/mfa-okta.html)
+* [Okta](/api/system/mfa-okta.html)
-- [Duo](/api/system/mfa-duo.html)
+* [Duo](/api/system/mfa-duo.html)
-- [PingID](/api/system/mfa-pingid.html)
+* [PingID](/api/system/mfa-pingid.html)
diff --git a/website/source/api/system/mfa-duo.html.md b/website/source/api/system/mfa/mfa-duo.html.md
similarity index 97%
rename from website/source/api/system/mfa-duo.html.md
rename to website/source/api/system/mfa/mfa-duo.html.md
index b5f604245a..c97279524f 100644
--- a/website/source/api/system/mfa-duo.html.md
+++ b/website/source/api/system/mfa/mfa-duo.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/mfa/method/duo - HTTP API"
-sidebar_current: "docs-http-system-mfa-duo"
+sidebar_title: "/sys/mfa/method/duo"
+sidebar_current: "api-http-system-mfa-duo"
description: |-
The '/sys/mfa/method/duo' endpoint focuses on managing Duo MFA behaviors in Vault Enterprise.
---
diff --git a/website/source/api/system/mfa-okta.html.md b/website/source/api/system/mfa/mfa-okta.html.md
similarity index 97%
rename from website/source/api/system/mfa-okta.html.md
rename to website/source/api/system/mfa/mfa-okta.html.md
index 4acd822939..4ab178ad13 100644
--- a/website/source/api/system/mfa-okta.html.md
+++ b/website/source/api/system/mfa/mfa-okta.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/mfa/method/okta - HTTP API"
-sidebar_current: "docs-http-system-mfa-okta"
+sidebar_title: "/sys/mfa/method/okta"
+sidebar_current: "api-http-system-mfa-okta"
description: |-
The '/sys/mfa/method/okta' endpoint focuses on managing Okta MFA behaviors in Vault Enterprise.
---
diff --git a/website/source/api/system/mfa-pingid.html.md b/website/source/api/system/mfa/mfa-pingid.html.md
similarity index 97%
rename from website/source/api/system/mfa-pingid.html.md
rename to website/source/api/system/mfa/mfa-pingid.html.md
index 8764982f18..2680f29640 100644
--- a/website/source/api/system/mfa-pingid.html.md
+++ b/website/source/api/system/mfa/mfa-pingid.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/mfa/method/pingid - HTTP API"
-sidebar_current: "docs-http-system-mfa-pingid"
+sidebar_title: "/sys/mfa/method/pingid"
+sidebar_current: "api-http-system-mfa-pingid"
description: |-
The '/sys/mfa/method/pingid' endpoint focuses on managing PingID MFA behaviors in Vault Enterprise.
---
diff --git a/website/source/api/system/mfa-totp.html.md b/website/source/api/system/mfa/mfa-totp.html.md
similarity index 99%
rename from website/source/api/system/mfa-totp.html.md
rename to website/source/api/system/mfa/mfa-totp.html.md
index 1e3bc5ebb8..b86c022679 100644
--- a/website/source/api/system/mfa-totp.html.md
+++ b/website/source/api/system/mfa/mfa-totp.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/mfa/method/totp - HTTP API"
-sidebar_current: "docs-http-system-mfa-totp"
+sidebar_title: "/sys/mfa/method/totp"
+sidebar_current: "api-http-system-mfa-totp"
description: |-
The '/sys/mfa/method/totp' endpoint focuses on managing TOTP MFA behaviors in Vault Enterprise.
---
diff --git a/website/source/api/system/mounts.html.md b/website/source/api/system/mounts.html.md
index d6040aa1a6..c0e7e9695f 100644
--- a/website/source/api/system/mounts.html.md
+++ b/website/source/api/system/mounts.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/mounts - HTTP API"
-sidebar_current: "docs-http-system-mounts"
+sidebar_title: "/sys/mounts"
+sidebar_current: "api-http-system-mounts"
description: |-
The `/sys/mounts` endpoint is used manage secrets engines in Vault.
---
diff --git a/website/source/api/system/namespaces.html.md b/website/source/api/system/namespaces.html.md
index ca2f3e24ad..bc6755e597 100644
--- a/website/source/api/system/namespaces.html.md
+++ b/website/source/api/system/namespaces.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/namespaces - HTTP API"
-sidebar_current: "docs-http-system-namespaces"
+sidebar_title: "/sys/namespaces"
+sidebar_current: "api-http-system-namespaces"
description: |-
The `/sys/namespaces` endpoint is used manage namespaces in Vault.
---
diff --git a/website/source/api/system/plugins-catalog.html.md b/website/source/api/system/plugins-catalog.html.md
index 781a1a2baa..72c8f2015f 100644
--- a/website/source/api/system/plugins-catalog.html.md
+++ b/website/source/api/system/plugins-catalog.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/plugins/catalog - HTTP API"
-sidebar_current: "docs-http-system-plugins-catalog"
+sidebar_title: "/sys/plugins/catalog"
+sidebar_current: "api-http-system-plugins-catalog"
description: |-
The `/sys/plugins/catalog` endpoint is used to manage plugins.
---
diff --git a/website/source/api/system/plugins-reload-backend.html.md b/website/source/api/system/plugins-reload-backend.html.md
index c812879355..12d1771219 100644
--- a/website/source/api/system/plugins-reload-backend.html.md
+++ b/website/source/api/system/plugins-reload-backend.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/plugins/reload/backend - HTTP API"
-sidebar_current: "docs-http-system-plugins-reload-backend"
+sidebar_title: "/sys/plugins/reload/backend"
+sidebar_current: "api-http-system-plugins-reload-backend"
description: |-
The `/sys/plugins/reload/backend` endpoint is used to reload plugin backends.
---
diff --git a/website/source/api/system/policies.html.md b/website/source/api/system/policies.html.md
index d99a7ea75d..33a7fda616 100644
--- a/website/source/api/system/policies.html.md
+++ b/website/source/api/system/policies.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/policies/ - HTTP API"
-sidebar_current: "docs-http-system-policies"
+sidebar_title: "/sys/policies"
+sidebar_current: "api-http-system-policies"
description: |-
The `/sys/policies/` endpoints are used to manage ACL, RGP, and EGP policies in Vault.
---
diff --git a/website/source/api/system/policy.html.md b/website/source/api/system/policy.html.md
index f954930d8c..b98951c8a9 100644
--- a/website/source/api/system/policy.html.md
+++ b/website/source/api/system/policy.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/policy - HTTP API"
-sidebar_current: "docs-http-system-policy"
+sidebar_title: "/sys/policy"
+sidebar_current: "api-http-system-policy"
description: |-
The `/sys/policy` endpoint is used to manage ACL policies in Vault.
---
diff --git a/website/source/api/system/raw.html.md b/website/source/api/system/raw.html.md
index 6d55c15e08..c0499195cd 100644
--- a/website/source/api/system/raw.html.md
+++ b/website/source/api/system/raw.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/raw - HTTP API"
-sidebar_current: "docs-http-system-raw"
+sidebar_title: "/sys/raw"
+sidebar_current: "api-http-system-raw"
description: |-
The `/sys/raw` endpoint is used to access the raw underlying store in Vault.
---
diff --git a/website/source/api/system/rekey-recovery-key.html.md b/website/source/api/system/rekey-recovery-key.html.md
index edcbf329fa..56fabb7bf2 100644
--- a/website/source/api/system/rekey-recovery-key.html.md
+++ b/website/source/api/system/rekey-recovery-key.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/rekey-recovery-key - HTTP API"
-sidebar_current: "docs-http-system-rekey-recovery-key"
+sidebar_title: "/sys/rekey-recovery-key"
+sidebar_current: "api-http-system-rekey-recovery-key"
description: |-
The `/sys/rekey-recovery-key` endpoints are used to rekey the recovery keys for Vault.
---
diff --git a/website/source/api/system/rekey.html.md b/website/source/api/system/rekey.html.md
index 6e76fb8728..b983ab8aa2 100644
--- a/website/source/api/system/rekey.html.md
+++ b/website/source/api/system/rekey.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/rekey - HTTP API"
-sidebar_current: "docs-http-system-rekey"
+sidebar_title: "/sys/rekey"
+sidebar_current: "api-http-system-rekey"
description: |-
The `/sys/rekey` endpoints are used to rekey the unseal keys for Vault.
---
diff --git a/website/source/api/system/remount.html.md b/website/source/api/system/remount.html.md
index 1f17c2cbbc..94baa53993 100644
--- a/website/source/api/system/remount.html.md
+++ b/website/source/api/system/remount.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/remount - HTTP API"
-sidebar_current: "docs-http-system-remount"
+sidebar_title: "/sys/remount"
+sidebar_current: "api-http-system-remount"
description: |-
The '/sys/remount' endpoint is used remount a mounted backend to a new endpoint.
---
diff --git a/website/source/api/system/replication.html.md b/website/source/api/system/replication/index.html.md
similarity index 97%
rename from website/source/api/system/replication.html.md
rename to website/source/api/system/replication/index.html.md
index 940723283c..11442dbdf8 100644
--- a/website/source/api/system/replication.html.md
+++ b/website/source/api/system/replication/index.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/replication - HTTP API"
-sidebar_current: "docs-http-system-replication"
+sidebar_title: "/sys/replication"
+sidebar_current: "api-http-system-replication"
description: |-
The '/sys/replication' endpoint focuses on managing general operations in Vault Enterprise replication
---
diff --git a/website/source/api/system/replication-dr.html.md b/website/source/api/system/replication/replication-dr.html.md
similarity index 99%
rename from website/source/api/system/replication-dr.html.md
rename to website/source/api/system/replication/replication-dr.html.md
index 4535f37062..1fd585d233 100644
--- a/website/source/api/system/replication-dr.html.md
+++ b/website/source/api/system/replication/replication-dr.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/replication - HTTP API"
-sidebar_current: "docs-http-system-replication-dr"
+sidebar_title: "/sys/replication/dr"
+sidebar_current: "api-http-system-replication-dr"
description: |-
The '/sys/replication/dr' endpoint focuses on managing general operations in Vault Enterprise Disaster Recovery replication
---
diff --git a/website/source/api/system/replication-performance.html.md b/website/source/api/system/replication/replication-performance.html.md
similarity index 99%
rename from website/source/api/system/replication-performance.html.md
rename to website/source/api/system/replication/replication-performance.html.md
index 245ee6ab65..45ad54de4a 100644
--- a/website/source/api/system/replication-performance.html.md
+++ b/website/source/api/system/replication/replication-performance.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/replication - HTTP API"
-sidebar_current: "docs-http-system-replication-performance"
+sidebar_title: "/sys/replication/performance"
+sidebar_current: "api-http-system-replication-performance"
description: |-
The '/sys/replication/performance' endpoint focuses on managing general operations in Vault Enterprise Performance Replication
---
diff --git a/website/source/api/system/rotate.html.md b/website/source/api/system/rotate.html.md
index a3001e3497..f8ac764f13 100644
--- a/website/source/api/system/rotate.html.md
+++ b/website/source/api/system/rotate.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/rotate - HTTP API"
-sidebar_current: "docs-http-system-rotate"
+sidebar_title: "/sys/rotate"
+sidebar_current: "api-http-system-rotate"
description: |-
The `/sys/rotate` endpoint is used to rotate the encryption key.
---
diff --git a/website/source/api/system/seal-status.html.md b/website/source/api/system/seal-status.html.md
index 1f0f533018..d548648f68 100644
--- a/website/source/api/system/seal-status.html.md
+++ b/website/source/api/system/seal-status.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/seal-status - HTTP API"
-sidebar_current: "docs-http-system-seal-status"
+sidebar_title: "/sys/seal-status"
+sidebar_current: "api-http-system-seal-status"
description: |-
The `/sys/seal-status` endpoint is used to check the seal status of a Vault.
---
diff --git a/website/source/api/system/seal.html.md b/website/source/api/system/seal.html.md
index 96cc89892f..b33c84b4a8 100644
--- a/website/source/api/system/seal.html.md
+++ b/website/source/api/system/seal.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/seal - HTTP API"
-sidebar_current: "docs-http-system-seal/"
+sidebar_title: "/sys/seal"
+sidebar_current: "api-http-system-seal/"
description: |-
The `/sys/seal` endpoint seals the Vault.
---
diff --git a/website/source/api/system/step-down.html.md b/website/source/api/system/step-down.html.md
index fbb65f2f01..961b1f91bb 100644
--- a/website/source/api/system/step-down.html.md
+++ b/website/source/api/system/step-down.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/step-down - HTTP API"
-sidebar_current: "docs-http-system-step-down"
+sidebar_title: "/sys/step-down"
+sidebar_current: "api-http-system-step-down"
description: |-
The `/sys/step-down` endpoint causes the node to give up active status.
---
diff --git a/website/source/api/system/tools.html.md b/website/source/api/system/tools.html.md
index d3db1606c4..4a26313a6c 100644
--- a/website/source/api/system/tools.html.md
+++ b/website/source/api/system/tools.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/tools - HTTP API"
-sidebar_current: "docs-http-system-tools"
+sidebar_title: "/sys/tools"
+sidebar_current: "api-http-system-tools"
description: |-
This is the API documentation for a general set of crypto tools.
---
diff --git a/website/source/api/system/unseal.html.md b/website/source/api/system/unseal.html.md
index e94052c07f..9655d49d1e 100644
--- a/website/source/api/system/unseal.html.md
+++ b/website/source/api/system/unseal.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/unseal - HTTP API"
-sidebar_current: "docs-http-system-unseal"
+sidebar_title: "/sys/unseal"
+sidebar_current: "api-http-system-unseal"
description: |-
The `/sys/unseal` endpoint is used to unseal the Vault.
---
diff --git a/website/source/api/system/wrapping-lookup.html.md b/website/source/api/system/wrapping-lookup.html.md
index d888f7ed88..2959edd683 100644
--- a/website/source/api/system/wrapping-lookup.html.md
+++ b/website/source/api/system/wrapping-lookup.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/wrapping/lookup - HTTP API"
-sidebar_current: "docs-http-system-wrapping-lookup"
+sidebar_title: "/sys/wrapping/lookup"
+sidebar_current: "api-http-system-wrapping-lookup"
description: |-
The `/sys/wrapping/lookup` endpoint returns wrapping token properties.
---
diff --git a/website/source/api/system/wrapping-rewrap.html.md b/website/source/api/system/wrapping-rewrap.html.md
index f95b2af569..7a3955ac1d 100644
--- a/website/source/api/system/wrapping-rewrap.html.md
+++ b/website/source/api/system/wrapping-rewrap.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/wrapping/rewrap - HTTP API"
-sidebar_current: "docs-http-system-wrapping-rewrap"
+sidebar_title: "/sys/wrapping/rewrap"
+sidebar_current: "api-http-system-wrapping-rewrap"
description: |-
The `/sys/wrapping/rewrap` endpoint can be used to rotate a wrapping token and refresh its TTL.
---
diff --git a/website/source/api/system/wrapping-unwrap.html.md b/website/source/api/system/wrapping-unwrap.html.md
index ea99188377..5024cc8e02 100644
--- a/website/source/api/system/wrapping-unwrap.html.md
+++ b/website/source/api/system/wrapping-unwrap.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/wrapping/unwrap - HTTP API"
-sidebar_current: "docs-http-system-wrapping-unwrap"
+sidebar_title: "/sys/wrapping/unwrap"
+sidebar_current: "api-http-system-wrapping-unwrap"
description: |-
The `/sys/wrapping/unwrap` endpoint unwraps a wrapped response.
---
diff --git a/website/source/api/system/wrapping-wrap.html.md b/website/source/api/system/wrapping-wrap.html.md
index 1d28256714..ea608dbd00 100644
--- a/website/source/api/system/wrapping-wrap.html.md
+++ b/website/source/api/system/wrapping-wrap.html.md
@@ -1,7 +1,8 @@
---
layout: "api"
page_title: "/sys/wrapping/wrap - HTTP API"
-sidebar_current: "docs-http-system-wrapping-wrap"
+sidebar_title: "/sys/wrapping/wrap"
+sidebar_current: "api-http-system-wrapping-wrap"
description: |-
The `/sys/wrapping/wrap` endpoint wraps the given values in a
response-wrapped token.
diff --git a/website/source/assets/files/press-kit.zip b/website/source/assets/files/press-kit.zip
deleted file mode 100644
index f38b1e76cd..0000000000
Binary files a/website/source/assets/files/press-kit.zip and /dev/null differ
diff --git a/website/source/assets/javascripts/analytics.js b/website/source/assets/javascripts/analytics.js
deleted file mode 100644
index 993d3d41ec..0000000000
--- a/website/source/assets/javascripts/analytics.js
+++ /dev/null
@@ -1,16 +0,0 @@
-document.addEventListener('turbolinks:load', function() {
- analytics.page()
-
- track('.downloads .download .details li a', function(el) {
- var m = el.href.match(/vault_(.*?)_(.*?)_(.*?)\.zip/)
- return {
- event: 'Download',
- category: 'Button',
- label: 'Vault | v' + m[1] + ' | ' + m[2] + ' | ' + m[3],
- version: m[1],
- os: m[2],
- architecture: m[3],
- product: 'vault'
- }
- })
-})
diff --git a/website/source/assets/javascripts/application.js b/website/source/assets/javascripts/application.js
deleted file mode 100644
index 51c8914f8f..0000000000
--- a/website/source/assets/javascripts/application.js
+++ /dev/null
@@ -1,8 +0,0 @@
-//= require turbolinks
-//= require jquery
-
-//= require hashicorp/mega-nav
-//= require hashicorp/sidebar
-//= require hashicorp/analytics
-
-//= require analytics
diff --git a/website/source/assets/javascripts/demo-app.js b/website/source/assets/javascripts/demo-app.js
deleted file mode 100644
index 7d402f5641..0000000000
--- a/website/source/assets/javascripts/demo-app.js
+++ /dev/null
@@ -1,5 +0,0 @@
-//= require lib/ember-template-compiler
-//= require lib/ember-1-10
-//= require lib/ember-data-1-0
-//= require demo
-//= require_tree ./demo
diff --git a/website/source/assets/javascripts/demo.js b/website/source/assets/javascripts/demo.js
deleted file mode 100644
index 24d4bfd144..0000000000
--- a/website/source/assets/javascripts/demo.js
+++ /dev/null
@@ -1,9 +0,0 @@
-window.Demo = Ember.Application.create({
- rootElement: '#demo-app',
-});
-
-Demo.deferReadiness();
-
-if (document.getElementById('demo-app')) {
- Demo.advanceReadiness();
-}
diff --git a/website/source/assets/javascripts/demo/controllers/application.js b/website/source/assets/javascripts/demo/controllers/application.js
deleted file mode 100644
index 67c6560eb8..0000000000
--- a/website/source/assets/javascripts/demo/controllers/application.js
+++ /dev/null
@@ -1,2 +0,0 @@
-Demo.ApplicationController = Ember.ObjectController.extend({
-});
diff --git a/website/source/assets/javascripts/demo/controllers/demo.js b/website/source/assets/javascripts/demo/controllers/demo.js
deleted file mode 100644
index 15a8c6101c..0000000000
--- a/website/source/assets/javascripts/demo/controllers/demo.js
+++ /dev/null
@@ -1,58 +0,0 @@
-Demo.DemoController = Ember.ObjectController.extend({
- isLoading: false,
- logs: "",
-
- init: function() {
- this._super.apply(this, arguments);
-
- // connect to the websocket once we enter the application route
- // var socket = window.io.connect('http://localhost:8080');
- var socket = new WebSocket("wss://vault-demo-server.herokuapp.com/socket");
-
- // Set socket on application controller
- this.set('socket', socket);
-
- socket.onmessage = function(message) {
- var data = JSON.parse(message.data),
- controller = this;
-
- // ignore pongs
- if (data.pong) {
- return
- }
-
- // Add the item
- if (data.stdout !== "") {
- controller.appendLog(data.stdout, false);
- }
-
- if (data.stderr !== "") {
- controller.appendLog(data.stderr, false);
- }
-
- controller.set('isLoading', false);
- }.bind(this);
- },
-
- appendLog: function(data, prefix) {
- var newline;
-
- if (prefix) {
- data = '$ ' + data;
- } else {
- newline = '';
- }
-
- newline = '\n';
-
- this.set('logs', this.get('logs')+data+newline);
-
- Ember.run.later(function() {
- var element = $('.demo-terminal');
- // Scroll to the bottom of the element
- element.scrollTop(element[0].scrollHeight);
-
- element.find('input.shell')[0].focus();
- }, 5);
- },
-});
diff --git a/website/source/assets/javascripts/demo/controllers/step.js b/website/source/assets/javascripts/demo/controllers/step.js
deleted file mode 100644
index 7329f9a28c..0000000000
--- a/website/source/assets/javascripts/demo/controllers/step.js
+++ /dev/null
@@ -1,98 +0,0 @@
-Demo.DemoStepController = Ember.ObjectController.extend({
- needs: ['demo'],
- socket: Ember.computed.alias('controllers.demo.socket'),
- logs: Ember.computed.alias('controllers.demo.logs'),
- isLoading: Ember.computed.alias('controllers.demo.isLoading'),
-
- currentText: "",
- commandLog: [],
- cursor: 0,
- notCleared: true,
- fullscreen: false,
-
- renderedLogs: function() {
- return this.get('logs');
- }.property('logs.length'),
-
- setFromHistory: function() {
- var index = this.get('commandLog.length') + this.get('cursor');
- var previousMessage = this.get('commandLog')[index];
-
- this.set('currentText', previousMessage);
- }.observes('cursor'),
-
- logCommand: function(command) {
- var commandLog = this.get('commandLog');
-
- commandLog.push(command);
-
- this.set('commandLog', commandLog);
- },
-
- actions: {
- submitText: function() {
- // Send the actual request (fake for now)
- this.sendCommand();
- },
-
- close: function() {
- this.transitionTo('index');
- },
-
- next: function() {
- var nextStepNumber = parseInt(this.get('model.id'), 10) + 1;
- this.transitionTo('demo.step', nextStepNumber);
- },
-
- previous: function() {
- var prevStepNumber = parseInt(this.get('model.id'), 10) - 1;
- this.transitionTo('demo.step', prevStepNumber);
- },
- },
-
- sendCommand: function() {
- var command = this.getWithDefault('currentText', '');
- var log = this.get('log');
-
- this.set('currentText', '');
- this.logCommand(command);
- this.get('controllers.demo').appendLog(command, true);
-
- switch(command) {
- case "":
- break;
- case "next":
- case "forward":
- this.set('notCleared', true);
- this.send('next');
- break;
- case "previous":
- case "back":
- case "prev":
- this.set('notCleared', true);
- this.send('previous');
- break;
- case "quit":
- case "exit":
- this.send('close');
- break;
- case "clear":
- this.set('logs', "");
- this.set('notCleared', false);
- break;
- case "fu":
- case "fullscreen":
- this.set('fullscreen', true);
- break;
- case "help":
- this.get('controllers.demo').appendLog('You can use `vault path-help ` ' +
- 'to learn more about specific Vault commands, or `next` ' +
- 'and `previous` to navigate. Or, `fu` to go fullscreen.', false);
- break;
- default:
- this.set('isLoading', true);
- var data = JSON.stringify({type: "cli", data: {command: command}});
- this.get('socket').send(data);
- }
- },
-});
diff --git a/website/source/assets/javascripts/demo/initializer/load-steps.js b/website/source/assets/javascripts/demo/initializer/load-steps.js
deleted file mode 100644
index 4c0c7d47ee..0000000000
--- a/website/source/assets/javascripts/demo/initializer/load-steps.js
+++ /dev/null
@@ -1,32 +0,0 @@
-Ember.Application.initializer({
- name: 'load-steps',
- after: 'store',
-
- initialize: function(container, application) {
- var store = container.lookup('store:main');
- var steps = {
- "steps": [
- { id: 0, name: 'welcome', humanName: "Welcome to the Vault Interactive Tutorial!"},
- { id: 1, name: 'steps', humanName: "Step 1: Overview"},
- { id: 2, name: 'init', humanName: "Step 2: Initialize your Vault"},
- { id: 3, name: 'unseal', humanName: "Step 3: Unsealing your Vault"},
- { id: 4, name: 'auth', humanName: "Step 4: Authorize your requests"},
- { id: 5, name: 'list', humanName: "Step 5: List available secret engines"},
- { id: 6, name: 'secrets', humanName: "Step 6: Read and write secrets"},
- { id: 7, name: 'update', humanName: "Step 7: Update the secret data"},
- { id: 8, name: 'patch', humanName: "Step 8: Update the data without overwriting"},
- { id: 9, name: 'versions', humanName: "Step 9: Work with different data versions"},
- { id: 10, name: 'delete', humanName: "Step 10: Delete the data"},
- { id: 11, name: 'recover', humanName: "Step 11: Recover the deleted data"},
- { id: 12, name: 'destroy', humanName: "Step 12: Permanently delete data"},
- { id: 13, name: 'help', humanName: "Step 13: Get Help"},
- { id: 14, name: 'seal', humanName: "Step 14: Seal your Vault"},
- { id: 15, name: 'finish', humanName: "You're finished!"},
- ]
- };
-
- application.register('model:step', Demo.Step);
-
- store.pushPayload('step', steps);
- },
-});
diff --git a/website/source/assets/javascripts/demo/model/clock.js b/website/source/assets/javascripts/demo/model/clock.js
deleted file mode 100644
index 235af53f68..0000000000
--- a/website/source/assets/javascripts/demo/model/clock.js
+++ /dev/null
@@ -1,63 +0,0 @@
-Ember.Clock = Ember.Object.extend({
- second: null,
- checks: 0,
- isPolling: false,
- pollImmediately: true,
- pollInterval: null,
- tickInterval: null,
- defaultPollInterval: 10000,
- defaultTickInterval: 1000,
-
- init: function () {
- this.scheduleTick();
- this.pollImmediately && this.startPolling();
- },
-
- computedPollInterval: function() {
- return this.pollInterval || this.defaultPollInterval; // Time between polls (in ms)
- }.property().readOnly(),
-
- computedTickInterval: function() {
- return this.tickInterval || this.defaultTickInterval; // Time between ticks (in ms)
- }.property().readOnly(),
-
- // Schedules the function `f` to be executed every `interval` time.
- schedulePoll: function(f) {
- return Ember.run.later(this, function() {
- f.apply(this);
- this.incrementProperty('checks')
- this.set('timer', this.schedulePoll(f));
- }, this.get('computedPollInterval'));
- },
-
- scheduleTick: function () {
- return Ember.run.later(this, function () {
- this.tick();
- this.scheduleTick();
- }, this.get('computedTickInterval'));
- },
-
- // Stops the polling
- stopPolling: function() {
- this.set('isPolling', false);
- Ember.run.cancel(this.get('timer'));
- },
-
- // Starts the polling, i.e. executes the `onPoll` function every interval.
- startPolling: function() {
- this.set('isPolling', true);
- this.set('timer', this.schedulePoll(this.get('onPoll')));
- },
-
- // Moves the clock
- tick: function () {
- var now = new Date();
- this.setProperties({
- second: now.getSeconds()
- });
- },
-
- // Override this while making a new Clock object.
- onPoll: function(){
- },
-});
diff --git a/website/source/assets/javascripts/demo/model/step.js b/website/source/assets/javascripts/demo/model/step.js
deleted file mode 100644
index 2d17ef0095..0000000000
--- a/website/source/assets/javascripts/demo/model/step.js
+++ /dev/null
@@ -1,6 +0,0 @@
-Demo.Step = DS.Model.extend({
- name: DS.attr('string'),
- humanName: DS.attr('string'),
-
- instructionTemplate: Ember.computed.alias('name')
-});
diff --git a/website/source/assets/javascripts/demo/router.js b/website/source/assets/javascripts/demo/router.js
deleted file mode 100644
index 191b380ade..0000000000
--- a/website/source/assets/javascripts/demo/router.js
+++ /dev/null
@@ -1,5 +0,0 @@
-Demo.Router.map(function() {
- this.route('demo', function() {
- this.route('step', { path: '/:id' });
- });
-});
diff --git a/website/source/assets/javascripts/demo/routes/step.js b/website/source/assets/javascripts/demo/routes/step.js
deleted file mode 100644
index add170d352..0000000000
--- a/website/source/assets/javascripts/demo/routes/step.js
+++ /dev/null
@@ -1,29 +0,0 @@
-Demo.DemoStepRoute = Ember.Route.extend({
- model: function(params) {
- return this.store.find('step', params.id);
- },
-
- afterModel: function(model) {
- var clock = Ember.Clock.create({
- defaultPollInterval: 5000,
- pollImmediately: false,
- onPoll: function() {
- var socket = this.controllerFor('demo').get('socket');
- socket.send(JSON.stringify({type: "ping"}));
- }.bind(this)
- });
-
- this.set('clock', clock);
- },
-
- activate: function() {
- this.get('clock').startPolling();
- },
-
- deactivate: function() {
- var clock = this.get('clock');
- if(clock.get('isPolling')) {
- clock.stopPolling();
- }
- },
-});
diff --git a/website/source/assets/javascripts/demo/views/demo.js b/website/source/assets/javascripts/demo/views/demo.js
deleted file mode 100644
index 6d25a6d59a..0000000000
--- a/website/source/assets/javascripts/demo/views/demo.js
+++ /dev/null
@@ -1,56 +0,0 @@
-Demo.DemoView = Ember.View.extend({
- classNames: ['demo-overlay'],
-
- mouseUp: function(ev) {
- var selection = window.getSelection().toString();
-
- if (selection.length > 0) {
- // Ignore clicks when they are trying to select something
- return;
- }
-
- var element = this.$();
-
- // Record scroll position
- var x = element.scrollX, y = element.scrollY;
- // Focus
- element.find('input.shell')[0].focus();
- // Scroll back to where you were
- element.scrollTop(x, y);
- },
-
- didInsertElement: function() {
- var controller = this.get('controller'),
- overlay = $('.sidebar-overlay'),
- element = this.$();
-
- $('body').addClass('demo-active');
-
- overlay.addClass('active');
-
- overlay.on('click', function() {
- controller.transitionTo('index');
- });
-
- // Scroll to the bottom of the element
- element.scrollTop(element[0].scrollHeight);
-
- // Focus
- element.find('input.shell')[0].focus();
- },
-
- willDestroyElement: function() {
- // Remove overlay
- $('.sidebar-overlay').removeClass('active');
-
- var element = this.$();
-
- element.fadeOut(400);
-
- $('body').removeClass('demo-active');
-
- // reset scroll to top after closing demo
- window.scrollTo(0, 0);
- },
-
-});
diff --git a/website/source/assets/javascripts/demo/views/step.js b/website/source/assets/javascripts/demo/views/step.js
deleted file mode 100644
index cdd5fcab36..0000000000
--- a/website/source/assets/javascripts/demo/views/step.js
+++ /dev/null
@@ -1,67 +0,0 @@
-Demo.DemoStepView = Ember.View.extend({
- keyDown: function(ev) {
- var cursor = this.get('controller.cursor'),
- currentLength = this.get('controller.commandLog.length');
-
- switch(ev.keyCode) {
- // Down arrow
- case 40:
- if (cursor === 0) {
- return;
- }
-
- this.incrementProperty('controller.cursor');
- break;
-
- // Up arrow
- case 38:
- if ((currentLength + cursor) === 0) {
- return;
- }
-
- this.decrementProperty('controller.cursor');
- break;
-
- // command + k
- case 75:
- if (ev.metaKey) {
- this.set('controller.logs', '');
- this.set('controller.notCleared', false);
- }
- break;
-
- // escape
- case 27:
- this.get('controller').transitionTo('index');
- break;
- }
- },
-
- deFocus: function() {
- var element = this.$().find('input.shell');
-
- // defocus while loading
- if (this.get('controller.isLoading')) {
- element.blur();
- }
-
- }.observes('controller.isLoading'),
-
- focus: function() {
- var element = this.$().find('input.shell');
- element.focus();
- }.observes('controller.cursor'),
-
- submitted: function() {
- var element = this.$();
-
- // Focus the input
- element.find('input.shell')[0].focus();
-
- // guarantees that the log is scrolled when updated
- Ember.run.scheduleOnce('afterRender', this, function() {
- window.scrollTo(0, document.body.scrollHeight);
- });
-
- }.observes('controller.logs.length')
-});
diff --git a/website/source/assets/javascripts/lib/ember-1-10.js b/website/source/assets/javascripts/lib/ember-1-10.js
deleted file mode 100644
index e171eb63c1..0000000000
--- a/website/source/assets/javascripts/lib/ember-1-10.js
+++ /dev/null
@@ -1,52909 +0,0 @@
-/*!
- * @overview Ember - JavaScript Application Framework
- * @copyright Copyright 2011-2014 Tilde Inc. and contributors
- * Portions Copyright 2006-2011 Strobe Inc.
- * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
- * @license Licensed under MIT license
- * See https://raw.github.com/emberjs/ember.js/master/LICENSE
- * @version 1.10.1
- */
-
-(function() {
-var enifed, requireModule, eriuqer, requirejs, Ember;
-
-(function() {
- Ember = this.Ember = this.Ember || {};
- if (typeof Ember === 'undefined') { Ember = {}; };
- function UNDEFINED() { }
-
- if (typeof Ember.__loader === 'undefined') {
- var registry = {}, seen = {};
-
- enifed = function(name, deps, callback) {
- registry[name] = { deps: deps, callback: callback };
- };
-
- requirejs = eriuqer = requireModule = function(name) {
- var s = seen[name];
-
- if (s !== undefined) { return seen[name]; }
- if (s === UNDEFINED) { return undefined; }
-
- seen[name] = {};
-
- if (!registry[name]) {
- throw new Error('Could not find module ' + name);
- }
-
- var mod = registry[name];
- var deps = mod.deps;
- var callback = mod.callback;
- var reified = [];
- var exports;
- var length = deps.length;
-
- for (var i=0; i 3) {
- args = new Array(length - 3);
- for (var i = 3; i < length; i++) {
- args[i-3] = arguments[i];
- }
- } else {
- args = undefined;
- }
-
- if (!this.currentInstance) { createAutorun(this); }
- return this.currentInstance.schedule(queueName, target, method, args, false, stack);
- },
-
- deferOnce: function(queueName, target, method /* , args */) {
- if (!method) {
- method = target;
- target = null;
- }
-
- if (isString(method)) {
- method = target[method];
- }
-
- var stack = this.DEBUG ? new Error() : undefined;
- var length = arguments.length;
- var args;
-
- if (length > 3) {
- args = new Array(length - 3);
- for (var i = 3; i < length; i++) {
- args[i-3] = arguments[i];
- }
- } else {
- args = undefined;
- }
-
- if (!this.currentInstance) {
- createAutorun(this);
- }
- return this.currentInstance.schedule(queueName, target, method, args, true, stack);
- },
-
- setTimeout: function() {
- var l = arguments.length;
- var args = new Array(l);
-
- for (var x = 0; x < l; x++) {
- args[x] = arguments[x];
- }
-
- var length = args.length,
- method, wait, target,
- methodOrTarget, methodOrWait, methodOrArgs;
-
- if (length === 0) {
- return;
- } else if (length === 1) {
- method = args.shift();
- wait = 0;
- } else if (length === 2) {
- methodOrTarget = args[0];
- methodOrWait = args[1];
-
- if (isFunction(methodOrWait) || isFunction(methodOrTarget[methodOrWait])) {
- target = args.shift();
- method = args.shift();
- wait = 0;
- } else if (isCoercableNumber(methodOrWait)) {
- method = args.shift();
- wait = args.shift();
- } else {
- method = args.shift();
- wait = 0;
- }
- } else {
- var last = args[args.length - 1];
-
- if (isCoercableNumber(last)) {
- wait = args.pop();
- } else {
- wait = 0;
- }
-
- methodOrTarget = args[0];
- methodOrArgs = args[1];
-
- if (isFunction(methodOrArgs) || (isString(methodOrArgs) &&
- methodOrTarget !== null &&
- methodOrArgs in methodOrTarget)) {
- target = args.shift();
- method = args.shift();
- } else {
- method = args.shift();
- }
- }
-
- var executeAt = now() + parseInt(wait, 10);
-
- if (isString(method)) {
- method = target[method];
- }
-
- var onError = getOnError(this.options);
-
- function fn() {
- if (onError) {
- try {
- method.apply(target, args);
- } catch (e) {
- onError(e);
- }
- } else {
- method.apply(target, args);
- }
- }
-
- // find position to insert
- var i = searchTimer(executeAt, this._timers);
-
- this._timers.splice(i, 0, executeAt, fn);
-
- updateLaterTimer(this, executeAt, wait);
-
- return fn;
- },
-
- throttle: function(target, method /* , args, wait, [immediate] */) {
- var backburner = this;
- var args = arguments;
- var immediate = pop.call(args);
- var wait, throttler, index, timer;
-
- if (isNumber(immediate) || isString(immediate)) {
- wait = immediate;
- immediate = true;
- } else {
- wait = pop.call(args);
- }
-
- wait = parseInt(wait, 10);
-
- index = findThrottler(target, method, this._throttlers);
- if (index > -1) { return this._throttlers[index]; } // throttled
-
- timer = global.setTimeout(function() {
- if (!immediate) {
- backburner.run.apply(backburner, args);
- }
- var index = findThrottler(target, method, backburner._throttlers);
- if (index > -1) {
- backburner._throttlers.splice(index, 1);
- }
- }, wait);
-
- if (immediate) {
- this.run.apply(this, args);
- }
-
- throttler = [target, method, timer];
-
- this._throttlers.push(throttler);
-
- return throttler;
- },
-
- debounce: function(target, method /* , args, wait, [immediate] */) {
- var backburner = this;
- var args = arguments;
- var immediate = pop.call(args);
- var wait, index, debouncee, timer;
-
- if (isNumber(immediate) || isString(immediate)) {
- wait = immediate;
- immediate = false;
- } else {
- wait = pop.call(args);
- }
-
- wait = parseInt(wait, 10);
- // Remove debouncee
- index = findDebouncee(target, method, this._debouncees);
-
- if (index > -1) {
- debouncee = this._debouncees[index];
- this._debouncees.splice(index, 1);
- clearTimeout(debouncee[2]);
- }
-
- timer = global.setTimeout(function() {
- if (!immediate) {
- backburner.run.apply(backburner, args);
- }
- var index = findDebouncee(target, method, backburner._debouncees);
- if (index > -1) {
- backburner._debouncees.splice(index, 1);
- }
- }, wait);
-
- if (immediate && index === -1) {
- backburner.run.apply(backburner, args);
- }
-
- debouncee = [
- target,
- method,
- timer
- ];
-
- backburner._debouncees.push(debouncee);
-
- return debouncee;
- },
-
- cancelTimers: function() {
- var clearItems = function(item) {
- clearTimeout(item[2]);
- };
-
- each(this._throttlers, clearItems);
- this._throttlers = [];
-
- each(this._debouncees, clearItems);
- this._debouncees = [];
-
- if (this._laterTimer) {
- clearTimeout(this._laterTimer);
- this._laterTimer = null;
- }
- this._timers = [];
-
- if (this._autorun) {
- clearTimeout(this._autorun);
- this._autorun = null;
- }
- },
-
- hasTimers: function() {
- return !!this._timers.length || !!this._debouncees.length || !!this._throttlers.length || this._autorun;
- },
-
- cancel: function(timer) {
- var timerType = typeof timer;
-
- if (timer && timerType === 'object' && timer.queue && timer.method) { // we're cancelling a deferOnce
- return timer.queue.cancel(timer);
- } else if (timerType === 'function') { // we're cancelling a setTimeout
- for (var i = 0, l = this._timers.length; i < l; i += 2) {
- if (this._timers[i + 1] === timer) {
- this._timers.splice(i, 2); // remove the two elements
- if (i === 0) {
- if (this._laterTimer) { // Active timer? Then clear timer and reset for future timer
- clearTimeout(this._laterTimer);
- this._laterTimer = null;
- }
- if (this._timers.length > 0) { // Update to next available timer when available
- updateLaterTimer(this, this._timers[0], this._timers[0] - now());
- }
- }
- return true;
- }
- }
- } else if (Object.prototype.toString.call(timer) === "[object Array]"){ // we're cancelling a throttle or debounce
- return this._cancelItem(findThrottler, this._throttlers, timer) ||
- this._cancelItem(findDebouncee, this._debouncees, timer);
- } else {
- return; // timer was null or not a timer
- }
- },
-
- _cancelItem: function(findMethod, array, timer){
- var item, index;
-
- if (timer.length < 3) { return false; }
-
- index = findMethod(timer[0], timer[1], array);
-
- if (index > -1) {
-
- item = array[index];
-
- if (item[2] === timer[2]) {
- array.splice(index, 1);
- clearTimeout(timer[2]);
- return true;
- }
- }
-
- return false;
- }
- };
-
- Backburner.prototype.schedule = Backburner.prototype.defer;
- Backburner.prototype.scheduleOnce = Backburner.prototype.deferOnce;
- Backburner.prototype.later = Backburner.prototype.setTimeout;
-
- if (needsIETryCatchFix) {
- var originalRun = Backburner.prototype.run;
- Backburner.prototype.run = wrapInTryCatch(originalRun);
-
- var originalEnd = Backburner.prototype.end;
- Backburner.prototype.end = wrapInTryCatch(originalEnd);
- }
-
- function getOnError(options) {
- return options.onError || (options.onErrorTarget && options.onErrorTarget[options.onErrorMethod]);
- }
-
- function createAutorun(backburner) {
- backburner.begin();
- backburner._autorun = global.setTimeout(function() {
- backburner._autorun = null;
- backburner.end();
- });
- }
-
- function updateLaterTimer(backburner, executeAt, wait) {
- var n = now();
- if (!backburner._laterTimer || executeAt < backburner._laterTimerExpiresAt || backburner._laterTimerExpiresAt < n) {
-
- if (backburner._laterTimer) {
- // Clear when:
- // - Already expired
- // - New timer is earlier
- clearTimeout(backburner._laterTimer);
-
- if (backburner._laterTimerExpiresAt < n) { // If timer was never triggered
- // Calculate the left-over wait-time
- wait = Math.max(0, executeAt - n);
- }
- }
-
- backburner._laterTimer = global.setTimeout(function() {
- backburner._laterTimer = null;
- backburner._laterTimerExpiresAt = null;
- executeTimers(backburner);
- }, wait);
-
- backburner._laterTimerExpiresAt = n + wait;
- }
- }
-
- function executeTimers(backburner) {
- var n = now();
- var fns, i, l;
-
- backburner.run(function() {
- i = searchTimer(n, backburner._timers);
-
- fns = backburner._timers.splice(0, i);
-
- for (i = 1, l = fns.length; i < l; i += 2) {
- backburner.schedule(backburner.options.defaultQueue, null, fns[i]);
- }
- });
-
- if (backburner._timers.length) {
- updateLaterTimer(backburner, backburner._timers[0], backburner._timers[0] - n);
- }
- }
-
- function findDebouncee(target, method, debouncees) {
- return findItem(target, method, debouncees);
- }
-
- function findThrottler(target, method, throttlers) {
- return findItem(target, method, throttlers);
- }
-
- function findItem(target, method, collection) {
- var item;
- var index = -1;
-
- for (var i = 0, l = collection.length; i < l; i++) {
- item = collection[i];
- if (item[0] === target && item[1] === method) {
- index = i;
- break;
- }
- }
-
- return index;
- }
-
- __exports__["default"] = Backburner;
- });
-enifed("backburner.umd",
- ["./backburner"],
- function(__dependency1__) {
- "use strict";
- var Backburner = __dependency1__["default"];
-
- /* global define:true module:true window: true */
- if (typeof enifed === 'function' && enifed.amd) {
- enifed(function() { return Backburner; });
- } else if (typeof module !== 'undefined' && module.exports) {
- module.exports = Backburner;
- } else if (typeof this !== 'undefined') {
- this['Backburner'] = Backburner;
- }
- });
-enifed("backburner/binary-search",
- ["exports"],
- function(__exports__) {
- "use strict";
- __exports__["default"] = function binarySearch(time, timers) {
- var start = 0;
- var end = timers.length - 2;
- var middle, l;
-
- while (start < end) {
- // since timers is an array of pairs 'l' will always
- // be an integer
- l = (end - start) / 2;
-
- // compensate for the index in case even number
- // of pairs inside timers
- middle = start + l - (l % 2);
-
- if (time >= timers[middle]) {
- start = middle + 2;
- } else {
- end = middle;
- }
- }
-
- return (time >= timers[start]) ? start + 2 : start;
- }
- });
-enifed("backburner/deferred-action-queues",
- ["./utils","./queue","exports"],
- function(__dependency1__, __dependency2__, __exports__) {
- "use strict";
- var each = __dependency1__.each;
- var Queue = __dependency2__["default"];
-
- function DeferredActionQueues(queueNames, options) {
- var queues = this.queues = Object.create(null);
- this.queueNames = queueNames = queueNames || [];
-
- this.options = options;
-
- each(queueNames, function(queueName) {
- queues[queueName] = new Queue(queueName, options[queueName], options);
- });
- }
-
- function noSuchQueue(name) {
- throw new Error("You attempted to schedule an action in a queue (" + name + ") that doesn't exist");
- }
-
- DeferredActionQueues.prototype = {
- schedule: function(name, target, method, args, onceFlag, stack) {
- var queues = this.queues;
- var queue = queues[name];
-
- if (!queue) {
- noSuchQueue(name);
- }
-
- if (onceFlag) {
- return queue.pushUnique(target, method, args, stack);
- } else {
- return queue.push(target, method, args, stack);
- }
- },
-
- flush: function() {
- var queues = this.queues;
- var queueNames = this.queueNames;
- var queueName, queue, queueItems, priorQueueNameIndex;
- var queueNameIndex = 0;
- var numberOfQueues = queueNames.length;
- var options = this.options;
-
- while (queueNameIndex < numberOfQueues) {
- queueName = queueNames[queueNameIndex];
- queue = queues[queueName];
-
- var numberOfQueueItems = queue._queue.length;
-
- if (numberOfQueueItems === 0) {
- queueNameIndex++;
- } else {
- queue.flush(false /* async */);
- queueNameIndex = 0;
- }
- }
- }
- };
-
- __exports__["default"] = DeferredActionQueues;
- });
-enifed("backburner/platform",
- ["exports"],
- function(__exports__) {
- "use strict";
- // In IE 6-8, try/finally doesn't work without a catch.
- // Unfortunately, this is impossible to test for since wrapping it in a parent try/catch doesn't trigger the bug.
- // This tests for another broken try/catch behavior that only exhibits in the same versions of IE.
- var needsIETryCatchFix = (function(e,x){
- try{ x(); }
- catch(e) { } // jshint ignore:line
- return !!e;
- })();
- __exports__.needsIETryCatchFix = needsIETryCatchFix;
- });
-enifed("backburner/queue",
- ["./utils","exports"],
- function(__dependency1__, __exports__) {
- "use strict";
- var isString = __dependency1__.isString;
-
- function Queue(name, options, globalOptions) {
- this.name = name;
- this.globalOptions = globalOptions || {};
- this.options = options;
- this._queue = [];
- this.targetQueues = Object.create(null);
- this._queueBeingFlushed = undefined;
- }
-
- Queue.prototype = {
- push: function(target, method, args, stack) {
- var queue = this._queue;
- queue.push(target, method, args, stack);
-
- return {
- queue: this,
- target: target,
- method: method
- };
- },
-
- pushUniqueWithoutGuid: function(target, method, args, stack) {
- var queue = this._queue;
-
- for (var i = 0, l = queue.length; i < l; i += 4) {
- var currentTarget = queue[i];
- var currentMethod = queue[i+1];
-
- if (currentTarget === target && currentMethod === method) {
- queue[i+2] = args; // replace args
- queue[i+3] = stack; // replace stack
- return;
- }
- }
-
- queue.push(target, method, args, stack);
- },
-
- targetQueue: function(targetQueue, target, method, args, stack) {
- var queue = this._queue;
-
- for (var i = 0, l = targetQueue.length; i < l; i += 4) {
- var currentMethod = targetQueue[i];
- var currentIndex = targetQueue[i + 1];
-
- if (currentMethod === method) {
- queue[currentIndex + 2] = args; // replace args
- queue[currentIndex + 3] = stack; // replace stack
- return;
- }
- }
-
- targetQueue.push(
- method,
- queue.push(target, method, args, stack) - 4
- );
- },
-
- pushUniqueWithGuid: function(guid, target, method, args, stack) {
- var hasLocalQueue = this.targetQueues[guid];
-
- if (hasLocalQueue) {
- this.targetQueue(hasLocalQueue, target, method, args, stack);
- } else {
- this.targetQueues[guid] = [
- method,
- this._queue.push(target, method, args, stack) - 4
- ];
- }
-
- return {
- queue: this,
- target: target,
- method: method
- };
- },
-
- pushUnique: function(target, method, args, stack) {
- var queue = this._queue, currentTarget, currentMethod, i, l;
- var KEY = this.globalOptions.GUID_KEY;
-
- if (target && KEY) {
- var guid = target[KEY];
- if (guid) {
- return this.pushUniqueWithGuid(guid, target, method, args, stack);
- }
- }
-
- this.pushUniqueWithoutGuid(target, method, args, stack);
-
- return {
- queue: this,
- target: target,
- method: method
- };
- },
-
- invoke: function(target, method, args, _, _errorRecordedForStack) {
- if (args && args.length > 0) {
- method.apply(target, args);
- } else {
- method.call(target);
- }
- },
-
- invokeWithOnError: function(target, method, args, onError, errorRecordedForStack) {
- try {
- if (args && args.length > 0) {
- method.apply(target, args);
- } else {
- method.call(target);
- }
- } catch(error) {
- onError(error, errorRecordedForStack);
- }
- },
-
- flush: function(sync) {
- var queue = this._queue;
- var length = queue.length;
-
- if (length === 0) {
- return;
- }
-
- var globalOptions = this.globalOptions;
- var options = this.options;
- var before = options && options.before;
- var after = options && options.after;
- var onError = globalOptions.onError || (globalOptions.onErrorTarget &&
- globalOptions.onErrorTarget[globalOptions.onErrorMethod]);
- var target, method, args, errorRecordedForStack;
- var invoke = onError ? this.invokeWithOnError : this.invoke;
-
- this.targetQueues = Object.create(null);
- var queueItems = this._queueBeingFlushed = this._queue.slice();
- this._queue = [];
-
- if (before) {
- before();
- }
-
- for (var i = 0; i < length; i += 4) {
- target = queueItems[i];
- method = queueItems[i+1];
- args = queueItems[i+2];
- errorRecordedForStack = queueItems[i+3]; // Debugging assistance
-
- if (isString(method)) {
- method = target[method];
- }
-
- // method could have been nullified / canceled during flush
- if (method) {
- //
- // ** Attention intrepid developer **
- //
- // To find out the stack of this task when it was scheduled onto
- // the run loop, add the following to your app.js:
- //
- // Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production.
- //
- // Once that is in place, when you are at a breakpoint and navigate
- // here in the stack explorer, you can look at `errorRecordedForStack.stack`,
- // which will be the captured stack when this job was scheduled.
- //
- invoke(target, method, args, onError, errorRecordedForStack);
- }
- }
-
- if (after) {
- after();
- }
-
- this._queueBeingFlushed = undefined;
-
- if (sync !== false &&
- this._queue.length > 0) {
- // check if new items have been added
- this.flush(true);
- }
- },
-
- cancel: function(actionToCancel) {
- var queue = this._queue, currentTarget, currentMethod, i, l;
- var target = actionToCancel.target;
- var method = actionToCancel.method;
- var GUID_KEY = this.globalOptions.GUID_KEY;
-
- if (GUID_KEY && this.targetQueues && target) {
- var targetQueue = this.targetQueues[target[GUID_KEY]];
-
- if (targetQueue) {
- for (i = 0, l = targetQueue.length; i < l; i++) {
- if (targetQueue[i] === method) {
- targetQueue.splice(i, 1);
- }
- }
- }
- }
-
- for (i = 0, l = queue.length; i < l; i += 4) {
- currentTarget = queue[i];
- currentMethod = queue[i+1];
-
- if (currentTarget === target &&
- currentMethod === method) {
- queue.splice(i, 4);
- return true;
- }
- }
-
- // if not found in current queue
- // could be in the queue that is being flushed
- queue = this._queueBeingFlushed;
-
- if (!queue) {
- return;
- }
-
- for (i = 0, l = queue.length; i < l; i += 4) {
- currentTarget = queue[i];
- currentMethod = queue[i+1];
-
- if (currentTarget === target &&
- currentMethod === method) {
- // don't mess with array during flush
- // just nullify the method
- queue[i+1] = null;
- return true;
- }
- }
- }
- };
-
- __exports__["default"] = Queue;
- });
-enifed("backburner/utils",
- ["exports"],
- function(__exports__) {
- "use strict";
- var NUMBER = /\d+/;
-
- function each(collection, callback) {
- for (var i = 0; i < collection.length; i++) {
- callback(collection[i]);
- }
- }
-
- __exports__.each = each;// Date.now is not available in browsers < IE9
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now#Compatibility
- var now = Date.now || function() { return new Date().getTime(); };
- __exports__.now = now;
- function isString(suspect) {
- return typeof suspect === 'string';
- }
-
- __exports__.isString = isString;function isFunction(suspect) {
- return typeof suspect === 'function';
- }
-
- __exports__.isFunction = isFunction;function isNumber(suspect) {
- return typeof suspect === 'number';
- }
-
- __exports__.isNumber = isNumber;function isCoercableNumber(number) {
- return isNumber(number) || NUMBER.test(number);
- }
-
- __exports__.isCoercableNumber = isCoercableNumber;function wrapInTryCatch(func) {
- return function () {
- try {
- return func.apply(this, arguments);
- } catch (e) {
- throw e;
- }
- };
- }
-
- __exports__.wrapInTryCatch = wrapInTryCatch;
- });
-enifed("calculateVersion",
- [],
- function() {
- "use strict";
- 'use strict';
-
- var fs = eriuqer('fs');
- var path = eriuqer('path');
-
- module.exports = function () {
- var packageVersion = eriuqer('../package.json').version;
- var output = [packageVersion];
- var gitPath = path.join(__dirname,'..','.git');
- var headFilePath = path.join(gitPath, 'HEAD');
-
- if (packageVersion.indexOf('+') > -1) {
- try {
- if (fs.existsSync(headFilePath)) {
- var headFile = fs.readFileSync(headFilePath, {encoding: 'utf8'});
- var branchName = headFile.split('/').slice(-1)[0].trim();
- var refPath = headFile.split(' ')[1];
- var branchSHA;
-
- if (refPath) {
- var branchPath = path.join(gitPath, refPath.trim());
- branchSHA = fs.readFileSync(branchPath);
- } else {
- branchSHA = branchName;
- }
-
- output.push(branchSHA.slice(0,10));
- }
- } catch (err) {
- console.error(err.stack);
- }
- return output.join('.');
- } else {
- return packageVersion;
- }
- };
- });
-enifed("container",
- ["container/container","exports"],
- function(__dependency1__, __exports__) {
- "use strict";
- /*
- Public api for the container is still in flux.
- The public api, specified on the application namespace should be considered the stable api.
- // @module container
- @private
- */
-
- /*
- Flag to enable/disable model factory injections (disabled by default)
- If model factory injections are enabled, models should not be
- accessed globally (only through `container.lookupFactory('model:modelName'))`);
- */
- Ember.MODEL_FACTORY_INJECTIONS = false;
-
- if (Ember.ENV && typeof Ember.ENV.MODEL_FACTORY_INJECTIONS !== 'undefined') {
- Ember.MODEL_FACTORY_INJECTIONS = !!Ember.ENV.MODEL_FACTORY_INJECTIONS;
- }
-
-
- var Container = __dependency1__["default"];
-
- __exports__["default"] = Container;
- });
-enifed("container/container",
- ["ember-metal/core","ember-metal/keys","ember-metal/dictionary","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __exports__) {
- "use strict";
- var Ember = __dependency1__["default"];
- // Ember.assert
- var emberKeys = __dependency2__["default"];
- var dictionary = __dependency3__["default"];
-
- // A lightweight container that helps to assemble and decouple components.
- // Public api for the container is still in flux.
- // The public api, specified on the application namespace should be considered the stable api.
- function Container(parent) {
- this.parent = parent;
- this.children = [];
-
- this.resolver = parent && parent.resolver || function() {};
-
- this.registry = dictionary(parent ? parent.registry : null);
- this.cache = dictionary(parent ? parent.cache : null);
- this.factoryCache = dictionary(parent ? parent.factoryCache : null);
- this.resolveCache = dictionary(parent ? parent.resolveCache : null);
- this.typeInjections = dictionary(parent ? parent.typeInjections : null);
- this.injections = dictionary(null);
- this.normalizeCache = dictionary(null);
-
- this.validationCache = dictionary(parent ? parent.validationCache : null);
-
-
- this.factoryTypeInjections = dictionary(parent ? parent.factoryTypeInjections : null);
- this.factoryInjections = dictionary(null);
-
- this._options = dictionary(parent ? parent._options : null);
- this._typeOptions = dictionary(parent ? parent._typeOptions : null);
- }
-
- Container.prototype = {
-
- /**
- @property parent
- @type Container
- @default null
- */
- parent: null,
-
- /**
- @property children
- @type Array
- @default []
- */
- children: null,
-
- /**
- @property resolver
- @type function
- */
- resolver: null,
-
- /**
- @property registry
- @type InheritingDict
- */
- registry: null,
-
- /**
- @property cache
- @type InheritingDict
- */
- cache: null,
-
- /**
- @property typeInjections
- @type InheritingDict
- */
- typeInjections: null,
-
- /**
- @property injections
- @type Object
- @default {}
- */
- injections: null,
-
- /**
- @private
-
- @property _options
- @type InheritingDict
- @default null
- */
- _options: null,
-
- /**
- @private
-
- @property _typeOptions
- @type InheritingDict
- */
- _typeOptions: null,
-
- /**
- Returns a new child of the current container. These children are configured
- to correctly inherit from the current container.
-
- @method child
- @return {Container}
- */
- child: function() {
- var container = new Container(this);
- this.children.push(container);
- return container;
- },
-
- /**
- Registers a factory for later injection.
-
- Example:
-
- ```javascript
- var container = new Container();
-
- container.register('model:user', Person, {singleton: false });
- container.register('fruit:favorite', Orange);
- container.register('communication:main', Email, {singleton: false});
- ```
-
- @method register
- @param {String} fullName
- @param {Function} factory
- @param {Object} options
- */
- register: function(fullName, factory, options) {
- Ember.assert('fullName must be a proper full name', validateFullName(fullName));
-
- if (factory === undefined) {
- throw new TypeError('Attempting to register an unknown factory: `' + fullName + '`');
- }
-
- var normalizedName = this.normalize(fullName);
-
- if (normalizedName in this.cache) {
- throw new Error('Cannot re-register: `' + fullName +'`, as it has already been looked up.');
- }
-
- this.registry[normalizedName] = factory;
- this._options[normalizedName] = (options || {});
- },
-
- /**
- Unregister a fullName
-
- ```javascript
- var container = new Container();
- container.register('model:user', User);
-
- container.lookup('model:user') instanceof User //=> true
-
- container.unregister('model:user')
- container.lookup('model:user') === undefined //=> true
- ```
-
- @method unregister
- @param {String} fullName
- */
- unregister: function(fullName) {
- Ember.assert('fullName must be a proper full name', validateFullName(fullName));
-
- var normalizedName = this.normalize(fullName);
-
- delete this.registry[normalizedName];
- delete this.cache[normalizedName];
- delete this.factoryCache[normalizedName];
- delete this.resolveCache[normalizedName];
- delete this._options[normalizedName];
-
- delete this.validationCache[normalizedName];
-
- },
-
- /**
- Given a fullName return the corresponding factory.
-
- By default `resolve` will retrieve the factory from
- its container's registry.
-
- ```javascript
- var container = new Container();
- container.register('api:twitter', Twitter);
-
- container.resolve('api:twitter') // => Twitter
- ```
-
- Optionally the container can be provided with a custom resolver.
- If provided, `resolve` will first provide the custom resolver
- the opportunity to resolve the fullName, otherwise it will fallback
- to the registry.
-
- ```javascript
- var container = new Container();
- container.resolver = function(fullName) {
- // lookup via the module system of choice
- };
-
- // the twitter factory is added to the module system
- container.resolve('api:twitter') // => Twitter
- ```
-
- @method resolve
- @param {String} fullName
- @return {Function} fullName's factory
- */
- resolve: function(fullName) {
- Ember.assert('fullName must be a proper full name', validateFullName(fullName));
- return resolve(this, this.normalize(fullName));
- },
-
- /**
- A hook that can be used to describe how the resolver will
- attempt to find the factory.
-
- For example, the default Ember `.describe` returns the full
- class name (including namespace) where Ember's resolver expects
- to find the `fullName`.
-
- @method describe
- @param {String} fullName
- @return {string} described fullName
- */
- describe: function(fullName) {
- return fullName;
- },
-
- /**
- A hook to enable custom fullName normalization behaviour
-
- @method normalizeFullName
- @param {String} fullName
- @return {string} normalized fullName
- */
- normalizeFullName: function(fullName) {
- return fullName;
- },
-
- /**
- normalize a fullName based on the applications conventions
-
- @method normalize
- @param {String} fullName
- @return {string} normalized fullName
- */
- normalize: function(fullName) {
- return this.normalizeCache[fullName] || (
- this.normalizeCache[fullName] = this.normalizeFullName(fullName)
- );
- },
-
- /**
- @method makeToString
-
- @param {any} factory
- @param {string} fullName
- @return {function} toString function
- */
- makeToString: function(factory, fullName) {
- return factory.toString();
- },
-
- /**
- Given a fullName return a corresponding instance.
-
- The default behaviour is for lookup to return a singleton instance.
- The singleton is scoped to the container, allowing multiple containers
- to all have their own locally scoped singletons.
-
- ```javascript
- var container = new Container();
- container.register('api:twitter', Twitter);
-
- var twitter = container.lookup('api:twitter');
-
- twitter instanceof Twitter; // => true
-
- // by default the container will return singletons
- var twitter2 = container.lookup('api:twitter');
- twitter2 instanceof Twitter; // => true
-
- twitter === twitter2; //=> true
- ```
-
- If singletons are not wanted an optional flag can be provided at lookup.
-
- ```javascript
- var container = new Container();
- container.register('api:twitter', Twitter);
-
- var twitter = container.lookup('api:twitter', { singleton: false });
- var twitter2 = container.lookup('api:twitter', { singleton: false });
-
- twitter === twitter2; //=> false
- ```
-
- @method lookup
- @param {String} fullName
- @param {Object} options
- @return {any}
- */
- lookup: function(fullName, options) {
- Ember.assert('fullName must be a proper full name', validateFullName(fullName));
- return lookup(this, this.normalize(fullName), options);
- },
-
- /**
- Given a fullName return the corresponding factory.
-
- @method lookupFactory
- @param {String} fullName
- @return {any}
- */
- lookupFactory: function(fullName) {
- Ember.assert('fullName must be a proper full name', validateFullName(fullName));
- return factoryFor(this, this.normalize(fullName));
- },
-
- /**
- Given a fullName check if the container is aware of its factory
- or singleton instance.
-
- @method has
- @param {String} fullName
- @return {Boolean}
- */
- has: function(fullName) {
- Ember.assert('fullName must be a proper full name', validateFullName(fullName));
- return has(this, this.normalize(fullName));
- },
-
- /**
- Allow registering options for all factories of a type.
-
- ```javascript
- var container = new Container();
-
- // if all of type `connection` must not be singletons
- container.optionsForType('connection', { singleton: false });
-
- container.register('connection:twitter', TwitterConnection);
- container.register('connection:facebook', FacebookConnection);
-
- var twitter = container.lookup('connection:twitter');
- var twitter2 = container.lookup('connection:twitter');
-
- twitter === twitter2; // => false
-
- var facebook = container.lookup('connection:facebook');
- var facebook2 = container.lookup('connection:facebook');
-
- facebook === facebook2; // => false
- ```
-
- @method optionsForType
- @param {String} type
- @param {Object} options
- */
- optionsForType: function(type, options) {
- if (this.parent) { illegalChildOperation('optionsForType'); }
-
- this._typeOptions[type] = options;
- },
-
- /**
- @method options
- @param {String} fullName
- @param {Object} options
- */
- options: function(fullName, options) {
- options = options || {};
- var normalizedName = this.normalize(fullName);
- this._options[normalizedName] = options;
- },
-
- /**
- Used only via `injection`.
-
- Provides a specialized form of injection, specifically enabling
- all objects of one type to be injected with a reference to another
- object.
-
- For example, provided each object of type `controller` needed a `router`.
- one would do the following:
-
- ```javascript
- var container = new Container();
-
- container.register('router:main', Router);
- container.register('controller:user', UserController);
- container.register('controller:post', PostController);
-
- container.typeInjection('controller', 'router', 'router:main');
-
- var user = container.lookup('controller:user');
- var post = container.lookup('controller:post');
-
- user.router instanceof Router; //=> true
- post.router instanceof Router; //=> true
-
- // both controllers share the same router
- user.router === post.router; //=> true
- ```
-
- @private
- @method typeInjection
- @param {String} type
- @param {String} property
- @param {String} fullName
- */
- typeInjection: function(type, property, fullName) {
- Ember.assert('fullName must be a proper full name', validateFullName(fullName));
-
- if (this.parent) { illegalChildOperation('typeInjection'); }
-
- var fullNameType = fullName.split(':')[0];
- if (fullNameType === type) {
- throw new Error('Cannot inject a `' + fullName +
- '` on other ' + type +
- '(s). Register the `' + fullName +
- '` as a different type and perform the typeInjection.');
- }
-
- addTypeInjection(this.typeInjections, type, property, fullName);
- },
-
- /**
- Defines injection rules.
-
- These rules are used to inject dependencies onto objects when they
- are instantiated.
-
- Two forms of injections are possible:
-
- * Injecting one fullName on another fullName
- * Injecting one fullName on a type
-
- Example:
-
- ```javascript
- var container = new Container();
-
- container.register('source:main', Source);
- container.register('model:user', User);
- container.register('model:post', Post);
-
- // injecting one fullName on another fullName
- // eg. each user model gets a post model
- container.injection('model:user', 'post', 'model:post');
-
- // injecting one fullName on another type
- container.injection('model', 'source', 'source:main');
-
- var user = container.lookup('model:user');
- var post = container.lookup('model:post');
-
- user.source instanceof Source; //=> true
- post.source instanceof Source; //=> true
-
- user.post instanceof Post; //=> true
-
- // and both models share the same source
- user.source === post.source; //=> true
- ```
-
- @method injection
- @param {String} factoryName
- @param {String} property
- @param {String} injectionName
- */
- injection: function(fullName, property, injectionName) {
- if (this.parent) { illegalChildOperation('injection'); }
-
- validateFullName(injectionName);
- var normalizedInjectionName = this.normalize(injectionName);
-
- if (fullName.indexOf(':') === -1) {
- return this.typeInjection(fullName, property, normalizedInjectionName);
- }
-
- Ember.assert('fullName must be a proper full name', validateFullName(fullName));
- var normalizedName = this.normalize(fullName);
-
- if (this.cache[normalizedName]) {
- throw new Error("Attempted to register an injection for a type that has already been looked up. ('" +
- normalizedName + "', '" +
- property + "', '" +
- injectionName + "')");
- }
-
- addInjection(initRules(this.injections, normalizedName), property, normalizedInjectionName);
- },
-
-
- /**
- Used only via `factoryInjection`.
-
- Provides a specialized form of injection, specifically enabling
- all factory of one type to be injected with a reference to another
- object.
-
- For example, provided each factory of type `model` needed a `store`.
- one would do the following:
-
- ```javascript
- var container = new Container();
-
- container.register('store:main', SomeStore);
-
- container.factoryTypeInjection('model', 'store', 'store:main');
-
- var store = container.lookup('store:main');
- var UserFactory = container.lookupFactory('model:user');
-
- UserFactory.store instanceof SomeStore; //=> true
- ```
-
- @private
- @method factoryTypeInjection
- @param {String} type
- @param {String} property
- @param {String} fullName
- */
- factoryTypeInjection: function(type, property, fullName) {
- if (this.parent) { illegalChildOperation('factoryTypeInjection'); }
-
- addTypeInjection(this.factoryTypeInjections, type, property, this.normalize(fullName));
- },
-
- /**
- Defines factory injection rules.
-
- Similar to regular injection rules, but are run against factories, via
- `Container#lookupFactory`.
-
- These rules are used to inject objects onto factories when they
- are looked up.
-
- Two forms of injections are possible:
-
- * Injecting one fullName on another fullName
- * Injecting one fullName on a type
-
- Example:
-
- ```javascript
- var container = new Container();
-
- container.register('store:main', Store);
- container.register('store:secondary', OtherStore);
- container.register('model:user', User);
- container.register('model:post', Post);
-
- // injecting one fullName on another type
- container.factoryInjection('model', 'store', 'store:main');
-
- // injecting one fullName on another fullName
- container.factoryInjection('model:post', 'secondaryStore', 'store:secondary');
-
- var UserFactory = container.lookupFactory('model:user');
- var PostFactory = container.lookupFactory('model:post');
- var store = container.lookup('store:main');
-
- UserFactory.store instanceof Store; //=> true
- UserFactory.secondaryStore instanceof OtherStore; //=> false
-
- PostFactory.store instanceof Store; //=> true
- PostFactory.secondaryStore instanceof OtherStore; //=> true
-
- // and both models share the same source instance
- UserFactory.store === PostFactory.store; //=> true
- ```
-
- @method factoryInjection
- @param {String} factoryName
- @param {String} property
- @param {String} injectionName
- */
- factoryInjection: function(fullName, property, injectionName) {
- if (this.parent) { illegalChildOperation('injection'); }
-
- var normalizedName = this.normalize(fullName);
- var normalizedInjectionName = this.normalize(injectionName);
-
- validateFullName(injectionName);
-
- if (fullName.indexOf(':') === -1) {
- return this.factoryTypeInjection(normalizedName, property, normalizedInjectionName);
- }
-
- Ember.assert('fullName must be a proper full name', validateFullName(fullName));
-
- if (this.factoryCache[normalizedName]) {
- throw new Error('Attempted to register a factoryInjection for a type that has already ' +
- 'been looked up. (\'' + normalizedName + '\', \'' + property + '\', \'' + injectionName + '\')');
- }
-
- addInjection(initRules(this.factoryInjections, normalizedName), property, normalizedInjectionName);
- },
-
- /**
- A depth first traversal, destroying the container, its descendant containers and all
- their managed objects.
-
- @method destroy
- */
- destroy: function() {
- for (var i = 0, length = this.children.length; i < length; i++) {
- this.children[i].destroy();
- }
-
- this.children = [];
-
- eachDestroyable(this, function(item) {
- item.destroy();
- });
-
- this.parent = undefined;
- this.isDestroyed = true;
- },
-
- /**
- @method reset
- */
- reset: function() {
- for (var i = 0, length = this.children.length; i < length; i++) {
- resetCache(this.children[i]);
- }
-
- resetCache(this);
- }
- };
-
- function resolve(container, normalizedName) {
- var cached = container.resolveCache[normalizedName];
- if (cached) { return cached; }
-
- var resolved = container.resolver(normalizedName) || container.registry[normalizedName];
- container.resolveCache[normalizedName] = resolved;
-
- return resolved;
- }
-
- function has(container, fullName){
- if (container.cache[fullName]) {
- return true;
- }
-
- return container.resolve(fullName) !== undefined;
- }
-
- function lookup(container, fullName, options) {
- options = options || {};
-
- if (container.cache[fullName] && options.singleton !== false) {
- return container.cache[fullName];
- }
-
- var value = instantiate(container, fullName);
-
- if (value === undefined) { return; }
-
- if (isSingleton(container, fullName) && options.singleton !== false) {
- container.cache[fullName] = value;
- }
-
- return value;
- }
-
- function illegalChildOperation(operation) {
- throw new Error(operation + ' is not currently supported on child containers');
- }
-
- function isSingleton(container, fullName) {
- var singleton = option(container, fullName, 'singleton');
-
- return singleton !== false;
- }
-
- function buildInjections(container, injections) {
- var hash = {};
-
- if (!injections) { return hash; }
-
- validateInjections(container, injections);
-
- var injection;
-
- for (var i = 0, length = injections.length; i < length; i++) {
- injection = injections[i];
- hash[injection.property] = lookup(container, injection.fullName);
- }
-
- return hash;
- }
-
- function validateInjections(container, injections) {
- if (!injections) { return; }
-
- var fullName;
-
- for (var i = 0, length = injections.length; i < length; i++) {
- fullName = injections[i].fullName;
-
- if (!container.has(fullName)) {
- throw new Error('Attempting to inject an unknown injection: `' + fullName + '`');
- }
- }
- }
-
- function option(container, fullName, optionName) {
- var options = container._options[fullName];
-
- if (options && options[optionName] !== undefined) {
- return options[optionName];
- }
-
- var type = fullName.split(':')[0];
- options = container._typeOptions[type];
-
- if (options) {
- return options[optionName];
- }
- }
-
- function factoryFor(container, fullName) {
- var cache = container.factoryCache;
- if (cache[fullName]) {
- return cache[fullName];
- }
- var factory = container.resolve(fullName);
- if (factory === undefined) { return; }
-
- var type = fullName.split(':')[0];
- if (!factory || typeof factory.extend !== 'function' || (!Ember.MODEL_FACTORY_INJECTIONS && type === 'model')) {
- if (factory && typeof factory._onLookup === 'function') {
- factory._onLookup(fullName);
- }
-
- // TODO: think about a 'safe' merge style extension
- // for now just fallback to create time injection
- cache[fullName] = factory;
- return factory;
- } else {
- var injections = injectionsFor(container, fullName);
- var factoryInjections = factoryInjectionsFor(container, fullName);
-
- factoryInjections._toString = container.makeToString(factory, fullName);
-
- var injectedFactory = factory.extend(injections);
- injectedFactory.reopenClass(factoryInjections);
-
- if (factory && typeof factory._onLookup === 'function') {
- factory._onLookup(fullName);
- }
-
- cache[fullName] = injectedFactory;
-
- return injectedFactory;
- }
- }
-
- function injectionsFor(container, fullName) {
- var splitName = fullName.split(':');
- var type = splitName[0];
- var injections = [];
-
- injections = injections.concat(container.typeInjections[type] || []);
- injections = injections.concat(container.injections[fullName] || []);
-
- injections = buildInjections(container, injections);
- injections._debugContainerKey = fullName;
- injections.container = container;
-
- return injections;
- }
-
- function factoryInjectionsFor(container, fullName) {
- var splitName = fullName.split(':');
- var type = splitName[0];
- var factoryInjections = [];
-
- factoryInjections = factoryInjections.concat(container.factoryTypeInjections[type] || []);
- factoryInjections = factoryInjections.concat(container.factoryInjections[fullName] || []);
-
- factoryInjections = buildInjections(container, factoryInjections);
- factoryInjections._debugContainerKey = fullName;
-
- return factoryInjections;
- }
-
- function normalizeInjectionsHash(hash) {
- var injections = [];
-
- for (var key in hash) {
- if (hash.hasOwnProperty(key)) {
- Ember.assert("Expected a proper full name, given '" + hash[key] + "'", validateFullName(hash[key]));
-
- addInjection(injections, key, hash[key]);
- }
- }
-
- return injections;
- }
-
- function instantiate(container, fullName) {
- var factory = factoryFor(container, fullName);
- var lazyInjections, validationCache;
-
- if (option(container, fullName, 'instantiate') === false) {
- return factory;
- }
-
- if (factory) {
- if (typeof factory.create !== 'function') {
- throw new Error('Failed to create an instance of \'' + fullName + '\'. ' +
- 'Most likely an improperly defined class or an invalid module export.');
- }
-
-
- validationCache = container.validationCache;
-
- // Ensure that all lazy injections are valid at instantiation time
- if (!validationCache[fullName] && typeof factory._lazyInjections === 'function') {
- lazyInjections = factory._lazyInjections();
-
- validateInjections(container, normalizeInjectionsHash(lazyInjections));
- }
-
- validationCache[fullName] = true;
-
-
- if (typeof factory.extend === 'function') {
- // assume the factory was extendable and is already injected
- return factory.create();
- } else {
- // assume the factory was extendable
- // to create time injections
- // TODO: support new'ing for instantiation and merge injections for pure JS Functions
- return factory.create(injectionsFor(container, fullName));
- }
- }
- }
-
- function eachDestroyable(container, callback) {
- var cache = container.cache;
- var keys = emberKeys(cache);
- var key, value;
-
- for (var i = 0, l = keys.length; i < l; i++) {
- key = keys[i];
- value = cache[key];
-
- if (option(container, key, 'instantiate') !== false) {
- callback(value);
- }
- }
- }
-
- function resetCache(container) {
- eachDestroyable(container, function(value) {
- value.destroy();
- });
-
- container.cache.dict = dictionary(null);
- }
-
- function addTypeInjection(rules, type, property, fullName) {
- var injections = rules[type];
-
- if (!injections) {
- injections = [];
- rules[type] = injections;
- }
-
- injections.push({
- property: property,
- fullName: fullName
- });
- }
-
- var VALID_FULL_NAME_REGEXP = /^[^:]+.+:[^:]+$/;
- function validateFullName(fullName) {
- if (!VALID_FULL_NAME_REGEXP.test(fullName)) {
- throw new TypeError('Invalid Fullname, expected: `type:name` got: ' + fullName);
- }
- return true;
- }
-
- function initRules(rules, factoryName) {
- return rules[factoryName] || (rules[factoryName] = []);
- }
-
- function addInjection(injections, property, injectionName) {
- injections.push({
- property: property,
- fullName: injectionName
- });
- }
-
- __exports__["default"] = Container;
- });
-enifed("dag-map",
- ["exports"],
- function(__exports__) {
- "use strict";
- function visit(vertex, fn, visited, path) {
- var name = vertex.name;
- var vertices = vertex.incoming;
- var names = vertex.incomingNames;
- var len = names.length;
- var i;
-
- if (!visited) {
- visited = {};
- }
- if (!path) {
- path = [];
- }
- if (visited.hasOwnProperty(name)) {
- return;
- }
- path.push(name);
- visited[name] = true;
- for (i = 0; i < len; i++) {
- visit(vertices[names[i]], fn, visited, path);
- }
- fn(vertex, path);
- path.pop();
- }
-
-
- /**
- * DAG stands for Directed acyclic graph.
- *
- * It is used to build a graph of dependencies checking that there isn't circular
- * dependencies. p.e Registering initializers with a certain precedence order.
- *
- * @class DAG
- * @constructor
- */
- function DAG() {
- this.names = [];
- this.vertices = Object.create(null);
- }
-
- /**
- * DAG Vertex
- *
- * @class Vertex
- * @constructor
- */
-
- function Vertex(name) {
- this.name = name;
- this.incoming = {};
- this.incomingNames = [];
- this.hasOutgoing = false;
- this.value = null;
- }
-
- /**
- * Adds a vertex entry to the graph unless it is already added.
- *
- * @private
- * @method add
- * @param {String} name The name of the vertex to add
- */
- DAG.prototype.add = function(name) {
- if (!name) {
- throw new Error("Can't add Vertex without name");
- }
- if (this.vertices[name] !== undefined) {
- return this.vertices[name];
- }
- var vertex = new Vertex(name);
- this.vertices[name] = vertex;
- this.names.push(name);
- return vertex;
- };
-
- /**
- * Adds a vertex to the graph and sets its value.
- *
- * @private
- * @method map
- * @param {String} name The name of the vertex.
- * @param value The value to put in the vertex.
- */
- DAG.prototype.map = function(name, value) {
- this.add(name).value = value;
- };
-
- /**
- * Connects the vertices with the given names, adding them to the graph if
- * necessary, only if this does not produce is any circular dependency.
- *
- * @private
- * @method addEdge
- * @param {String} fromName The name the vertex where the edge starts.
- * @param {String} toName The name the vertex where the edge ends.
- */
- DAG.prototype.addEdge = function(fromName, toName) {
- if (!fromName || !toName || fromName === toName) {
- return;
- }
- var from = this.add(fromName);
- var to = this.add(toName);
- if (to.incoming.hasOwnProperty(fromName)) {
- return;
- }
- function checkCycle(vertex, path) {
- if (vertex.name === toName) {
- throw new Error("cycle detected: " + toName + " <- " + path.join(" <- "));
- }
- }
- visit(from, checkCycle);
- from.hasOutgoing = true;
- to.incoming[fromName] = from;
- to.incomingNames.push(fromName);
- };
-
- /**
- * Visits all the vertex of the graph calling the given function with each one,
- * ensuring that the vertices are visited respecting their precedence.
- *
- * @method topsort
- * @param {Function} fn The function to be invoked on each vertex.
- */
- DAG.prototype.topsort = function(fn) {
- var visited = {};
- var vertices = this.vertices;
- var names = this.names;
- var len = names.length;
- var i, vertex;
-
- for (i = 0; i < len; i++) {
- vertex = vertices[names[i]];
- if (!vertex.hasOutgoing) {
- visit(vertex, fn, visited);
- }
- }
- };
-
- /**
- * Adds a vertex with the given name and value to the graph and joins it with the
- * vertices referenced in _before_ and _after_. If there isn't vertices with those
- * names, they are added too.
- *
- * If either _before_ or _after_ are falsy/empty, the added vertex will not have
- * an incoming/outgoing edge.
- *
- * @method addEdges
- * @param {String} name The name of the vertex to be added.
- * @param value The value of that vertex.
- * @param before An string or array of strings with the names of the vertices before
- * which this vertex must be visited.
- * @param after An string or array of strings with the names of the vertex after
- * which this vertex must be visited.
- *
- */
- DAG.prototype.addEdges = function(name, value, before, after) {
- var i;
- this.map(name, value);
- if (before) {
- if (typeof before === 'string') {
- this.addEdge(name, before);
- } else {
- for (i = 0; i < before.length; i++) {
- this.addEdge(name, before[i]);
- }
- }
- }
- if (after) {
- if (typeof after === 'string') {
- this.addEdge(after, name);
- } else {
- for (i = 0; i < after.length; i++) {
- this.addEdge(after[i], name);
- }
- }
- }
- };
-
- __exports__["default"] = DAG;
- });
-enifed("dag-map.umd",
- ["./dag-map"],
- function(__dependency1__) {
- "use strict";
- var DAG = __dependency1__["default"];
-
- /* global define:true module:true window: true */
- if (typeof enifed === 'function' && enifed.amd) {
- enifed(function() { return DAG; });
- } else if (typeof module !== 'undefined' && module.exports) {
- module.exports = DAG;
- } else if (typeof this !== 'undefined') {
- this['DAG'] = DAG;
- }
- });
-enifed("ember-application",
- ["ember-metal/core","ember-runtime/system/lazy_load","ember-application/system/resolver","ember-application/system/application","ember-application/ext/controller"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
- "use strict";
- var Ember = __dependency1__["default"];
- var runLoadHooks = __dependency2__.runLoadHooks;
-
- /**
- Ember Application
-
- @module ember
- @submodule ember-application
- @requires ember-views, ember-routing
- */
-
- var Resolver = __dependency3__.Resolver;
- var DefaultResolver = __dependency3__["default"];
- var Application = __dependency4__["default"];
- // side effect of extending ControllerMixin
-
- Ember.Application = Application;
- Ember.Resolver = Resolver;
- Ember.DefaultResolver = DefaultResolver;
-
- runLoadHooks('Ember.Application', Application);
- });
-enifed("ember-application/ext/controller",
- ["ember-metal/core","ember-metal/property_get","ember-metal/error","ember-metal/utils","ember-metal/computed","ember-runtime/mixins/controller","ember-routing/system/controller_for","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {
- "use strict";
- /**
- @module ember
- @submodule ember-application
- */
-
- var Ember = __dependency1__["default"];
- // Ember.assert
- var get = __dependency2__.get;
- var EmberError = __dependency3__["default"];
- var inspect = __dependency4__.inspect;
- var computed = __dependency5__.computed;
- var ControllerMixin = __dependency6__["default"];
- var meta = __dependency4__.meta;
- var controllerFor = __dependency7__["default"];
-
- function verifyNeedsDependencies(controller, container, needs) {
- var dependency, i, l;
- var missing = [];
-
- for (i=0, l=needs.length; i 1 ? 'they' : 'it') + " could not be found");
- }
- }
-
- var defaultControllersComputedProperty = computed(function() {
- var controller = this;
-
- return {
- needs: get(controller, 'needs'),
- container: get(controller, 'container'),
- unknownProperty: function(controllerName) {
- var needs = this.needs;
- var dependency, i, l;
-
- for (i=0, l=needs.length; i 0) {
- Ember.assert(' `' + inspect(this) + ' specifies `needs`, but does ' +
- "not have a container. Please ensure this controller was " +
- "instantiated with a container.",
- this.container || meta(this, false).descs.controllers !== defaultControllersComputedProperty);
-
- if (this.container) {
- verifyNeedsDependencies(this, this.container, needs);
- }
-
- // if needs then initialize controllers proxy
- get(this, 'controllers');
- }
-
- this._super.apply(this, arguments);
- },
-
- /**
- @method controllerFor
- @see {Ember.Route#controllerFor}
- @deprecated Use `needs` instead
- */
- controllerFor: function(controllerName) {
- Ember.deprecate("Controller#controllerFor is deprecated, please use Controller#needs instead");
- return controllerFor(get(this, 'container'), controllerName);
- },
-
- /**
- Stores the instances of other controllers available from within
- this controller. Any controller listed by name in the `needs`
- property will be accessible by name through this property.
-
- ```javascript
- App.CommentsController = Ember.ArrayController.extend({
- needs: ['post'],
- postTitle: function(){
- var currentPost = this.get('controllers.post'); // instance of App.PostController
- return currentPost.get('title');
- }.property('controllers.post.title')
- });
- ```
-
- @see {Ember.ControllerMixin#needs}
- @property {Object} controllers
- @default null
- */
- controllers: defaultControllersComputedProperty
- });
-
- __exports__["default"] = ControllerMixin;
- });
-enifed("ember-application/system/application",
- ["dag-map","container/container","ember-metal","ember-metal/property_get","ember-metal/property_set","ember-runtime/system/lazy_load","ember-runtime/system/namespace","ember-runtime/mixins/deferred","ember-application/system/resolver","ember-metal/platform","ember-metal/run_loop","ember-metal/utils","ember-runtime/controllers/controller","ember-metal/enumerable_utils","ember-runtime/controllers/object_controller","ember-runtime/controllers/array_controller","ember-views/views/select","ember-views/system/event_dispatcher","ember-views/system/jquery","ember-routing/system/route","ember-routing/system/router","ember-routing/location/hash_location","ember-routing/location/history_location","ember-routing/location/auto_location","ember-routing/location/none_location","ember-routing/system/cache","ember-extension-support/container_debug_adapter","ember-metal/core","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__, __dependency27__, __dependency28__, __exports__) {
- "use strict";
- /**
- @module ember
- @submodule ember-application
- */
- var DAG = __dependency1__["default"];
- var Container = __dependency2__["default"];
-
-
- var Ember = __dependency3__["default"];
- // Ember.FEATURES, Ember.deprecate, Ember.assert, Ember.libraries, LOG_VERSION, Namespace, BOOTED
- var get = __dependency4__.get;
- var set = __dependency5__.set;
- var runLoadHooks = __dependency6__.runLoadHooks;
- var Namespace = __dependency7__["default"];
- var DeferredMixin = __dependency8__["default"];
- var DefaultResolver = __dependency9__["default"];
- var create = __dependency10__.create;
- var run = __dependency11__["default"];
- var canInvoke = __dependency12__.canInvoke;
- var Controller = __dependency13__["default"];
- var EnumerableUtils = __dependency14__["default"];
- var ObjectController = __dependency15__["default"];
- var ArrayController = __dependency16__["default"];
- var SelectView = __dependency17__["default"];
- var EventDispatcher = __dependency18__["default"];
- var jQuery = __dependency19__["default"];
- var Route = __dependency20__["default"];
- var Router = __dependency21__["default"];
- var HashLocation = __dependency22__["default"];
- var HistoryLocation = __dependency23__["default"];
- var AutoLocation = __dependency24__["default"];
- var NoneLocation = __dependency25__["default"];
- var BucketCache = __dependency26__["default"];
-
- // this is technically incorrect (per @wycats)
- // it should work properly with:
- // `import ContainerDebugAdapter from 'ember-extension-support/container_debug_adapter';` but
- // es6-module-transpiler 0.4.0 eagerly grabs the module (which is undefined)
-
- var ContainerDebugAdapter = __dependency27__["default"];
-
- var K = __dependency28__.K;
-
- function props(obj) {
- var properties = [];
-
- for (var key in obj) {
- properties.push(key);
- }
-
- return properties;
- }
-
- var librariesRegistered = false;
-
- /**
- An instance of `Ember.Application` is the starting point for every Ember
- application. It helps to instantiate, initialize and coordinate the many
- objects that make up your app.
-
- Each Ember app has one and only one `Ember.Application` object. In fact, the
- very first thing you should do in your application is create the instance:
-
- ```javascript
- window.App = Ember.Application.create();
- ```
-
- Typically, the application object is the only global variable. All other
- classes in your app should be properties on the `Ember.Application` instance,
- which highlights its first role: a global namespace.
-
- For example, if you define a view class, it might look like this:
-
- ```javascript
- App.MyView = Ember.View.extend();
- ```
-
- By default, calling `Ember.Application.create()` will automatically initialize
- your application by calling the `Ember.Application.initialize()` method. If
- you need to delay initialization, you can call your app's `deferReadiness()`
- method. When you are ready for your app to be initialized, call its
- `advanceReadiness()` method.
-
- You can define a `ready` method on the `Ember.Application` instance, which
- will be run by Ember when the application is initialized.
-
- Because `Ember.Application` inherits from `Ember.Namespace`, any classes
- you create will have useful string representations when calling `toString()`.
- See the `Ember.Namespace` documentation for more information.
-
- While you can think of your `Ember.Application` as a container that holds the
- other classes in your application, there are several other responsibilities
- going on under-the-hood that you may want to understand.
-
- ### Event Delegation
-
- Ember uses a technique called _event delegation_. This allows the framework
- to set up a global, shared event listener instead of requiring each view to
- do it manually. For example, instead of each view registering its own
- `mousedown` listener on its associated element, Ember sets up a `mousedown`
- listener on the `body`.
-
- If a `mousedown` event occurs, Ember will look at the target of the event and
- start walking up the DOM node tree, finding corresponding views and invoking
- their `mouseDown` method as it goes.
-
- `Ember.Application` has a number of default events that it listens for, as
- well as a mapping from lowercase events to camel-cased view method names. For
- example, the `keypress` event causes the `keyPress` method on the view to be
- called, the `dblclick` event causes `doubleClick` to be called, and so on.
-
- If there is a bubbling browser event that Ember does not listen for by
- default, you can specify custom events and their corresponding view method
- names by setting the application's `customEvents` property:
-
- ```javascript
- var App = Ember.Application.create({
- customEvents: {
- // add support for the paste event
- paste: 'paste'
- }
- });
- ```
-
- By default, the application sets up these event listeners on the document
- body. However, in cases where you are embedding an Ember application inside
- an existing page, you may want it to set up the listeners on an element
- inside the body.
-
- For example, if only events inside a DOM element with the ID of `ember-app`
- should be delegated, set your application's `rootElement` property:
-
- ```javascript
- var App = Ember.Application.create({
- rootElement: '#ember-app'
- });
- ```
-
- The `rootElement` can be either a DOM element or a jQuery-compatible selector
- string. Note that *views appended to the DOM outside the root element will
- not receive events.* If you specify a custom root element, make sure you only
- append views inside it!
-
- To learn more about the advantages of event delegation and the Ember view
- layer, and a list of the event listeners that are setup by default, visit the
- [Ember View Layer guide](http://emberjs.com/guides/understanding-ember/the-view-layer/#toc_event-delegation).
-
- ### Initializers
-
- Libraries on top of Ember can add initializers, like so:
-
- ```javascript
- Ember.Application.initializer({
- name: 'api-adapter',
-
- initialize: function(container, application) {
- application.register('api-adapter:main', ApiAdapter);
- }
- });
- ```
-
- Initializers provide an opportunity to access the container, which
- organizes the different components of an Ember application. Additionally
- they provide a chance to access the instantiated application. Beyond
- being used for libraries, initializers are also a great way to organize
- dependency injection or setup in your own application.
-
- ### Routing
-
- In addition to creating your application's router, `Ember.Application` is
- also responsible for telling the router when to start routing. Transitions
- between routes can be logged with the `LOG_TRANSITIONS` flag, and more
- detailed intra-transition logging can be logged with
- the `LOG_TRANSITIONS_INTERNAL` flag:
-
- ```javascript
- var App = Ember.Application.create({
- LOG_TRANSITIONS: true, // basic logging of successful transitions
- LOG_TRANSITIONS_INTERNAL: true // detailed logging of all routing steps
- });
- ```
-
- By default, the router will begin trying to translate the current URL into
- application state once the browser emits the `DOMContentReady` event. If you
- need to defer routing, you can call the application's `deferReadiness()`
- method. Once routing can begin, call the `advanceReadiness()` method.
-
- If there is any setup required before routing begins, you can implement a
- `ready()` method on your app that will be invoked immediately before routing
- begins.
-
- @class Application
- @namespace Ember
- @extends Ember.Namespace
- */
-
- var Application = Namespace.extend(DeferredMixin, {
- _suppressDeferredDeprecation: true,
-
- /**
- The root DOM element of the Application. This can be specified as an
- element or a
- [jQuery-compatible selector string](http://api.jquery.com/category/selectors/).
-
- This is the element that will be passed to the Application's,
- `eventDispatcher`, which sets up the listeners for event delegation. Every
- view in your application should be a child of the element you specify here.
-
- @property rootElement
- @type DOMElement
- @default 'body'
- */
- rootElement: 'body',
-
- /**
- The `Ember.EventDispatcher` responsible for delegating events to this
- application's views.
-
- The event dispatcher is created by the application at initialization time
- and sets up event listeners on the DOM element described by the
- application's `rootElement` property.
-
- See the documentation for `Ember.EventDispatcher` for more information.
-
- @property eventDispatcher
- @type Ember.EventDispatcher
- @default null
- */
- eventDispatcher: null,
-
- /**
- The DOM events for which the event dispatcher should listen.
-
- By default, the application's `Ember.EventDispatcher` listens
- for a set of standard DOM events, such as `mousedown` and
- `keyup`, and delegates them to your application's `Ember.View`
- instances.
-
- If you would like additional bubbling events to be delegated to your
- views, set your `Ember.Application`'s `customEvents` property
- to a hash containing the DOM event name as the key and the
- corresponding view method name as the value. For example:
-
- ```javascript
- var App = Ember.Application.create({
- customEvents: {
- // add support for the paste event
- paste: 'paste'
- }
- });
- ```
-
- @property customEvents
- @type Object
- @default null
- */
- customEvents: null,
-
- init: function() {
- // Start off the number of deferrals at 1. This will be
- // decremented by the Application's own `initialize` method.
- this._readinessDeferrals = 1;
-
- if (!this.$) {
- this.$ = jQuery;
- }
- this.__container__ = this.buildContainer();
-
- this.Router = this.defaultRouter();
-
- this._super();
-
- this.scheduleInitialize();
-
- if (!librariesRegistered) {
- librariesRegistered = true;
- Ember.libraries.registerCoreLibrary('jQuery', jQuery().jquery);
- }
-
- if (Ember.LOG_VERSION) {
- // we only need to see this once per Application#init
- Ember.LOG_VERSION = false;
- var libs = Ember.libraries._registry;
-
- var nameLengths = EnumerableUtils.map(libs, function(item) {
- return get(item, 'name.length');
- });
-
- var maxNameLength = Math.max.apply(this, nameLengths);
-
- Ember.debug('-------------------------------');
- for (var i = 0, l = libs.length; i < l; i++) {
- var lib = libs[i];
- var spaces = new Array(maxNameLength - lib.name.length + 1).join(' ');
- Ember.debug([lib.name, spaces, ' : ', lib.version].join(''));
- }
- Ember.debug('-------------------------------');
- }
- },
-
- /**
- Build the container for the current application.
-
- Also register a default application view in case the application
- itself does not.
-
- @private
- @method buildContainer
- @return {Ember.Container} the configured container
- */
- buildContainer: function() {
- var container = this.__container__ = Application.buildContainer(this);
-
- return container;
- },
-
- /**
- If the application has not opted out of routing and has not explicitly
- defined a router, supply a default router for the application author
- to configure.
-
- This allows application developers to do:
-
- ```javascript
- var App = Ember.Application.create();
-
- App.Router.map(function() {
- this.resource('posts');
- });
- ```
-
- @private
- @method defaultRouter
- @return {Ember.Router} the default router
- */
-
- defaultRouter: function() {
- if (this.Router === false) { return; }
- var container = this.__container__;
-
- if (this.Router) {
- container.unregister('router:main');
- container.register('router:main', this.Router);
- }
-
- return container.lookupFactory('router:main');
- },
-
- /**
- Automatically initialize the application once the DOM has
- become ready.
-
- The initialization itself is scheduled on the actions queue
- which ensures that application loading finishes before
- booting.
-
- If you are asynchronously loading code, you should call
- `deferReadiness()` to defer booting, and then call
- `advanceReadiness()` once all of your code has finished
- loading.
-
- @private
- @method scheduleInitialize
- */
- scheduleInitialize: function() {
- if (!this.$ || this.$.isReady) {
- run.schedule('actions', this, '_initialize');
- } else {
- this.$().ready(Ember.run.bind(this, '_initialize'));
- }
- },
-
- /**
- Use this to defer readiness until some condition is true.
-
- Example:
-
- ```javascript
- var App = Ember.Application.create();
-
- App.deferReadiness();
- // Ember.$ is a reference to the jQuery object/function
- Ember.$.getJSON('/auth-token', function(token) {
- App.token = token;
- App.advanceReadiness();
- });
- ```
-
- This allows you to perform asynchronous setup logic and defer
- booting your application until the setup has finished.
-
- However, if the setup requires a loading UI, it might be better
- to use the router for this purpose.
-
- @method deferReadiness
- */
- deferReadiness: function() {
- Ember.assert("You must call deferReadiness on an instance of Ember.Application", this instanceof Application);
- Ember.assert("You cannot defer readiness since the `ready()` hook has already been called.", this._readinessDeferrals > 0);
- this._readinessDeferrals++;
- },
-
- /**
- Call `advanceReadiness` after any asynchronous setup logic has completed.
- Each call to `deferReadiness` must be matched by a call to `advanceReadiness`
- or the application will never become ready and routing will not begin.
-
- @method advanceReadiness
- @see {Ember.Application#deferReadiness}
- */
- advanceReadiness: function() {
- Ember.assert("You must call advanceReadiness on an instance of Ember.Application", this instanceof Application);
- this._readinessDeferrals--;
-
- if (this._readinessDeferrals === 0) {
- run.once(this, this.didBecomeReady);
- }
- },
-
- /**
- Registers a factory that can be used for dependency injection (with
- `App.inject`) or for service lookup. Each factory is registered with
- a full name including two parts: `type:name`.
-
- A simple example:
-
- ```javascript
- var App = Ember.Application.create();
-
- App.Orange = Ember.Object.extend();
- App.register('fruit:favorite', App.Orange);
- ```
-
- Ember will resolve factories from the `App` namespace automatically.
- For example `App.CarsController` will be discovered and returned if
- an application requests `controller:cars`.
-
- An example of registering a controller with a non-standard name:
-
- ```javascript
- var App = Ember.Application.create();
- var Session = Ember.Controller.extend();
-
- App.register('controller:session', Session);
-
- // The Session controller can now be treated like a normal controller,
- // despite its non-standard name.
- App.ApplicationController = Ember.Controller.extend({
- needs: ['session']
- });
- ```
-
- Registered factories are **instantiated** by having `create`
- called on them. Additionally they are **singletons**, each time
- they are looked up they return the same instance.
-
- Some examples modifying that default behavior:
-
- ```javascript
- var App = Ember.Application.create();
-
- App.Person = Ember.Object.extend();
- App.Orange = Ember.Object.extend();
- App.Email = Ember.Object.extend();
- App.session = Ember.Object.create();
-
- App.register('model:user', App.Person, { singleton: false });
- App.register('fruit:favorite', App.Orange);
- App.register('communication:main', App.Email, { singleton: false });
- App.register('session', App.session, { instantiate: false });
- ```
-
- @method register
- @param fullName {String} type:name (e.g., 'model:user')
- @param factory {Function} (e.g., App.Person)
- @param options {Object} (optional) disable instantiation or singleton usage
- **/
- register: function() {
- var container = this.__container__;
- container.register.apply(container, arguments);
- },
-
- /**
- Define a dependency injection onto a specific factory or all factories
- of a type.
-
- When Ember instantiates a controller, view, or other framework component
- it can attach a dependency to that component. This is often used to
- provide services to a set of framework components.
-
- An example of providing a session object to all controllers:
-
- ```javascript
- var App = Ember.Application.create();
- var Session = Ember.Object.extend({ isAuthenticated: false });
-
- // A factory must be registered before it can be injected
- App.register('session:main', Session);
-
- // Inject 'session:main' onto all factories of the type 'controller'
- // with the name 'session'
- App.inject('controller', 'session', 'session:main');
-
- App.IndexController = Ember.Controller.extend({
- isLoggedIn: Ember.computed.alias('session.isAuthenticated')
- });
- ```
-
- Injections can also be performed on specific factories.
-
- ```javascript
- App.inject(, , )
- App.inject('route', 'source', 'source:main')
- App.inject('route:application', 'email', 'model:email')
- ```
-
- It is important to note that injections can only be performed on
- classes that are instantiated by Ember itself. Instantiating a class
- directly (via `create` or `new`) bypasses the dependency injection
- system.
-
- **Note:** Ember-Data instantiates its models in a unique manner, and consequently
- injections onto models (or all models) will not work as expected. Injections
- on models can be enabled by setting `Ember.MODEL_FACTORY_INJECTIONS`
- to `true`.
-
- @method inject
- @param factoryNameOrType {String}
- @param property {String}
- @param injectionName {String}
- **/
- inject: function() {
- var container = this.__container__;
- container.injection.apply(container, arguments);
- },
-
- /**
- Calling initialize manually is not supported.
-
- Please see Ember.Application#advanceReadiness and
- Ember.Application#deferReadiness.
-
- @private
- @deprecated
- @method initialize
- **/
- initialize: function() {
- Ember.deprecate('Calling initialize manually is not supported. Please see Ember.Application#advanceReadiness and Ember.Application#deferReadiness');
- },
-
- /**
- Initialize the application. This happens automatically.
-
- Run any initializers and run the application load hook. These hooks may
- choose to defer readiness. For example, an authentication hook might want
- to defer readiness until the auth token has been retrieved.
-
- @private
- @method _initialize
- */
- _initialize: function() {
- if (this.isDestroyed) { return; }
-
- // At this point, the App.Router must already be assigned
- if (this.Router) {
- var container = this.__container__;
- container.unregister('router:main');
- container.register('router:main', this.Router);
- }
-
- this.runInitializers();
- runLoadHooks('application', this);
-
- // At this point, any initializers or load hooks that would have wanted
- // to defer readiness have fired. In general, advancing readiness here
- // will proceed to didBecomeReady.
- this.advanceReadiness();
-
- return this;
- },
-
- /**
- Reset the application. This is typically used only in tests. It cleans up
- the application in the following order:
-
- 1. Deactivate existing routes
- 2. Destroy all objects in the container
- 3. Create a new application container
- 4. Re-route to the existing url
-
- Typical Example:
-
- ```javascript
- var App;
-
- run(function() {
- App = Ember.Application.create();
- });
-
- module('acceptance test', {
- setup: function() {
- App.reset();
- }
- });
-
- test('first test', function() {
- // App is freshly reset
- });
-
- test('second test', function() {
- // App is again freshly reset
- });
- ```
-
- Advanced Example:
-
- Occasionally you may want to prevent the app from initializing during
- setup. This could enable extra configuration, or enable asserting prior
- to the app becoming ready.
-
- ```javascript
- var App;
-
- run(function() {
- App = Ember.Application.create();
- });
-
- module('acceptance test', {
- setup: function() {
- run(function() {
- App.reset();
- App.deferReadiness();
- });
- }
- });
-
- test('first test', function() {
- ok(true, 'something before app is initialized');
-
- run(function() {
- App.advanceReadiness();
- });
-
- ok(true, 'something after app is initialized');
- });
- ```
-
- @method reset
- **/
- reset: function() {
- this._readinessDeferrals = 1;
-
- function handleReset() {
- var router = this.__container__.lookup('router:main');
- router.reset();
-
- run(this.__container__, 'destroy');
-
- this.buildContainer();
-
- run.schedule('actions', this, '_initialize');
- }
-
- run.join(this, handleReset);
- },
-
- /**
- @private
- @method runInitializers
- */
- runInitializers: function() {
- var initializersByName = get(this.constructor, 'initializers');
- var initializers = props(initializersByName);
- var container = this.__container__;
- var graph = new DAG();
- var namespace = this;
- var initializer;
-
- for (var i = 0; i < initializers.length; i++) {
- initializer = initializersByName[initializers[i]];
- graph.addEdges(initializer.name, initializer.initialize, initializer.before, initializer.after);
- }
-
- graph.topsort(function (vertex) {
- var initializer = vertex.value;
- Ember.assert("No application initializer named '" + vertex.name + "'", !!initializer);
- initializer(container, namespace);
- });
- },
-
- /**
- @private
- @method didBecomeReady
- */
- didBecomeReady: function() {
- this.setupEventDispatcher();
- this.ready(); // user hook
- this.startRouting();
-
- if (!Ember.testing) {
- // Eagerly name all classes that are already loaded
- Ember.Namespace.processAll();
- Ember.BOOTED = true;
- }
-
- this.resolve(this);
- },
-
- /**
- Setup up the event dispatcher to receive events on the
- application's `rootElement` with any registered
- `customEvents`.
-
- @private
- @method setupEventDispatcher
- */
- setupEventDispatcher: function() {
- var customEvents = get(this, 'customEvents');
- var rootElement = get(this, 'rootElement');
- var dispatcher = this.__container__.lookup('event_dispatcher:main');
-
- set(this, 'eventDispatcher', dispatcher);
- dispatcher.setup(customEvents, rootElement);
- },
-
- /**
- If the application has a router, use it to route to the current URL, and
- trigger a new call to `route` whenever the URL changes.
-
- @private
- @method startRouting
- @property router {Ember.Router}
- */
- startRouting: function() {
- var router = this.__container__.lookup('router:main');
- if (!router) { return; }
-
- router.startRouting();
- },
-
- handleURL: function(url) {
- var router = this.__container__.lookup('router:main');
-
- router.handleURL(url);
- },
-
- /**
- Called when the Application has become ready.
- The call will be delayed until the DOM has become ready.
-
- @event ready
- */
- ready: K,
-
- /**
- @deprecated Use 'Resolver' instead
- Set this to provide an alternate class to `Ember.DefaultResolver`
-
-
- @property resolver
- */
- resolver: null,
-
- /**
- Set this to provide an alternate class to `Ember.DefaultResolver`
-
- @property resolver
- */
- Resolver: null,
-
- willDestroy: function() {
- Ember.BOOTED = false;
- // Ensure deactivation of routes before objects are destroyed
- this.__container__.lookup('router:main').reset();
-
- this.__container__.destroy();
- },
-
- initializer: function(options) {
- this.constructor.initializer(options);
- },
-
- /**
- @method then
- @private
- @deprecated
- */
- then: function() {
- Ember.deprecate('Do not use `.then` on an instance of Ember.Application. Please use the `.ready` hook instead.', false, { url: 'http://emberjs.com/guides/deprecations/#toc_deprecate-code-then-code-on-ember-application' });
-
- this._super.apply(this, arguments);
- }
- });
-
- Application.reopenClass({
- initializers: create(null),
-
- /**
- Initializer receives an object which has the following attributes:
- `name`, `before`, `after`, `initialize`. The only required attribute is
- `initialize, all others are optional.
-
- * `name` allows you to specify under which name the initializer is registered.
- This must be a unique name, as trying to register two initializers with the
- same name will result in an error.
-
- ```javascript
- Ember.Application.initializer({
- name: 'namedInitializer',
-
- initialize: function(container, application) {
- Ember.debug('Running namedInitializer!');
- }
- });
- ```
-
- * `before` and `after` are used to ensure that this initializer is ran prior
- or after the one identified by the value. This value can be a single string
- or an array of strings, referencing the `name` of other initializers.
-
- An example of ordering initializers, we create an initializer named `first`:
-
- ```javascript
- Ember.Application.initializer({
- name: 'first',
-
- initialize: function(container, application) {
- Ember.debug('First initializer!');
- }
- });
-
- // DEBUG: First initializer!
- ```
-
- We add another initializer named `second`, specifying that it should run
- after the initializer named `first`:
-
- ```javascript
- Ember.Application.initializer({
- name: 'second',
- after: 'first',
-
- initialize: function(container, application) {
- Ember.debug('Second initializer!');
- }
- });
-
- // DEBUG: First initializer!
- // DEBUG: Second initializer!
- ```
-
- Afterwards we add a further initializer named `pre`, this time specifying
- that it should run before the initializer named `first`:
-
- ```javascript
- Ember.Application.initializer({
- name: 'pre',
- before: 'first',
-
- initialize: function(container, application) {
- Ember.debug('Pre initializer!');
- }
- });
-
- // DEBUG: Pre initializer!
- // DEBUG: First initializer!
- // DEBUG: Second initializer!
- ```
-
- Finally we add an initializer named `post`, specifying it should run after
- both the `first` and the `second` initializers:
-
- ```javascript
- Ember.Application.initializer({
- name: 'post',
- after: ['first', 'second'],
-
- initialize: function(container, application) {
- Ember.debug('Post initializer!');
- }
- });
-
- // DEBUG: Pre initializer!
- // DEBUG: First initializer!
- // DEBUG: Second initializer!
- // DEBUG: Post initializer!
- ```
-
- * `initialize` is a callback function that receives two arguments, `container`
- and `application` on which you can operate.
-
- Example of using `container` to preload data into the store:
-
- ```javascript
- Ember.Application.initializer({
- name: 'preload-data',
-
- initialize: function(container, application) {
- var store = container.lookup('store:main');
-
- store.pushPayload(preloadedData);
- }
- });
- ```
-
- Example of using `application` to register an adapter:
-
- ```javascript
- Ember.Application.initializer({
- name: 'api-adapter',
-
- initialize: function(container, application) {
- application.register('api-adapter:main', ApiAdapter);
- }
- });
- ```
-
- @method initializer
- @param initializer {Object}
- */
- initializer: function(initializer) {
- // If this is the first initializer being added to a subclass, we are going to reopen the class
- // to make sure we have a new `initializers` object, which extends from the parent class' using
- // prototypal inheritance. Without this, attempting to add initializers to the subclass would
- // pollute the parent class as well as other subclasses.
- if (this.superclass.initializers !== undefined && this.superclass.initializers === this.initializers) {
- this.reopenClass({
- initializers: create(this.initializers)
- });
- }
-
- Ember.assert("The initializer '" + initializer.name + "' has already been registered", !this.initializers[initializer.name]);
- Ember.assert("An initializer cannot be registered without an initialize function", canInvoke(initializer, 'initialize'));
- Ember.assert("An initializer cannot be registered without a name property", initializer.name !== undefined);
-
- this.initializers[initializer.name] = initializer;
- },
-
- /**
- This creates a container with the default Ember naming conventions.
-
- It also configures the container:
-
- * registered views are created every time they are looked up (they are
- not singletons)
- * registered templates are not factories; the registered value is
- returned directly.
- * the router receives the application as its `namespace` property
- * all controllers receive the router as their `target` and `controllers`
- properties
- * all controllers receive the application as their `namespace` property
- * the application view receives the application controller as its
- `controller` property
- * the application view receives the application template as its
- `defaultTemplate` property
-
- @private
- @method buildContainer
- @static
- @param {Ember.Application} namespace the application to build the
- container for.
- @return {Ember.Container} the built container
- */
- buildContainer: function(namespace) {
- var container = new Container();
-
- container.set = set;
- container.resolver = resolverFor(namespace);
- container.normalizeFullName = container.resolver.normalize;
- container.describe = container.resolver.describe;
- container.makeToString = container.resolver.makeToString;
-
- container.optionsForType('component', { singleton: false });
- container.optionsForType('view', { singleton: false });
- container.optionsForType('template', { instantiate: false });
- container.optionsForType('helper', { instantiate: false });
-
- container.register('application:main', namespace, { instantiate: false });
-
- container.register('controller:basic', Controller, { instantiate: false });
- container.register('controller:object', ObjectController, { instantiate: false });
- container.register('controller:array', ArrayController, { instantiate: false });
-
- container.register('view:select', SelectView);
-
- container.register('route:basic', Route, { instantiate: false });
- container.register('event_dispatcher:main', EventDispatcher);
-
- container.register('router:main', Router);
- container.injection('router:main', 'namespace', 'application:main');
-
- container.register('location:auto', AutoLocation);
- container.register('location:hash', HashLocation);
- container.register('location:history', HistoryLocation);
- container.register('location:none', NoneLocation);
-
- container.injection('controller', 'target', 'router:main');
- container.injection('controller', 'namespace', 'application:main');
-
- container.register('-bucket-cache:main', BucketCache);
- container.injection('router', '_bucketCache', '-bucket-cache:main');
- container.injection('route', '_bucketCache', '-bucket-cache:main');
- container.injection('controller', '_bucketCache', '-bucket-cache:main');
-
- container.injection('route', 'router', 'router:main');
- container.injection('location', 'rootURL', '-location-setting:root-url');
-
- // DEBUGGING
- container.register('resolver-for-debugging:main', container.resolver.__resolver__, { instantiate: false });
- container.injection('container-debug-adapter:main', 'resolver', 'resolver-for-debugging:main');
- container.injection('data-adapter:main', 'containerDebugAdapter', 'container-debug-adapter:main');
- // Custom resolver authors may want to register their own ContainerDebugAdapter with this key
-
- container.register('container-debug-adapter:main', ContainerDebugAdapter);
-
- return container;
- }
- });
-
- /**
- This function defines the default lookup rules for container lookups:
-
- * templates are looked up on `Ember.TEMPLATES`
- * other names are looked up on the application after classifying the name.
- For example, `controller:post` looks up `App.PostController` by default.
- * if the default lookup fails, look for registered classes on the container
-
- This allows the application to register default injections in the container
- that could be overridden by the normal naming convention.
-
- @private
- @method resolverFor
- @param {Ember.Namespace} namespace the namespace to look for classes
- @return {*} the resolved value for a given lookup
- */
- function resolverFor(namespace) {
- Ember.deprecate('Application.resolver is deprecated in favor of Application.Resolver', !namespace.get('resolver'));
-
- var ResolverClass = namespace.get('resolver') || namespace.get('Resolver') || DefaultResolver;
- var resolver = ResolverClass.create({
- namespace: namespace
- });
-
- function resolve(fullName) {
- return resolver.resolve(fullName);
- }
-
- resolve.describe = function(fullName) {
- return resolver.lookupDescription(fullName);
- };
-
- resolve.makeToString = function(factory, fullName) {
- return resolver.makeToString(factory, fullName);
- };
-
- resolve.normalize = function(fullName) {
- if (resolver.normalize) {
- return resolver.normalize(fullName);
- } else {
- Ember.deprecate('The Resolver should now provide a \'normalize\' function', false);
- return fullName;
- }
- };
-
- resolve.__resolver__ = resolver;
-
- return resolve;
- }
-
- __exports__["default"] = Application;
- });
-enifed("ember-application/system/resolver",
- ["ember-metal/core","ember-metal/property_get","ember-metal/logger","ember-runtime/system/string","ember-runtime/system/object","ember-runtime/system/namespace","ember-htmlbars/helpers","ember-metal/dictionary","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {
- "use strict";
- /**
- @module ember
- @submodule ember-application
- */
-
- var Ember = __dependency1__["default"];
- // Ember.TEMPLATES, Ember.assert
- var get = __dependency2__.get;
- var Logger = __dependency3__["default"];
- var classify = __dependency4__.classify;
- var capitalize = __dependency4__.capitalize;
- var decamelize = __dependency4__.decamelize;
- var EmberObject = __dependency5__["default"];
- var Namespace = __dependency6__["default"];
- var helpers = __dependency7__["default"];
-
- var Resolver = EmberObject.extend({
- /**
- This will be set to the Application instance when it is
- created.
-
- @property namespace
- */
- namespace: null,
- normalize: Ember.required(Function),
- resolve: Ember.required(Function),
- parseName: Ember.required(Function),
- lookupDescription: Ember.required(Function),
- makeToString: Ember.required(Function),
- resolveOther: Ember.required(Function),
- _logLookup: Ember.required(Function)
- });
- __exports__.Resolver = Resolver;
- /**
- The DefaultResolver defines the default lookup rules to resolve
- container lookups before consulting the container for registered
- items:
-
- * templates are looked up on `Ember.TEMPLATES`
- * other names are looked up on the application after converting
- the name. For example, `controller:post` looks up
- `App.PostController` by default.
- * there are some nuances (see examples below)
-
- ### How Resolving Works
-
- The container calls this object's `resolve` method with the
- `fullName` argument.
-
- It first parses the fullName into an object using `parseName`.
-
- Then it checks for the presence of a type-specific instance
- method of the form `resolve[Type]` and calls it if it exists.
- For example if it was resolving 'template:post', it would call
- the `resolveTemplate` method.
-
- Its last resort is to call the `resolveOther` method.
-
- The methods of this object are designed to be easy to override
- in a subclass. For example, you could enhance how a template
- is resolved like so:
-
- ```javascript
- App = Ember.Application.create({
- Resolver: Ember.DefaultResolver.extend({
- resolveTemplate: function(parsedName) {
- var resolvedTemplate = this._super(parsedName);
- if (resolvedTemplate) { return resolvedTemplate; }
- return Ember.TEMPLATES['not_found'];
- }
- })
- });
- ```
-
- Some examples of how names are resolved:
-
- ```
- 'template:post' //=> Ember.TEMPLATES['post']
- 'template:posts/byline' //=> Ember.TEMPLATES['posts/byline']
- 'template:posts.byline' //=> Ember.TEMPLATES['posts/byline']
- 'template:blogPost' //=> Ember.TEMPLATES['blogPost']
- // OR
- // Ember.TEMPLATES['blog_post']
- 'controller:post' //=> App.PostController
- 'controller:posts.index' //=> App.PostsIndexController
- 'controller:blog/post' //=> Blog.PostController
- 'controller:basic' //=> Ember.Controller
- 'route:post' //=> App.PostRoute
- 'route:posts.index' //=> App.PostsIndexRoute
- 'route:blog/post' //=> Blog.PostRoute
- 'route:basic' //=> Ember.Route
- 'view:post' //=> App.PostView
- 'view:posts.index' //=> App.PostsIndexView
- 'view:blog/post' //=> Blog.PostView
- 'view:basic' //=> Ember.View
- 'foo:post' //=> App.PostFoo
- 'model:post' //=> App.Post
- ```
-
- @class DefaultResolver
- @namespace Ember
- @extends Ember.Object
- */
- var dictionary = __dependency8__["default"];
-
- __exports__["default"] = EmberObject.extend({
- /**
- This will be set to the Application instance when it is
- created.
-
- @property namespace
- */
- namespace: null,
-
- init: function() {
- this._parseNameCache = dictionary(null);
- },
- normalize: function(fullName) {
- var split = fullName.split(':', 2);
- var type = split[0];
- var name = split[1];
-
- Ember.assert("Tried to normalize a container name without a colon (:) in it." +
- " You probably tried to lookup a name that did not contain a type," +
- " a colon, and a name. A proper lookup name would be `view:post`.", split.length === 2);
-
- if (type !== 'template') {
- var result = name;
-
- if (result.indexOf('.') > -1) {
- result = result.replace(/\.(.)/g, function(m) {
- return m.charAt(1).toUpperCase();
- });
- }
-
- if (name.indexOf('_') > -1) {
- result = result.replace(/_(.)/g, function(m) {
- return m.charAt(1).toUpperCase();
- });
- }
-
- return type + ':' + result;
- } else {
- return fullName;
- }
- },
-
-
- /**
- This method is called via the container's resolver method.
- It parses the provided `fullName` and then looks up and
- returns the appropriate template or class.
-
- @method resolve
- @param {String} fullName the lookup string
- @return {Object} the resolved factory
- */
- resolve: function(fullName) {
- var parsedName = this.parseName(fullName);
- var resolveMethodName = parsedName.resolveMethodName;
- var resolved;
-
- if (!(parsedName.name && parsedName.type)) {
- throw new TypeError('Invalid fullName: `' + fullName + '`, must be of the form `type:name` ');
- }
-
- if (this[resolveMethodName]) {
- resolved = this[resolveMethodName](parsedName);
- }
-
- if (!resolved) {
- resolved = this.resolveOther(parsedName);
- }
-
- if (parsedName.root && parsedName.root.LOG_RESOLVER) {
- this._logLookup(resolved, parsedName);
- }
-
- return resolved;
- },
- /**
- Convert the string name of the form 'type:name' to
- a Javascript object with the parsed aspects of the name
- broken out.
-
- @protected
- @param {String} fullName the lookup string
- @method parseName
- */
-
- parseName: function(fullName) {
- return this._parseNameCache[fullName] || (
- this._parseNameCache[fullName] = this._parseName(fullName)
- );
- },
-
- _parseName: function(fullName) {
- var nameParts = fullName.split(':');
- var type = nameParts[0], fullNameWithoutType = nameParts[1];
- var name = fullNameWithoutType;
- var namespace = get(this, 'namespace');
- var root = namespace;
-
- if (type !== 'template' && name.indexOf('/') !== -1) {
- var parts = name.split('/');
- name = parts[parts.length - 1];
- var namespaceName = capitalize(parts.slice(0, -1).join('.'));
- root = Namespace.byName(namespaceName);
-
- Ember.assert('You are looking for a ' + name + ' ' + type +
- ' in the ' + namespaceName +
- ' namespace, but the namespace could not be found', root);
- }
-
- return {
- fullName: fullName,
- type: type,
- fullNameWithoutType: fullNameWithoutType,
- name: name,
- root: root,
- resolveMethodName: 'resolve' + classify(type)
- };
- },
-
- /**
- Returns a human-readable description for a fullName. Used by the
- Application namespace in assertions to describe the
- precise name of the class that Ember is looking for, rather than
- container keys.
-
- @protected
- @param {String} fullName the lookup string
- @method lookupDescription
- */
- lookupDescription: function(fullName) {
- var parsedName = this.parseName(fullName);
- var description;
-
- if (parsedName.type === 'template') {
- return 'template at ' + parsedName.fullNameWithoutType.replace(/\./g, '/');
- }
-
- description = parsedName.root + '.' + classify(parsedName.name).replace(/\./g, '');
-
- if (parsedName.type !== 'model') {
- description += classify(parsedName.type);
- }
-
- return description;
- },
-
- makeToString: function(factory, fullName) {
- return factory.toString();
- },
- /**
- Given a parseName object (output from `parseName`), apply
- the conventions expected by `Ember.Router`
-
- @protected
- @param {Object} parsedName a parseName object with the parsed
- fullName lookup string
- @method useRouterNaming
- */
- useRouterNaming: function(parsedName) {
- parsedName.name = parsedName.name.replace(/\./g, '_');
- if (parsedName.name === 'basic') {
- parsedName.name = '';
- }
- },
- /**
- Look up the template in Ember.TEMPLATES
-
- @protected
- @param {Object} parsedName a parseName object with the parsed
- fullName lookup string
- @method resolveTemplate
- */
- resolveTemplate: function(parsedName) {
- var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/');
-
- if (Ember.TEMPLATES[templateName]) {
- return Ember.TEMPLATES[templateName];
- }
-
- templateName = decamelize(templateName);
- if (Ember.TEMPLATES[templateName]) {
- return Ember.TEMPLATES[templateName];
- }
- },
-
- /**
- Lookup the view using `resolveOther`
-
- @protected
- @param {Object} parsedName a parseName object with the parsed
- fullName lookup string
- @method resolveView
- */
- resolveView: function(parsedName) {
- this.useRouterNaming(parsedName);
- return this.resolveOther(parsedName);
- },
-
- /**
- Lookup the controller using `resolveOther`
-
- @protected
- @param {Object} parsedName a parseName object with the parsed
- fullName lookup string
- @method resolveController
- */
- resolveController: function(parsedName) {
- this.useRouterNaming(parsedName);
- return this.resolveOther(parsedName);
- },
- /**
- Lookup the route using `resolveOther`
-
- @protected
- @param {Object} parsedName a parseName object with the parsed
- fullName lookup string
- @method resolveRoute
- */
- resolveRoute: function(parsedName) {
- this.useRouterNaming(parsedName);
- return this.resolveOther(parsedName);
- },
-
- /**
- Lookup the model on the Application namespace
-
- @protected
- @param {Object} parsedName a parseName object with the parsed
- fullName lookup string
- @method resolveModel
- */
- resolveModel: function(parsedName) {
- var className = classify(parsedName.name);
- var factory = get(parsedName.root, className);
-
- if (factory) { return factory; }
- },
- /**
- Look up the specified object (from parsedName) on the appropriate
- namespace (usually on the Application)
-
- @protected
- @param {Object} parsedName a parseName object with the parsed
- fullName lookup string
- @method resolveHelper
- */
- resolveHelper: function(parsedName) {
- return this.resolveOther(parsedName) || helpers[parsedName.fullNameWithoutType];
- },
- /**
- Look up the specified object (from parsedName) on the appropriate
- namespace (usually on the Application)
-
- @protected
- @param {Object} parsedName a parseName object with the parsed
- fullName lookup string
- @method resolveOther
- */
- resolveOther: function(parsedName) {
- var className = classify(parsedName.name) + classify(parsedName.type);
- var factory = get(parsedName.root, className);
- if (factory) { return factory; }
- },
-
- /**
- @method _logLookup
- @param {Boolean} found
- @param {Object} parsedName
- @private
- */
- _logLookup: function(found, parsedName) {
- var symbol, padding;
-
- if (found) { symbol = '[✓]'; }
- else { symbol = '[ ]'; }
-
- if (parsedName.fullName.length > 60) {
- padding = '.';
- } else {
- padding = new Array(60 - parsedName.fullName.length).join('.');
- }
-
- Logger.info(symbol, parsedName.fullName, padding, this.lookupDescription(parsedName.fullName));
- }
- });
- });
-enifed("ember-debug",
- ["ember-metal/core","ember-metal/error","ember-metal/logger","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __exports__) {
- "use strict";
- /*global __fail__*/
-
- var Ember = __dependency1__["default"];
- var EmberError = __dependency2__["default"];
- var Logger = __dependency3__["default"];
-
- /**
- Ember Debug
-
- @module ember
- @submodule ember-debug
- */
-
- /**
- @class Ember
- */
-
- /**
- Define an assertion that will throw an exception if the condition is not
- met. Ember build tools will remove any calls to `Ember.assert()` when
- doing a production build. Example:
-
- ```javascript
- // Test for truthiness
- Ember.assert('Must pass a valid object', obj);
-
- // Fail unconditionally
- Ember.assert('This code path should never be run');
- ```
-
- @method assert
- @param {String} desc A description of the assertion. This will become
- the text of the Error thrown if the assertion fails.
- @param {Boolean} test Must be truthy for the assertion to pass. If
- falsy, an exception will be thrown.
- */
- Ember.assert = function(desc, test) {
- var throwAssertion;
-
- if (Ember.typeOf(test) === 'function') {
- throwAssertion = !test();
- } else {
- throwAssertion = !test;
- }
-
- if (throwAssertion) {
- throw new EmberError("Assertion Failed: " + desc);
- }
- };
-
-
- /**
- Display a warning with the provided message. Ember build tools will
- remove any calls to `Ember.warn()` when doing a production build.
-
- @method warn
- @param {String} message A warning to display.
- @param {Boolean} test An optional boolean. If falsy, the warning
- will be displayed.
- */
- Ember.warn = function(message, test) {
- if (!test) {
- Logger.warn("WARNING: "+message);
- if ('trace' in Logger) {
- Logger.trace();
- }
- }
- };
-
- /**
- Display a debug notice. Ember build tools will remove any calls to
- `Ember.debug()` when doing a production build.
-
- ```javascript
- Ember.debug('I\'m a debug notice!');
- ```
-
- @method debug
- @param {String} message A debug message to display.
- */
- Ember.debug = function(message) {
- Logger.debug("DEBUG: "+message);
- };
-
- /**
- Display a deprecation warning with the provided message and a stack trace
- (Chrome and Firefox only). Ember build tools will remove any calls to
- `Ember.deprecate()` when doing a production build.
-
- @method deprecate
- @param {String} message A description of the deprecation.
- @param {Boolean} test An optional boolean. If falsy, the deprecation
- will be displayed.
- @param {Object} options An optional object that can be used to pass
- in a `url` to the transition guide on the emberjs.com website.
- */
- Ember.deprecate = function(message, test, options) {
- var noDeprecation;
-
- if (typeof test === 'function') {
- noDeprecation = test();
- } else {
- noDeprecation = test;
- }
-
- if (noDeprecation) { return; }
-
- if (Ember.ENV.RAISE_ON_DEPRECATION) { throw new EmberError(message); }
-
- var error;
-
- // When using new Error, we can't do the arguments check for Chrome. Alternatives are welcome
- try { __fail__.fail(); } catch (e) { error = e; }
-
- if (arguments.length === 3) {
- Ember.assert('options argument to Ember.deprecate should be an object', options && typeof options === 'object');
- if (options.url) {
- message += ' See ' + options.url + ' for more details.';
- }
- }
-
- if (Ember.LOG_STACKTRACE_ON_DEPRECATION && error.stack) {
- var stack;
- var stackStr = '';
-
- if (error['arguments']) {
- // Chrome
- stack = error.stack.replace(/^\s+at\s+/gm, '').
- replace(/^([^\(]+?)([\n$])/gm, '{anonymous}($1)$2').
- replace(/^Object.\s*\(([^\)]+)\)/gm, '{anonymous}($1)').split('\n');
- stack.shift();
- } else {
- // Firefox
- stack = error.stack.replace(/(?:\n@:0)?\s+$/m, '').
- replace(/^\(/gm, '{anonymous}(').split('\n');
- }
-
- stackStr = "\n " + stack.slice(2).join("\n ");
- message = message + stackStr;
- }
-
- Logger.warn("DEPRECATION: "+message);
- };
-
-
-
- /**
- Alias an old, deprecated method with its new counterpart.
-
- Display a deprecation warning with the provided message and a stack trace
- (Chrome and Firefox only) when the assigned method is called.
-
- Ember build tools will not remove calls to `Ember.deprecateFunc()`, though
- no warnings will be shown in production.
-
- ```javascript
- Ember.oldMethod = Ember.deprecateFunc('Please use the new, updated method', Ember.newMethod);
- ```
-
- @method deprecateFunc
- @param {String} message A description of the deprecation.
- @param {Function} func The new function called to replace its deprecated counterpart.
- @return {Function} a new function that wrapped the original function with a deprecation warning
- */
- Ember.deprecateFunc = function(message, func) {
- return function() {
- Ember.deprecate(message);
- return func.apply(this, arguments);
- };
- };
-
-
- /**
- Run a function meant for debugging. Ember build tools will remove any calls to
- `Ember.runInDebug()` when doing a production build.
-
- ```javascript
- Ember.runInDebug(function() {
- Ember.Handlebars.EachView.reopen({
- didInsertElement: function() {
- console.log('I\'m happy');
- }
- });
- });
- ```
-
- @method runInDebug
- @param {Function} func The function to be executed.
- @since 1.5.0
- */
- Ember.runInDebug = function(func) {
- func();
- };
-
- /**
- Will call `Ember.warn()` if ENABLE_ALL_FEATURES, ENABLE_OPTIONAL_FEATURES, or
- any specific FEATURES flag is truthy.
-
- This method is called automatically in debug canary builds.
-
- @private
- @method _warnIfUsingStrippedFeatureFlags
- @return {void}
- */
- function _warnIfUsingStrippedFeatureFlags(FEATURES, featuresWereStripped) {
- if (featuresWereStripped) {
- Ember.warn('Ember.ENV.ENABLE_ALL_FEATURES is only available in canary builds.', !Ember.ENV.ENABLE_ALL_FEATURES);
- Ember.warn('Ember.ENV.ENABLE_OPTIONAL_FEATURES is only available in canary builds.', !Ember.ENV.ENABLE_OPTIONAL_FEATURES);
-
- for (var key in FEATURES) {
- if (FEATURES.hasOwnProperty(key) && key !== 'isEnabled') {
- Ember.warn('FEATURE["' + key + '"] is set as enabled, but FEATURE flags are only available in canary builds.', !FEATURES[key]);
- }
- }
- }
- }
-
- __exports__._warnIfUsingStrippedFeatureFlags = _warnIfUsingStrippedFeatureFlags;if (!Ember.testing) {
- // Complain if they're using FEATURE flags in builds other than canary
- Ember.FEATURES['features-stripped-test'] = true;
- var featuresWereStripped = true;
-
-
- delete Ember.FEATURES['features-stripped-test'];
- _warnIfUsingStrippedFeatureFlags(Ember.ENV.FEATURES, featuresWereStripped);
-
- // Inform the developer about the Ember Inspector if not installed.
- var isFirefox = typeof InstallTrigger !== 'undefined';
- var isChrome = !!window.chrome && !window.opera;
-
- if (typeof window !== 'undefined' && (isFirefox || isChrome) && window.addEventListener) {
- window.addEventListener("load", function() {
- if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset.emberExtension) {
- var downloadURL;
-
- if(isChrome) {
- downloadURL = 'https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi';
- } else if(isFirefox) {
- downloadURL = 'https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/';
- }
-
- Ember.debug('For more advanced debugging, install the Ember Inspector from ' + downloadURL);
- }
- }, false);
- }
- }
-
- /*
- We are transitioning away from `ember.js` to `ember.debug.js` to make
- it much clearer that it is only for local development purposes.
-
- This flag value is changed by the tooling (by a simple string replacement)
- so that if `ember.js` (which must be output for backwards compat reasons) is
- used a nice helpful warning message will be printed out.
- */
- var runningNonEmberDebugJS = true;
- __exports__.runningNonEmberDebugJS = runningNonEmberDebugJS;if (runningNonEmberDebugJS) {
- Ember.warn('Please use `ember.debug.js` instead of `ember.js` for development and debugging.');
- }
- });
-enifed("ember-extension-support",
- ["ember-metal/core","ember-extension-support/data_adapter","ember-extension-support/container_debug_adapter"],
- function(__dependency1__, __dependency2__, __dependency3__) {
- "use strict";
- /**
- Ember Extension Support
-
- @module ember
- @submodule ember-extension-support
- @requires ember-application
- */
-
- var Ember = __dependency1__["default"];
- var DataAdapter = __dependency2__["default"];
- var ContainerDebugAdapter = __dependency3__["default"];
-
- Ember.DataAdapter = DataAdapter;
- Ember.ContainerDebugAdapter = ContainerDebugAdapter;
- });
-enifed("ember-extension-support/container_debug_adapter",
- ["ember-metal/core","ember-runtime/system/native_array","ember-metal/utils","ember-runtime/system/string","ember-runtime/system/namespace","ember-runtime/system/object","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {
- "use strict";
- var Ember = __dependency1__["default"];
- var emberA = __dependency2__.A;
- var typeOf = __dependency3__.typeOf;
- var dasherize = __dependency4__.dasherize;
- var classify = __dependency4__.classify;
- var Namespace = __dependency5__["default"];
- var EmberObject = __dependency6__["default"];
-
- /**
- @module ember
- @submodule ember-extension-support
- */
-
- /**
- The `ContainerDebugAdapter` helps the container and resolver interface
- with tools that debug Ember such as the
- [Ember Extension](https://github.com/tildeio/ember-extension)
- for Chrome and Firefox.
-
- This class can be extended by a custom resolver implementer
- to override some of the methods with library-specific code.
-
- The methods likely to be overridden are:
-
- * `canCatalogEntriesByType`
- * `catalogEntriesByType`
-
- The adapter will need to be registered
- in the application's container as `container-debug-adapter:main`
-
- Example:
-
- ```javascript
- Application.initializer({
- name: "containerDebugAdapter",
-
- initialize: function(container, application) {
- application.register('container-debug-adapter:main', require('app/container-debug-adapter'));
- }
- });
- ```
-
- @class ContainerDebugAdapter
- @namespace Ember
- @extends Ember.Object
- @since 1.5.0
- */
- __exports__["default"] = EmberObject.extend({
- /**
- The container of the application being debugged.
- This property will be injected
- on creation.
-
- @property container
- @default null
- */
- container: null,
-
- /**
- The resolver instance of the application
- being debugged. This property will be injected
- on creation.
-
- @property resolver
- @default null
- */
- resolver: null,
-
- /**
- Returns true if it is possible to catalog a list of available
- classes in the resolver for a given type.
-
- @method canCatalogEntriesByType
- @param {String} type The type. e.g. "model", "controller", "route"
- @return {boolean} whether a list is available for this type.
- */
- canCatalogEntriesByType: function(type) {
- if (type === 'model' || type === 'template') return false;
- return true;
- },
-
- /**
- Returns the available classes a given type.
-
- @method catalogEntriesByType
- @param {String} type The type. e.g. "model", "controller", "route"
- @return {Array} An array of strings.
- */
- catalogEntriesByType: function(type) {
- var namespaces = emberA(Namespace.NAMESPACES), types = emberA();
- var typeSuffixRegex = new RegExp(classify(type) + "$");
-
- namespaces.forEach(function(namespace) {
- if (namespace !== Ember) {
- for (var key in namespace) {
- if (!namespace.hasOwnProperty(key)) { continue; }
- if (typeSuffixRegex.test(key)) {
- var klass = namespace[key];
- if (typeOf(klass) === 'class') {
- types.push(dasherize(key.replace(typeSuffixRegex, '')));
- }
- }
- }
- }
- });
- return types;
- }
- });
- });
-enifed("ember-extension-support/data_adapter",
- ["ember-metal/property_get","ember-metal/run_loop","ember-runtime/system/string","ember-runtime/system/namespace","ember-runtime/system/object","ember-runtime/system/native_array","ember-application/system/application","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {
- "use strict";
- var get = __dependency1__.get;
- var run = __dependency2__["default"];
- var dasherize = __dependency3__.dasherize;
- var Namespace = __dependency4__["default"];
- var EmberObject = __dependency5__["default"];
- var emberA = __dependency6__.A;
- var Application = __dependency7__["default"];
-
- /**
- @module ember
- @submodule ember-extension-support
- */
-
- /**
- The `DataAdapter` helps a data persistence library
- interface with tools that debug Ember such
- as the [Ember Extension](https://github.com/tildeio/ember-extension)
- for Chrome and Firefox.
-
- This class will be extended by a persistence library
- which will override some of the methods with
- library-specific code.
-
- The methods likely to be overridden are:
-
- * `getFilters`
- * `detect`
- * `columnsForType`
- * `getRecords`
- * `getRecordColumnValues`
- * `getRecordKeywords`
- * `getRecordFilterValues`
- * `getRecordColor`
- * `observeRecord`
-
- The adapter will need to be registered
- in the application's container as `dataAdapter:main`
-
- Example:
-
- ```javascript
- Application.initializer({
- name: "data-adapter",
-
- initialize: function(container, application) {
- application.register('data-adapter:main', DS.DataAdapter);
- }
- });
- ```
-
- @class DataAdapter
- @namespace Ember
- @extends EmberObject
- */
- __exports__["default"] = EmberObject.extend({
- init: function() {
- this._super();
- this.releaseMethods = emberA();
- },
-
- /**
- The container of the application being debugged.
- This property will be injected
- on creation.
-
- @property container
- @default null
- @since 1.3.0
- */
- container: null,
-
-
- /**
- The container-debug-adapter which is used
- to list all models.
-
- @property containerDebugAdapter
- @default undefined
- @since 1.5.0
- **/
- containerDebugAdapter: undefined,
-
- /**
- Number of attributes to send
- as columns. (Enough to make the record
- identifiable).
-
- @private
- @property attributeLimit
- @default 3
- @since 1.3.0
- */
- attributeLimit: 3,
-
- /**
- Stores all methods that clear observers.
- These methods will be called on destruction.
-
- @private
- @property releaseMethods
- @since 1.3.0
- */
- releaseMethods: emberA(),
-
- /**
- Specifies how records can be filtered.
- Records returned will need to have a `filterValues`
- property with a key for every name in the returned array.
-
- @public
- @method getFilters
- @return {Array} List of objects defining filters.
- The object should have a `name` and `desc` property.
- */
- getFilters: function() {
- return emberA();
- },
-
- /**
- Fetch the model types and observe them for changes.
-
- @public
- @method watchModelTypes
-
- @param {Function} typesAdded Callback to call to add types.
- Takes an array of objects containing wrapped types (returned from `wrapModelType`).
-
- @param {Function} typesUpdated Callback to call when a type has changed.
- Takes an array of objects containing wrapped types.
-
- @return {Function} Method to call to remove all observers
- */
- watchModelTypes: function(typesAdded, typesUpdated) {
- var modelTypes = this.getModelTypes();
- var self = this;
- var releaseMethods = emberA();
- var typesToSend;
-
- typesToSend = modelTypes.map(function(type) {
- var klass = type.klass;
- var wrapped = self.wrapModelType(klass, type.name);
- releaseMethods.push(self.observeModelType(klass, typesUpdated));
- return wrapped;
- });
-
- typesAdded(typesToSend);
-
- var release = function() {
- releaseMethods.forEach(function(fn) { fn(); });
- self.releaseMethods.removeObject(release);
- };
- this.releaseMethods.pushObject(release);
- return release;
- },
-
- _nameToClass: function(type) {
- if (typeof type === 'string') {
- type = this.container.lookupFactory('model:' + type);
- }
- return type;
- },
-
- /**
- Fetch the records of a given type and observe them for changes.
-
- @public
- @method watchRecords
-
- @param {Function} recordsAdded Callback to call to add records.
- Takes an array of objects containing wrapped records.
- The object should have the following properties:
- columnValues: {Object} key and value of a table cell
- object: {Object} the actual record object
-
- @param {Function} recordsUpdated Callback to call when a record has changed.
- Takes an array of objects containing wrapped records.
-
- @param {Function} recordsRemoved Callback to call when a record has removed.
- Takes the following parameters:
- index: the array index where the records were removed
- count: the number of records removed
-
- @return {Function} Method to call to remove all observers
- */
- watchRecords: function(type, recordsAdded, recordsUpdated, recordsRemoved) {
- var self = this, releaseMethods = emberA(), records = this.getRecords(type), release;
-
- var recordUpdated = function(updatedRecord) {
- recordsUpdated([updatedRecord]);
- };
-
- var recordsToSend = records.map(function(record) {
- releaseMethods.push(self.observeRecord(record, recordUpdated));
- return self.wrapRecord(record);
- });
-
-
- var contentDidChange = function(array, idx, removedCount, addedCount) {
- for (var i = idx; i < idx + addedCount; i++) {
- var record = array.objectAt(i);
- var wrapped = self.wrapRecord(record);
- releaseMethods.push(self.observeRecord(record, recordUpdated));
- recordsAdded([wrapped]);
- }
-
- if (removedCount) {
- recordsRemoved(idx, removedCount);
- }
- };
-
- var observer = { didChange: contentDidChange, willChange: function() { return this; } };
- records.addArrayObserver(self, observer);
-
- release = function() {
- releaseMethods.forEach(function(fn) { fn(); });
- records.removeArrayObserver(self, observer);
- self.releaseMethods.removeObject(release);
- };
-
- recordsAdded(recordsToSend);
-
- this.releaseMethods.pushObject(release);
- return release;
- },
-
- /**
- Clear all observers before destruction
- @private
- @method willDestroy
- */
- willDestroy: function() {
- this._super();
- this.releaseMethods.forEach(function(fn) {
- fn();
- });
- },
-
- /**
- Detect whether a class is a model.
-
- Test that against the model class
- of your persistence library
-
- @private
- @method detect
- @param {Class} klass The class to test
- @return boolean Whether the class is a model class or not
- */
- detect: function(klass) {
- return false;
- },
-
- /**
- Get the columns for a given model type.
-
- @private
- @method columnsForType
- @param {Class} type The model type
- @return {Array} An array of columns of the following format:
- name: {String} name of the column
- desc: {String} Humanized description (what would show in a table column name)
- */
- columnsForType: function(type) {
- return emberA();
- },
-
- /**
- Adds observers to a model type class.
-
- @private
- @method observeModelType
- @param {Class} type The model type class
- @param {Function} typesUpdated Called when a type is modified.
- @return {Function} The function to call to remove observers
- */
-
- observeModelType: function(type, typesUpdated) {
- var self = this;
- var records = this.getRecords(type);
-
- var onChange = function() {
- typesUpdated([self.wrapModelType(type)]);
- };
- var observer = {
- didChange: function() {
- run.scheduleOnce('actions', this, onChange);
- },
- willChange: function() { return this; }
- };
-
- records.addArrayObserver(this, observer);
-
- var release = function() {
- records.removeArrayObserver(self, observer);
- };
-
- return release;
- },
-
-
- /**
- Wraps a given model type and observes changes to it.
-
- @private
- @method wrapModelType
- @param {Class} type A model class
- @param {String} Optional name of the class
- @return {Object} contains the wrapped type and the function to remove observers
- Format:
- type: {Object} the wrapped type
- The wrapped type has the following format:
- name: {String} name of the type
- count: {Integer} number of records available
- columns: {Columns} array of columns to describe the record
- object: {Class} the actual Model type class
- release: {Function} The function to remove observers
- */
- wrapModelType: function(type, name) {
- var records = this.getRecords(type);
- var typeToSend;
-
- typeToSend = {
- name: name || type.toString(),
- count: get(records, 'length'),
- columns: this.columnsForType(type),
- object: type
- };
-
-
- return typeToSend;
- },
-
-
- /**
- Fetches all models defined in the application.
-
- @private
- @method getModelTypes
- @return {Array} Array of model types
- */
- getModelTypes: function() {
- var self = this;
- var containerDebugAdapter = this.get('containerDebugAdapter');
- var types;
-
- if (containerDebugAdapter.canCatalogEntriesByType('model')) {
- types = containerDebugAdapter.catalogEntriesByType('model');
- } else {
- types = this._getObjectsOnNamespaces();
- }
-
- // New adapters return strings instead of classes
- types = emberA(types).map(function(name) {
- return {
- klass: self._nameToClass(name),
- name: name
- };
- });
- types = emberA(types).filter(function(type) {
- return self.detect(type.klass);
- });
-
- return emberA(types);
- },
-
- /**
- Loops over all namespaces and all objects
- attached to them
-
- @private
- @method _getObjectsOnNamespaces
- @return {Array} Array of model type strings
- */
- _getObjectsOnNamespaces: function() {
- var namespaces = emberA(Namespace.NAMESPACES);
- var types = emberA();
- var self = this;
-
- namespaces.forEach(function(namespace) {
- for (var key in namespace) {
- if (!namespace.hasOwnProperty(key)) { continue; }
- // Even though we will filter again in `getModelTypes`,
- // we should not call `lookupContainer` on non-models
- // (especially when `Ember.MODEL_FACTORY_INJECTIONS` is `true`)
- if (!self.detect(namespace[key])) { continue; }
- var name = dasherize(key);
- if (!(namespace instanceof Application) && namespace.toString()) {
- name = namespace + '/' + name;
- }
- types.push(name);
- }
- });
- return types;
- },
-
- /**
- Fetches all loaded records for a given type.
-
- @private
- @method getRecords
- @return {Array} An array of records.
- This array will be observed for changes,
- so it should update when new records are added/removed.
- */
- getRecords: function(type) {
- return emberA();
- },
-
- /**
- Wraps a record and observers changes to it.
-
- @private
- @method wrapRecord
- @param {Object} record The record instance.
- @return {Object} The wrapped record. Format:
- columnValues: {Array}
- searchKeywords: {Array}
- */
- wrapRecord: function(record) {
- var recordToSend = { object: record };
-
- recordToSend.columnValues = this.getRecordColumnValues(record);
- recordToSend.searchKeywords = this.getRecordKeywords(record);
- recordToSend.filterValues = this.getRecordFilterValues(record);
- recordToSend.color = this.getRecordColor(record);
-
- return recordToSend;
- },
-
- /**
- Gets the values for each column.
-
- @private
- @method getRecordColumnValues
- @return {Object} Keys should match column names defined
- by the model type.
- */
- getRecordColumnValues: function(record) {
- return {};
- },
-
- /**
- Returns keywords to match when searching records.
-
- @private
- @method getRecordKeywords
- @return {Array} Relevant keywords for search.
- */
- getRecordKeywords: function(record) {
- return emberA();
- },
-
- /**
- Returns the values of filters defined by `getFilters`.
-
- @private
- @method getRecordFilterValues
- @param {Object} record The record instance
- @return {Object} The filter values
- */
- getRecordFilterValues: function(record) {
- return {};
- },
-
- /**
- Each record can have a color that represents its state.
-
- @private
- @method getRecordColor
- @param {Object} record The record instance
- @return {String} The record's color
- Possible options: black, red, blue, green
- */
- getRecordColor: function(record) {
- return null;
- },
-
- /**
- Observes all relevant properties and re-sends the wrapped record
- when a change occurs.
-
- @private
- @method observerRecord
- @param {Object} record The record instance
- @param {Function} recordUpdated The callback to call when a record is updated.
- @return {Function} The function to call to remove all observers.
- */
- observeRecord: function(record, recordUpdated) {
- return function(){};
- }
- });
- });
-enifed("ember-htmlbars",
- ["ember-metal/core","ember-template-compiler","ember-htmlbars/hooks/inline","ember-htmlbars/hooks/content","ember-htmlbars/hooks/component","ember-htmlbars/hooks/block","ember-htmlbars/hooks/element","ember-htmlbars/hooks/subexpr","ember-htmlbars/hooks/attribute","ember-htmlbars/hooks/concat","ember-htmlbars/hooks/get","ember-htmlbars/hooks/set","morph","ember-htmlbars/system/make-view-helper","ember-htmlbars/system/make_bound_helper","ember-htmlbars/helpers","ember-htmlbars/helpers/binding","ember-htmlbars/helpers/view","ember-htmlbars/helpers/yield","ember-htmlbars/helpers/with","ember-htmlbars/helpers/log","ember-htmlbars/helpers/debugger","ember-htmlbars/helpers/bind-attr","ember-htmlbars/helpers/if_unless","ember-htmlbars/helpers/loc","ember-htmlbars/helpers/partial","ember-htmlbars/helpers/template","ember-htmlbars/helpers/input","ember-htmlbars/helpers/text_area","ember-htmlbars/helpers/collection","ember-htmlbars/helpers/each","ember-htmlbars/helpers/unbound","ember-htmlbars/system/bootstrap","ember-htmlbars/compat","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __dependency10__, __dependency11__, __dependency12__, __dependency13__, __dependency14__, __dependency15__, __dependency16__, __dependency17__, __dependency18__, __dependency19__, __dependency20__, __dependency21__, __dependency22__, __dependency23__, __dependency24__, __dependency25__, __dependency26__, __dependency27__, __dependency28__, __dependency29__, __dependency30__, __dependency31__, __dependency32__, __dependency33__, __dependency34__, __exports__) {
- "use strict";
- var Ember = __dependency1__["default"];
-
- var precompile = __dependency2__.precompile;
- var compile = __dependency2__.compile;
- var template = __dependency2__.template;
- var registerPlugin = __dependency2__.registerPlugin;
-
- var inline = __dependency3__["default"];
- var content = __dependency4__["default"];
- var component = __dependency5__["default"];
- var block = __dependency6__["default"];
- var element = __dependency7__["default"];
- var subexpr = __dependency8__["default"];
- var attribute = __dependency9__["default"];
- var concat = __dependency10__["default"];
- var get = __dependency11__["default"];
- var set = __dependency12__["default"];
- var DOMHelper = __dependency13__.DOMHelper;
- var makeViewHelper = __dependency14__["default"];
- var makeBoundHelper = __dependency15__["default"];
-
- var registerHelper = __dependency16__.registerHelper;
- var helpers = __dependency16__["default"];
- var bindHelper = __dependency17__.bindHelper;
- var viewHelper = __dependency18__.viewHelper;
- var yieldHelper = __dependency19__.yieldHelper;
- var withHelper = __dependency20__.withHelper;
- var logHelper = __dependency21__.logHelper;
- var debuggerHelper = __dependency22__.debuggerHelper;
- var bindAttrHelper = __dependency23__.bindAttrHelper;
- var bindAttrHelperDeprecated = __dependency23__.bindAttrHelperDeprecated;
- var ifHelper = __dependency24__.ifHelper;
- var unlessHelper = __dependency24__.unlessHelper;
- var unboundIfHelper = __dependency24__.unboundIfHelper;
- var boundIfHelper = __dependency24__.boundIfHelper;
- var locHelper = __dependency25__.locHelper;
- var partialHelper = __dependency26__.partialHelper;
- var templateHelper = __dependency27__.templateHelper;
- var inputHelper = __dependency28__.inputHelper;
- var textareaHelper = __dependency29__.textareaHelper;
- var collectionHelper = __dependency30__.collectionHelper;
- var eachHelper = __dependency31__.eachHelper;
- var unboundHelper = __dependency32__.unboundHelper;
-
- // importing adds template bootstrapping
- // initializer to enable embedded templates
-
- // importing ember-htmlbars/compat updates the
- // Ember.Handlebars global if htmlbars is enabled
-
- registerHelper('bindHelper', bindHelper);
- registerHelper('bind', bindHelper);
- registerHelper('view', viewHelper);
- registerHelper('yield', yieldHelper);
- registerHelper('with', withHelper);
- registerHelper('if', ifHelper);
- registerHelper('unless', unlessHelper);
- registerHelper('unboundIf', unboundIfHelper);
- registerHelper('boundIf', boundIfHelper);
- registerHelper('log', logHelper);
- registerHelper('debugger', debuggerHelper);
- registerHelper('loc', locHelper);
- registerHelper('partial', partialHelper);
- registerHelper('template', templateHelper);
- registerHelper('bind-attr', bindAttrHelper);
- registerHelper('bindAttr', bindAttrHelperDeprecated);
- registerHelper('input', inputHelper);
- registerHelper('textarea', textareaHelper);
- registerHelper('collection', collectionHelper);
- registerHelper('each', eachHelper);
- registerHelper('unbound', unboundHelper);
- registerHelper('concat', concat);
-
-
- Ember.HTMLBars = {
- _registerHelper: registerHelper,
- template: template,
- compile: compile,
- precompile: precompile,
- makeViewHelper: makeViewHelper,
- makeBoundHelper: makeBoundHelper,
- registerPlugin: registerPlugin
- };
-
-
-
- var defaultEnv = {
- dom: new DOMHelper(),
-
- hooks: {
- get: get,
- set: set,
- inline: inline,
- content: content,
- block: block,
- element: element,
- subexpr: subexpr,
- component: component,
- attribute: attribute,
- concat: concat
- },
-
- helpers: helpers,
- useFragmentCache: true
- };
- __exports__.defaultEnv = defaultEnv;
- });
-enifed("ember-htmlbars/compat",
- ["ember-metal/core","ember-htmlbars/helpers","ember-htmlbars/compat/helper","ember-htmlbars/compat/handlebars-get","ember-htmlbars/compat/make-bound-helper","ember-htmlbars/compat/register-bound-helper","ember-htmlbars/system/make-view-helper","ember-htmlbars/utils/string","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __exports__) {
- "use strict";
- var Ember = __dependency1__["default"];
- var helpers = __dependency2__["default"];
- var compatRegisterHelper = __dependency3__.registerHandlebarsCompatibleHelper;
- var compatHandlebarsHelper = __dependency3__.handlebarsHelper;
- var compatHandlebarsGet = __dependency4__["default"];
- var compatMakeBoundHelper = __dependency5__["default"];
- var compatRegisterBoundHelper = __dependency6__["default"];
- var makeViewHelper = __dependency7__["default"];
- var SafeString = __dependency8__.SafeString;
- var escapeExpression = __dependency8__.escapeExpression;
-
- var EmberHandlebars;
-
- EmberHandlebars = Ember.Handlebars = Ember.Handlebars || {};
- EmberHandlebars.helpers = helpers;
- EmberHandlebars.helper = compatHandlebarsHelper;
- EmberHandlebars.registerHelper = compatRegisterHelper;
- EmberHandlebars.registerBoundHelper = compatRegisterBoundHelper;
- EmberHandlebars.makeBoundHelper = compatMakeBoundHelper;
- EmberHandlebars.get = compatHandlebarsGet;
- EmberHandlebars.makeViewHelper = makeViewHelper;
-
- EmberHandlebars.SafeString = SafeString;
- EmberHandlebars.Utils = {
- escapeExpression: escapeExpression
- };
-
-
- __exports__["default"] = EmberHandlebars;
- });
-enifed("ember-htmlbars/compat/handlebars-get",
- ["exports"],
- function(__exports__) {
- "use strict";
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- /**
- Lookup both on root and on window. If the path starts with
- a keyword, the corresponding object will be looked up in the
- template's data hash and used to resolve the path.
-
- @method get
- @for Ember.Handlebars
- @param {Object} root The object to look up the property on
- @param {String} path The path to be lookedup
- @param {Object} options The template's option hash
- @deprecated
- */
- __exports__["default"] = function handlebarsGet(root, path, options) {
- Ember.deprecate('Usage of Ember.Handlebars.get is deprecated, use a Component or Ember.Handlebars.makeBoundHelper instead.');
-
- return options.data.view.getStream(path).value();
- }
- });
-enifed("ember-htmlbars/compat/helper",
- ["ember-metal/merge","ember-htmlbars/helpers","ember-views/views/view","ember-views/views/component","ember-htmlbars/system/make-view-helper","ember-htmlbars/compat/make-bound-helper","ember-metal/streams/utils","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __exports__) {
- "use strict";
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- var merge = __dependency1__["default"];
- var helpers = __dependency2__["default"];
- var View = __dependency3__["default"];
- var Component = __dependency4__["default"];
- var makeViewHelper = __dependency5__["default"];
- var makeBoundHelper = __dependency6__["default"];
- var isStream = __dependency7__.isStream;
-
- var slice = [].slice;
-
- function calculateCompatType(item) {
- if (isStream(item)) {
- return 'ID';
- } else {
- var itemType = typeof item;
-
- return itemType.toUpperCase();
- }
- }
-
- /**
- Wraps an Handlebars helper with an HTMLBars helper for backwards compatibility.
-
- @class HandlebarsCompatibleHelper
- @constructor
- @private
- */
- function HandlebarsCompatibleHelper(fn) {
- this.helperFunction = function helperFunc(params, hash, options, env) {
- var param, blockResult, fnResult;
- var context = this;
- var handlebarsOptions = {
- hash: { },
- types: new Array(params.length),
- hashTypes: { }
- };
-
- merge(handlebarsOptions, options);
- merge(handlebarsOptions, env);
-
- handlebarsOptions.hash = {};
-
- if (options.isBlock) {
- handlebarsOptions.fn = function() {
- blockResult = options.template.render(context, env, options.morph.contextualElement);
- };
- }
-
- for (var prop in hash) {
- param = hash[prop];
-
- handlebarsOptions.hashTypes[prop] = calculateCompatType(param);
-
- if (isStream(param)) {
- handlebarsOptions.hash[prop] = param._label;
- } else {
- handlebarsOptions.hash[prop] = param;
- }
- }
-
- var args = new Array(params.length);
- for (var i = 0, l = params.length; i < l; i++) {
- param = params[i];
-
- handlebarsOptions.types[i] = calculateCompatType(param);
-
- if (isStream(param)) {
- args[i] = param._label;
- } else {
- args[i] = param;
- }
- }
- args.push(handlebarsOptions);
-
- fnResult = fn.apply(this, args);
-
- return options.isBlock ? blockResult : fnResult;
- };
-
- this.isHTMLBars = true;
- }
-
- HandlebarsCompatibleHelper.prototype = {
- preprocessArguments: function() { }
- };
-
- function registerHandlebarsCompatibleHelper(name, value) {
- var helper;
-
- if (value && value.isHTMLBars) {
- helper = value;
- } else {
- helper = new HandlebarsCompatibleHelper(value);
- }
-
- helpers[name] = helper;
- }
-
- __exports__.registerHandlebarsCompatibleHelper = registerHandlebarsCompatibleHelper;function handlebarsHelper(name, value) {
- Ember.assert("You tried to register a component named '" + name +
- "', but component names must include a '-'", !Component.detect(value) || name.match(/-/));
-
- if (View.detect(value)) {
- helpers[name] = makeViewHelper(value);
- } else {
- var boundHelperArgs = slice.call(arguments, 1);
- var boundFn = makeBoundHelper.apply(this, boundHelperArgs);
-
- helpers[name] = boundFn;
- }
- }
-
- __exports__.handlebarsHelper = handlebarsHelper;__exports__["default"] = HandlebarsCompatibleHelper;
- });
-enifed("ember-htmlbars/compat/make-bound-helper",
- ["ember-metal/core","ember-metal/mixin","ember-htmlbars/system/helper","ember-metal/streams/stream","ember-metal/streams/utils","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __exports__) {
- "use strict";
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- var Ember = __dependency1__["default"];
- // Ember.FEATURES, Ember.assert, Ember.Handlebars, Ember.lookup
- var IS_BINDING = __dependency2__.IS_BINDING;
- var Helper = __dependency3__["default"];
-
- var Stream = __dependency4__["default"];
- var readArray = __dependency5__.readArray;
- var scanArray = __dependency5__.scanArray;
- var scanHash = __dependency5__.scanHash;
- var readHash = __dependency5__.readHash;
- var isStream = __dependency5__.isStream;
-
- /**
- A helper function used by `registerBoundHelper`. Takes the
- provided Handlebars helper function fn and returns it in wrapped
- bound helper form.
-
- The main use case for using this outside of `registerBoundHelper`
- is for registering helpers on the container:
-
- ```js
- var boundHelperFn = Ember.Handlebars.makeBoundHelper(function(word) {
- return word.toUpperCase();
- });
-
- container.register('helper:my-bound-helper', boundHelperFn);
- ```
-
- In the above example, if the helper function hadn't been wrapped in
- `makeBoundHelper`, the registered helper would be unbound.
-
- @method makeBoundHelper
- @for Ember.Handlebars
- @param {Function} function
- @param {String} dependentKeys*
- @since 1.2.0
- @deprecated
- */
- __exports__["default"] = function makeBoundHelper(fn, compatMode) {
- var dependentKeys = [];
- for (var i = 1; i < arguments.length; i++) {
- dependentKeys.push(arguments[i]);
- }
-
- function helperFunc(params, hash, options, env) {
- var view = this;
- var numParams = params.length;
- var param;
-
- Ember.assert("registerBoundHelper-generated helpers do not support use with Handlebars blocks.", !options.template);
-
- for (var prop in hash) {
- if (IS_BINDING.test(prop)) {
- hash[prop.slice(0, -7)] = view.getStream(hash[prop]);
- delete hash[prop];
- }
- }
-
- function valueFn() {
- var args = readArray(params);
- var properties = new Array(params.length);
- for (var i = 0, l = params.length; i < l; i++) {
- param = params[i];
-
- if (isStream(param)) {
- properties[i] = param._label;
- } else {
- properties[i] = param;
- }
- }
-
- args.push({
- hash: readHash(hash),
- data: { properties: properties }
- });
- return fn.apply(view, args);
- }
-
- // If none of the hash parameters are bound, act as an unbound helper.
- // This prevents views from being unnecessarily created
- var hasStream = scanArray(params) || scanHash(hash);
-
- if (env.data.isUnbound || !hasStream){
- return valueFn();
- } else {
- var lazyValue = new Stream(valueFn);
-
- for (i = 0; i < numParams; i++) {
- param = params[i];
- if (isStream(param)) {
- param.subscribe(lazyValue.notify, lazyValue);
- }
- }
-
- for (prop in hash) {
- param = hash[prop];
- if (isStream(param)) {
- param.subscribe(lazyValue.notify, lazyValue);
- }
- }
-
- if (numParams > 0) {
- var firstParam = params[0];
- // Only bother with subscriptions if the first argument
- // is a stream itself, and not a primitive.
- if (isStream(firstParam)) {
- var onDependentKeyNotify = function onDependentKeyNotify(stream) {
- stream.value();
- lazyValue.notify();
- };
- for (i = 0; i < dependentKeys.length; i++) {
- var childParam = firstParam.get(dependentKeys[i]);
- childParam.value();
- childParam.subscribe(onDependentKeyNotify);
- }
- }
- }
-
- return lazyValue;
- }
- }
-
- return new Helper(helperFunc);
- }
- });
-enifed("ember-htmlbars/compat/register-bound-helper",
- ["ember-htmlbars/helpers","ember-htmlbars/compat/make-bound-helper","exports"],
- function(__dependency1__, __dependency2__, __exports__) {
- "use strict";
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- var helpers = __dependency1__["default"];
- var makeBoundHelper = __dependency2__["default"];
-
- var slice = [].slice;
-
- /**
- Register a bound handlebars helper. Bound helpers behave similarly to regular
- handlebars helpers, with the added ability to re-render when the underlying data
- changes.
-
- ## Simple example
-
- ```javascript
- Ember.Handlebars.registerBoundHelper('capitalize', function(value) {
- return Ember.String.capitalize(value);
- });
- ```
-
- The above bound helper can be used inside of templates as follows:
-
- ```handlebars
- {{capitalize name}}
- ```
-
- In this case, when the `name` property of the template's context changes,
- the rendered value of the helper will update to reflect this change.
-
- ## Example with options
-
- Like normal handlebars helpers, bound helpers have access to the options
- passed into the helper call.
-
- ```javascript
- Ember.Handlebars.registerBoundHelper('repeat', function(value, options) {
- var count = options.hash.count;
- var a = [];
- while(a.length < count) {
- a.push(value);
- }
- return a.join('');
- });
- ```
-
- This helper could be used in a template as follows:
-
- ```handlebars
- {{repeat text count=3}}
- ```
-
- ## Example with bound options
-
- Bound hash options are also supported. Example:
-
- ```handlebars
- {{repeat text count=numRepeats}}
- ```
-
- In this example, count will be bound to the value of
- the `numRepeats` property on the context. If that property
- changes, the helper will be re-rendered.
-
- ## Example with extra dependencies
-
- The `Ember.Handlebars.registerBoundHelper` method takes a variable length
- third parameter which indicates extra dependencies on the passed in value.
- This allows the handlebars helper to update when these dependencies change.
-
- ```javascript
- Ember.Handlebars.registerBoundHelper('capitalizeName', function(value) {
- return value.get('name').toUpperCase();
- }, 'name');
- ```
-
- ## Example with multiple bound properties
-
- `Ember.Handlebars.registerBoundHelper` supports binding to
- multiple properties, e.g.:
-
- ```javascript
- Ember.Handlebars.registerBoundHelper('concatenate', function() {
- var values = Array.prototype.slice.call(arguments, 0, -1);
- return values.join('||');
- });
- ```
-
- Which allows for template syntax such as `{{concatenate prop1 prop2}}` or
- `{{concatenate prop1 prop2 prop3}}`. If any of the properties change,
- the helper will re-render. Note that dependency keys cannot be
- using in conjunction with multi-property helpers, since it is ambiguous
- which property the dependent keys would belong to.
-
- ## Use with unbound helper
-
- The `{{unbound}}` helper can be used with bound helper invocations
- to render them in their unbound form, e.g.
-
- ```handlebars
- {{unbound capitalize name}}
- ```
-
- In this example, if the name property changes, the helper
- will not re-render.
-
- ## Use with blocks not supported
-
- Bound helpers do not support use with Handlebars blocks or
- the addition of child views of any kind.
-
- @method registerBoundHelper
- @for Ember.Handlebars
- @param {String} name
- @param {Function} function
- @param {String} dependentKeys*
- */
- __exports__["default"] = function registerBoundHelper(name, fn) {
- var boundHelperArgs = slice.call(arguments, 1);
- var boundFn = makeBoundHelper.apply(this, boundHelperArgs);
-
- helpers[name] = boundFn;
- }
- });
-enifed("ember-htmlbars/helpers",
- ["ember-metal/platform","ember-htmlbars/system/helper","exports"],
- function(__dependency1__, __dependency2__, __exports__) {
- "use strict";
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- var o_create = __dependency1__.create;
-
- /**
- @private
- @property helpers
- */
- var helpers = o_create(null);
-
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- var Helper = __dependency2__["default"];
-
- /**
- @private
- @method _registerHelper
- @for Ember.HTMLBars
- @param {String} name
- @param {Object|Function} helperFunc the helper function to add
- */
- function registerHelper(name, helperFunc) {
- var helper;
-
- if (helperFunc && helperFunc.isHelper) {
- helper = helperFunc;
- } else {
- helper = new Helper(helperFunc);
- }
-
- helpers[name] = helper;
- }
-
- __exports__.registerHelper = registerHelper;__exports__["default"] = helpers;
- });
-enifed("ember-htmlbars/helpers/bind-attr",
- ["ember-metal/core","ember-runtime/system/string","ember-views/attr_nodes/attr_node","ember-views/attr_nodes/legacy_bind","ember-metal/keys","ember-htmlbars/helpers","ember-metal/enumerable_utils","ember-metal/streams/utils","ember-views/streams/class_name_binding","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __dependency7__, __dependency8__, __dependency9__, __exports__) {
- "use strict";
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- var Ember = __dependency1__["default"];
- // Ember.assert
-
- var fmt = __dependency2__.fmt;
- var AttrNode = __dependency3__["default"];
- var LegacyBindAttrNode = __dependency4__["default"];
- var keys = __dependency5__["default"];
- var helpers = __dependency6__["default"];
- var map = __dependency7__.map;
- var isStream = __dependency8__.isStream;
- var concat = __dependency8__.concat;
- var streamifyClassNameBinding = __dependency9__.streamifyClassNameBinding;
-
- /**
- `bind-attr` allows you to create a binding between DOM element attributes and
- Ember objects. For example:
-
- ```handlebars
-
- ```
-
- The above handlebars template will fill the ``'s `src` attribute with
- the value of the property referenced with `imageUrl` and its `alt`
- attribute with the value of the property referenced with `imageTitle`.
-
- If the rendering context of this template is the following object:
-
- ```javascript
- {
- imageUrl: 'http://lolcats.info/haz-a-funny',
- imageTitle: 'A humorous image of a cat'
- }
- ```
-
- The resulting HTML output will be:
-
- ```html
-
- ```
-
- `bind-attr` cannot redeclare existing DOM element attributes. The use of `src`
- in the following `bind-attr` example will be ignored and the hard coded value
- of `src="/failwhale.gif"` will take precedence:
-
- ```handlebars
-
- ```
-
- ### `bind-attr` and the `class` attribute
-
- `bind-attr` supports a special syntax for handling a number of cases unique
- to the `class` DOM element attribute. The `class` attribute combines
- multiple discrete values into a single attribute as a space-delimited
- list of strings. Each string can be:
-
- * a string return value of an object's property.
- * a boolean return value of an object's property
- * a hard-coded value
-
- A string return value works identically to other uses of `bind-attr`. The
- return value of the property will become the value of the attribute. For
- example, the following view and template:
-
- ```javascript
- AView = View.extend({
- someProperty: function() {
- return "aValue";
- }.property()
- })
- ```
-
- ```handlebars
-
- ```
-
- Result in the following rendered output:
-
- ```html
-
- ```
-
- A boolean return value will insert a specified class name if the property
- returns `true` and remove the class name if the property returns `false`.
-
- A class name is provided via the syntax
- `somePropertyName:class-name-if-true`.
-
- ```javascript
- AView = View.extend({
- someBool: true
- })
- ```
-
- ```handlebars
-
- ```
-
- Result in the following rendered output:
-
- ```html
-
- ```
-
- An additional section of the binding can be provided if you want to
- replace the existing class instead of removing it when the boolean
- value changes:
-
- ```handlebars
-
- ```
-
- A hard-coded value can be used by prepending `:` to the desired
- class name: `:class-name-to-always-apply`.
-
- ```handlebars
-
- ```
-
- Results in the following rendered output:
-
- ```html
-
- ```
-
- All three strategies - string return value, boolean return value, and
- hard-coded value – can be combined in a single declaration:
-
- ```handlebars
-
- ```
-
- @method bind-attr
- @for Ember.Handlebars.helpers
- @param {Hash} options
- @return {String} HTML string
- */
- function bindAttrHelper(params, hash, options, env) {
- var element = options.element;
-
- Ember.assert("You must specify at least one hash argument to bind-attr", !!keys(hash).length);
-
- var view = this;
-
- // Handle classes differently, as we can bind multiple classes
- var classNameBindings = hash['class'];
- if (classNameBindings !== null && classNameBindings !== undefined) {
- if (!isStream(classNameBindings)) {
- classNameBindings = applyClassNameBindings(classNameBindings, view);
- }
-
- var classView = new AttrNode('class', classNameBindings);
- classView._morph = env.dom.createAttrMorph(element, 'class');
-
- Ember.assert(
- 'You cannot set `class` manually and via `{{bind-attr}}` helper on the same element. ' +
- 'Please use `{{bind-attr}}`\'s `:static-class` syntax instead.',
- !element.getAttribute('class')
- );
-
- view.appendChild(classView);
- }
-
- var attrKeys = keys(hash);
-
- var attr, path, lazyValue, attrView;
- for (var i=0, l=attrKeys.length;i` the following template:
-
- ```handlebars
- {{! application.hbs }}
- {{#collection content=model}}
- Hi {{view.content.name}}
- {{/collection}}
- ```
-
- And the following application code
-
- ```javascript
- App = Ember.Application.create();
- App.ApplicationRoute = Ember.Route.extend({
- model: function(){
- return [{name: 'Yehuda'},{name: 'Tom'},{name: 'Peter'}];
- }
- });
- ```
-
- The following HTML will result:
-
- ```html
-
-
Hi Yehuda
-
Hi Tom
-
Hi Peter
-
- ```
-
- ### Non-block version of collection
-
- If you provide an `itemViewClass` option that has its own `template` you may
- omit the block.
-
- The following template:
-
- ```handlebars
- {{! application.hbs }}
- {{collection content=model itemViewClass="an-item"}}
- ```
-
- And application code
-
- ```javascript
- App = Ember.Application.create();
- App.ApplicationRoute = Ember.Route.extend({
- model: function(){
- return [{name: 'Yehuda'},{name: 'Tom'},{name: 'Peter'}];
- }
- });
-
- App.AnItemView = Ember.View.extend({
- template: Ember.Handlebars.compile("Greetings {{view.content.name}}")
- });
- ```
-
- Will result in the HTML structure below
-
- ```html
-
-
Greetings Yehuda
-
Greetings Tom
-
Greetings Peter
-
- ```
-
- ### Specifying a CollectionView subclass
-
- By default the `{{collection}}` helper will create an instance of
- `Ember.CollectionView`. You can supply a `Ember.CollectionView` subclass to
- the helper by passing it as the first argument:
-
- ```handlebars
- {{#collection "my-custom-collection" content=model}}
- Hi {{view.content.name}}
- {{/collection}}
- ```
-
- This example would look for the class `App.MyCustomCollection`.
-
- ### Forwarded `item.*`-named Options
-
- As with the `{{view}}`, helper options passed to the `{{collection}}` will be
- set on the resulting `Ember.CollectionView` as properties. Additionally,
- options prefixed with `item` will be applied to the views rendered for each
- item (note the camelcasing):
-
- ```handlebars
- {{#collection content=model
- itemTagName="p"
- itemClassNames="greeting"}}
- Howdy {{view.content.name}}
- {{/collection}}
- ```
-
- Will result in the following HTML structure:
-
- ```html
-
-
Howdy Yehuda
-
Howdy Tom
-
Howdy Peter
-
- ```
-
- @method collection
- @for Ember.Handlebars.helpers
- @param {String} path
- @param {Hash} options
- @return {String} HTML string
- @deprecated Use `{{each}}` helper instead.
- */
- function collectionHelper(params, hash, options, env) {
- var path = params[0];
-
- Ember.deprecate("Using the {{collection}} helper without specifying a class has been" +
- " deprecated as the {{each}} helper now supports the same functionality.", path !== 'collection');
-
- Ember.assert("You cannot pass more than one argument to the collection helper", params.length <= 1);
-
- var data = env.data;
- var template = options.template;
- var inverse = options.inverse;
- var view = data.view;
-
- // This should be deterministic, and should probably come from a
- // parent view and not the controller.
- var controller = get(view, 'controller');
- var container = (controller && controller.container ? controller.container : view.container);
-
- // If passed a path string, convert that into an object.
- // Otherwise, just default to the standard class.
- var collectionClass;
- if (path) {
- collectionClass = readViewFactory(path, container);
- Ember.assert(fmt("%@ #collection: Could not find collection class %@", [data.view, path]), !!collectionClass);
- }
- else {
- collectionClass = CollectionView;
- }
-
- var itemHash = {};
- var match;
-
- // Extract item view class if provided else default to the standard class
- var collectionPrototype = collectionClass.proto();
- var itemViewClass;
-
- if (hash.itemView) {
- itemViewClass = readViewFactory(hash.itemView, container);
- } else if (hash.itemViewClass) {
- itemViewClass = readViewFactory(hash.itemViewClass, container);
- } else {
- itemViewClass = collectionPrototype.itemViewClass;
- }
-
- if (typeof itemViewClass === 'string') {
- itemViewClass = container.lookupFactory('view:'+itemViewClass);
- }
-
- Ember.assert(fmt("%@ #collection: Could not find itemViewClass %@", [data.view, itemViewClass]), !!itemViewClass);
-
- delete hash.itemViewClass;
- delete hash.itemView;
-
- // Go through options passed to the {{collection}} helper and extract options
- // that configure item views instead of the collection itself.
- for (var prop in hash) {
- if (prop === 'itemController' || prop === 'itemClassBinding') {
- continue;
- }
- if (hash.hasOwnProperty(prop)) {
- match = prop.match(/^item(.)(.*)$/);
- if (match) {
- var childProp = match[1].toLowerCase() + match[2];
-
- if (IS_BINDING.test(prop)) {
- itemHash[childProp] = view._getBindingForStream(hash[prop]);
- } else {
- itemHash[childProp] = hash[prop];
- }
- delete hash[prop];
- }
- }
- }
-
- if (template) {
- itemHash.template = template;
- delete options.template;
- }
-
- var emptyViewClass;
- if (inverse) {
- emptyViewClass = get(collectionPrototype, 'emptyViewClass');
- emptyViewClass = emptyViewClass.extend({
- template: inverse,
- tagName: itemHash.tagName
- });
- } else if (hash.emptyViewClass) {
- emptyViewClass = readViewFactory(hash.emptyViewClass, container);
- }
- if (emptyViewClass) { hash.emptyView = emptyViewClass; }
-
- if (hash.keyword) {
- itemHash._contextBinding = Binding.oneWay('_parentView.context');
- } else {
- itemHash._contextBinding = Binding.oneWay('content');
- }
-
- var viewOptions = ViewHelper.propertiesFromHTMLOptions(itemHash, {}, { data: data });
-
- if (hash.itemClassBinding) {
- var itemClassBindings = hash.itemClassBinding.split(' ');
- viewOptions.classNameBindings = map(itemClassBindings, function(classBinding){
- return streamifyClassNameBinding(view, classBinding);
- });
- }
-
- hash.itemViewClass = itemViewClass;
- hash._itemViewProps = viewOptions;
-
- options.helperName = options.helperName || 'collection';
-
- return env.helpers.view.helperFunction.call(this, [collectionClass], hash, options, env);
- }
-
- __exports__.collectionHelper = collectionHelper;
- });
-enifed("ember-htmlbars/helpers/debugger",
- ["ember-metal/logger","exports"],
- function(__dependency1__, __exports__) {
- "use strict";
- /*jshint debug:true*/
-
- /**
- @module ember
- @submodule ember-htmlbars
- */
- var Logger = __dependency1__["default"];
-
- /**
- Execute the `debugger` statement in the current context.
-
- ```handlebars
- {{debugger}}
- ```
-
- Before invoking the `debugger` statement, there
- are a few helpful variables defined in the
- body of this helper that you can inspect while
- debugging that describe how and where this
- helper was invoked:
-
- - templateContext: this is most likely a controller
- from which this template looks up / displays properties
- - typeOfTemplateContext: a string description of
- what the templateContext is
-
- For example, if you're wondering why a value `{{foo}}`
- isn't rendering as expected within a template, you
- could place a `{{debugger}}` statement, and when
- the `debugger;` breakpoint is hit, you can inspect
- `templateContext`, determine if it's the object you
- expect, and/or evaluate expressions in the console
- to perform property lookups on the `templateContext`:
-
- ```
- > templateContext.get('foo') // -> ""
- ```
-
- @method debugger
- @for Ember.Handlebars.helpers
- @param {String} property
- */
- function debuggerHelper() {
-
- // These are helpful values you can inspect while debugging.
- /* jshint unused: false */
- var view = this;
- Logger.info('Use `this` to access the view context.');
-
- debugger;
- }
-
- __exports__.debuggerHelper = debuggerHelper;
- });
-enifed("ember-htmlbars/helpers/each",
- ["ember-metal/core","ember-views/views/each","exports"],
- function(__dependency1__, __dependency2__, __exports__) {
- "use strict";
-
- /**
- @module ember
- @submodule ember-htmlbars
- */
- var Ember = __dependency1__["default"];
- // Ember.assert;
- var EachView = __dependency2__["default"];
-
- /**
- The `{{#each}}` helper loops over elements in a collection. It is an extension
- of the base Handlebars `{{#each}}` helper.
-
- The default behavior of `{{#each}}` is to yield its inner block once for every
- item in an array.
-
- ```javascript
- var developers = [{name: 'Yehuda'},{name: 'Tom'}, {name: 'Paul'}];
- ```
-
- ```handlebars
- {{#each person in developers}}
- {{person.name}}
- {{! `this` is whatever it was outside the #each }}
- {{/each}}
- ```
-
- The same rules apply to arrays of primitives, but the items may need to be
- references with `{{this}}`.
-
- ```javascript
- var developerNames = ['Yehuda', 'Tom', 'Paul']
- ```
-
- ```handlebars
- {{#each name in developerNames}}
- {{name}}
- {{/each}}
- ```
-
- ### {{else}} condition
-
- `{{#each}}` can have a matching `{{else}}`. The contents of this block will render
- if the collection is empty.
-
- ```
- {{#each person in developers}}
- {{person.name}}
- {{else}}
-
Sorry, nobody is available for this task.
- {{/each}}
- ```
-
- ### Specifying an alternative view for each item
-
- `itemViewClass` can control which view will be used during the render of each
- item's template.
-
- The following template:
-
- ```handlebars
-
- ```
-
- Will use the following view for each item
-
- ```javascript
- App.PersonView = Ember.View.extend({
- tagName: 'li'
- });
- ```
-
- Resulting in HTML output that looks like the following:
-
- ```html
-
-
Yehuda
-
Tom
-
Paul
-
- ```
-
- `itemViewClass` also enables a non-block form of `{{each}}`. The view
- must {{#crossLink "Ember.View/toc_templates"}}provide its own template{{/crossLink}},
- and then the block should be dropped. An example that outputs the same HTML
- as the previous one:
-
- ```javascript
- App.PersonView = Ember.View.extend({
- tagName: 'li',
- template: '{{developer.name}}'
- });
- ```
-
- ```handlebars
-
- {{each developer in developers itemViewClass="person"}}
-
- ```
-
- ### Specifying an alternative view for no items (else)
-
- The `emptyViewClass` option provides the same flexibility to the `{{else}}`
- case of the each helper.
-
- ```javascript
- App.NoPeopleView = Ember.View.extend({
- tagName: 'li',
- template: 'No person is available, sorry'
- });
- ```
-
- ```handlebars
-
- {{#each developer in developers emptyViewClass="no-people"}}
-
{{developer.name}}
- {{/each}}
-
- ```
-
- ### Wrapping each item in a controller
-
- Controllers in Ember manage state and decorate data. In many cases,
- providing a controller for each item in a list can be useful.
- Specifically, an {{#crossLink "Ember.ObjectController"}}Ember.ObjectController{{/crossLink}}
- should probably be used. Item controllers are passed the item they
- will present as a `model` property, and an object controller will
- proxy property lookups to `model` for us.
-
- This allows state and decoration to be added to the controller
- while any other property lookups are delegated to the model. An example:
-
- ```javascript
- App.RecruitController = Ember.ObjectController.extend({
- isAvailableForHire: function() {
- return !this.get('isEmployed') && this.get('isSeekingWork');
- }.property('isEmployed', 'isSeekingWork')
- })
- ```
-
- ```handlebars
- {{#each person in developers itemController="recruit"}}
- {{person.name}} {{#if person.isAvailableForHire}}Hire me!{{/if}}
- {{/each}}
- ```
-
- @method each
- @for Ember.Handlebars.helpers
- @param [name] {String} name for item (used with `in`)
- @param [path] {String} path
- @param [options] {Object} Handlebars key/value pairs of options
- @param [options.itemViewClass] {String} a path to a view class used for each item
- @param [options.emptyViewClass] {String} a path to a view class used for each item
- @param [options.itemController] {String} name of a controller to be created for each item
- */
- function eachHelper(params, hash, options, env) {
- var helperName = 'each';
- var path = params[0] || this.getStream('');
-
- Ember.assert(
- "If you pass more than one argument to the each helper, " +
- "it must be in the form #each foo in bar",
- params.length <= 1
- );
-
- if (options.template && options.template.blockParams) {
- hash.keyword = true;
- }
-
- Ember.deprecate(
- "Using the context switching form of {{each}} is deprecated. " +
- "Please use the keyword form (`{{#each foo in bar}}`) instead.",
- hash.keyword === true || typeof hash.keyword === 'string',
- { url: 'http://emberjs.com/guides/deprecations/#toc_more-consistent-handlebars-scope' }
- );
-
- hash.dataSource = path;
- options.helperName = options.helperName || helperName;
-
- return env.helpers.collection.helperFunction.call(this, [EachView], hash, options, env);
- }
-
- __exports__.EachView = EachView;
- __exports__.eachHelper = eachHelper;
- });
-enifed("ember-htmlbars/helpers/if_unless",
- ["ember-metal/core","ember-htmlbars/helpers/binding","ember-metal/property_get","ember-metal/utils","ember-views/streams/conditional_stream","ember-metal/streams/utils","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__, __dependency6__, __exports__) {
- "use strict";
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- var Ember = __dependency1__["default"];
- // Ember.assert
- var bind = __dependency2__.bind;
-
- var get = __dependency3__.get;
- var isArray = __dependency4__.isArray;
- var ConditionalStream = __dependency5__["default"];
- var isStream = __dependency6__.isStream;
-
- function shouldDisplayIfHelperContent(result) {
- var truthy = result && get(result, 'isTruthy');
- if (typeof truthy === 'boolean') { return truthy; }
-
- if (isArray(result)) {
- return get(result, 'length') !== 0;
- } else {
- return !!result;
- }
- }
-
- var EMPTY_TEMPLATE = {
- isHTMLBars: true,
- render: function() {
- return '';
- }
- };
- /**
- Use the `boundIf` helper to create a conditional that re-evaluates
- whenever the truthiness of the bound value changes.
-
- ```handlebars
- {{#boundIf "content.shouldDisplayTitle"}}
- {{content.title}}
- {{/boundIf}}
- ```
-
- @private
- @method boundIf
- @for Ember.Handlebars.helpers
- @param {String} property Property to bind
- @param {Function} fn Context to provide for rendering
- @return {String} HTML string
- */
- function boundIfHelper(params, hash, options, env) {
- options.helperName = options.helperName || 'boundIf';
- return bind.call(this, params[0], hash, options, env, true, shouldDisplayIfHelperContent, shouldDisplayIfHelperContent, [
- 'isTruthy',
- 'length'
- ]);
- }
-
- /**
- @private
-
- Use the `unboundIf` helper to create a conditional that evaluates once.
-
- ```handlebars
- {{#unboundIf "content.shouldDisplayTitle"}}
- {{content.title}}
- {{/unboundIf}}
- ```
-
- @method unboundIf
- @for Ember.Handlebars.helpers
- @param {String} property Property to bind
- @param {Function} fn Context to provide for rendering
- @return {String} HTML string
- @since 1.4.0
- */
- function unboundIfHelper(params, hash, options, env) {
- var template = options.template;
- var value = params[0];
-
- if (isStream(params[0])) {
- value = params[0].value();
- }
-
- if (!shouldDisplayIfHelperContent(value)) {
- template = options.inverse || EMPTY_TEMPLATE;
- }
-
- return template.render(this, env, options.morph.contextualElement);
- }
-
- function _inlineIfAssertion(params) {
- Ember.assert("If helper in inline form expects between two and three arguments", params.length === 2 || params.length === 3);
- }
-
- /**
- See [boundIf](/api/classes/Ember.Handlebars.helpers.html#method_boundIf)
- and [unboundIf](/api/classes/Ember.Handlebars.helpers.html#method_unboundIf)
-
- @method if
- @for Ember.Handlebars.helpers
- @param {Function} context
- @param {Hash} options
- @return {String} HTML string
- */
- function ifHelper(params, hash, options, env) {
- Ember.assert("If helper in block form expect exactly one argument", !options.template || params.length === 1);
-
- options.inverse = options.inverse || EMPTY_TEMPLATE;
-
- options.helperName = options.helperName || ('if ');
-
- if (env.data.isUnbound) {
- env.data.isUnbound = false;
- return env.helpers.unboundIf.helperFunction.call(this, params, hash, options, env);
- } else {
- return env.helpers.boundIf.helperFunction.call(this, params, hash, options, env);
- }
- }
-
- /**
- @method unless
- @for Ember.Handlebars.helpers
- @param {Function} context
- @param {Hash} options
- @return {String} HTML string
- */
- function unlessHelper(params, hash, options, env) {
- Ember.assert("You must pass exactly one argument to the unless helper", params.length === 1);
- Ember.assert("You must pass a block to the unless helper", !!options.template);
-
- var template = options.template;
- var inverse = options.inverse || EMPTY_TEMPLATE;
- var helperName = 'unless';
-
- options.template = inverse;
- options.inverse = template;
-
- options.helperName = options.helperName || helperName;
-
- if (env.data.isUnbound) {
- env.data.isUnbound = false;
- return env.helpers.unboundIf.helperFunction.call(this, params, hash, options, env);
- } else {
- return env.helpers.boundIf.helperFunction.call(this, params, hash, options, env);
- }
- }
-
- __exports__.ifHelper = ifHelper;
- __exports__.boundIfHelper = boundIfHelper;
- __exports__.unboundIfHelper = unboundIfHelper;
- __exports__.unlessHelper = unlessHelper;
- });
-enifed("ember-htmlbars/helpers/input",
- ["ember-views/views/checkbox","ember-views/views/text_field","ember-metal/streams/utils","ember-metal/core","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {
- "use strict";
- var Checkbox = __dependency1__["default"];
- var TextField = __dependency2__["default"];
- var read = __dependency3__.read;
-
- var Ember = __dependency4__["default"];
- // Ember.assert
-
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- /**
-
- The `{{input}}` helper inserts an HTML `` tag into the template,
- with a `type` value of either `text` or `checkbox`. If no `type` is provided,
- `text` will be the default value applied. The attributes of `{{input}}`
- match those of the native HTML tag as closely as possible for these two types.
-
- ## Use as text field
- An `{{input}}` with no `type` or a `type` of `text` will render an HTML text input.
- The following HTML attributes can be set via the helper:
-
-
-
`readonly`
`required`
`autofocus`
-
`value`
`placeholder`
`disabled`
-
`size`
`tabindex`
`maxlength`
-
`name`
`min`
`max`
-
`pattern`
`accept`
`autocomplete`
-
`autosave`
`formaction`
`formenctype`
-
`formmethod`
`formnovalidate`
`formtarget`
-
`height`
`inputmode`
`multiple`
-
`step`
`width`
`form`
-
`selectionDirection`
`spellcheck`
-
-
-
- When set to a quoted string, these values will be directly applied to the HTML
- element. When left unquoted, these values will be bound to a property on the
- template's current rendering context (most typically a controller instance).
-
- ## Unbound:
-
- ```handlebars
- {{input value="http://www.facebook.com"}}
- ```
-
-
- ```html
-
- ```
-
- ## Bound:
-
- ```javascript
- App.ApplicationController = Ember.Controller.extend({
- firstName: "Stanley",
- entryNotAllowed: true
- });
- ```
-
-
- ```handlebars
- {{input type="text" value=firstName disabled=entryNotAllowed size="50"}}
- ```
-
-
- ```html
-
- ```
-
- ## Actions
-
- The helper can send multiple actions based on user events.
-
- The action property defines the action which is sent when
- the user presses the return key.
-
- ```handlebars
- {{input action="submit"}}
- ```
-
- The helper allows some user events to send actions.
-
- * `enter`
- * `insert-newline`
- * `escape-press`
- * `focus-in`
- * `focus-out`
- * `key-press`
-
-
- For example, if you desire an action to be sent when the input is blurred,
- you only need to setup the action name to the event name property.
-
- ```handlebars
- {{input focus-in="alertMessage"}}
- ```
-
- See more about [Text Support Actions](/api/classes/Ember.TextField.html)
-
- ## Extension
-
- Internally, `{{input type="text"}}` creates an instance of `Ember.TextField`, passing
- arguments from the helper to `Ember.TextField`'s `create` method. You can extend the
- capabilities of text inputs in your applications by reopening this class. For example,
- if you are building a Bootstrap project where `data-*` attributes are used, you
- can add one to the `TextField`'s `attributeBindings` property:
-
-
- ```javascript
- Ember.TextField.reopen({
- attributeBindings: ['data-error']
- });
- ```
-
- Keep in mind when writing `Ember.TextField` subclasses that `Ember.TextField`
- itself extends `Ember.Component`, meaning that it does NOT inherit
- the `controller` of the parent view.
-
- See more about [Ember components](/api/classes/Ember.Component.html)
-
-
- ## Use as checkbox
-
- An `{{input}}` with a `type` of `checkbox` will render an HTML checkbox input.
- The following HTML attributes can be set via the helper:
-
- * `checked`
- * `disabled`
- * `tabindex`
- * `indeterminate`
- * `name`
- * `autofocus`
- * `form`
-
-
- When set to a quoted string, these values will be directly applied to the HTML
- element. When left unquoted, these values will be bound to a property on the
- template's current rendering context (most typically a controller instance).
-
- ## Unbound:
-
- ```handlebars
- {{input type="checkbox" name="isAdmin"}}
- ```
-
- ```html
-
- ```
-
- ## Bound:
-
- ```javascript
- App.ApplicationController = Ember.Controller.extend({
- isAdmin: true
- });
- ```
-
-
- ```handlebars
- {{input type="checkbox" checked=isAdmin }}
- ```
-
-
- ```html
-
- ```
-
- ## Extension
-
- Internally, `{{input type="checkbox"}}` creates an instance of `Ember.Checkbox`, passing
- arguments from the helper to `Ember.Checkbox`'s `create` method. You can extend the
- capablilties of checkbox inputs in your applications by reopening this class. For example,
- if you wanted to add a css class to all checkboxes in your application:
-
-
- ```javascript
- Ember.Checkbox.reopen({
- classNames: ['my-app-checkbox']
- });
- ```
-
-
- @method input
- @for Ember.Handlebars.helpers
- @param {Hash} options
- */
- function inputHelper(params, hash, options, env) {
- Ember.assert('You can only pass attributes to the `input` helper, not arguments', params.length === 0);
-
- var onEvent = hash.on;
- var inputType;
-
- inputType = read(hash.type);
-
- if (inputType === 'checkbox') {
- delete hash.type;
-
- Ember.assert("{{input type='checkbox'}} does not support setting `value=someBooleanValue`;" +
- " you must use `checked=someBooleanValue` instead.", !hash.hasOwnProperty('value'));
-
- env.helpers.view.helperFunction.call(this, [Checkbox], hash, options, env);
- } else {
- delete hash.on;
-
- hash.onEvent = onEvent || 'enter';
- env.helpers.view.helperFunction.call(this, [TextField], hash, options, env);
- }
- }
-
- __exports__.inputHelper = inputHelper;
- });
-enifed("ember-htmlbars/helpers/loc",
- ["ember-metal/core","ember-runtime/system/string","ember-metal/streams/utils","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __exports__) {
- "use strict";
- var Ember = __dependency1__["default"];
- var loc = __dependency2__.loc;
- var isStream = __dependency3__.isStream;
-
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- /**
- Calls [Ember.String.loc](/api/classes/Ember.String.html#method_loc) with the
- provided string.
-
- This is a convenient way to localize text within a template:
-
- ```javascript
- Ember.STRINGS = {
- '_welcome_': 'Bonjour'
- };
- ```
-
- ```handlebars
-
- {{loc '_welcome_'}}
-
- ```
-
- ```html
-
- Bonjour
-
- ```
-
- See [Ember.String.loc](/api/classes/Ember.String.html#method_loc) for how to
- set up localized string references.
-
- @method loc
- @for Ember.Handlebars.helpers
- @param {String} str The string to format
- @see {Ember.String#loc}
- */
- function locHelper(params, hash, options, env) {
- Ember.assert('You cannot pass bindings to `loc` helper', (function ifParamsContainBindings() {
- for (var i = 0, l = params.length; i < l; i++) {
- if (isStream(params[i])) {
- return false;
- }
- }
- return true;
- })());
-
- return loc.apply(this, params);
- }
-
- __exports__.locHelper = locHelper;
- });
-enifed("ember-htmlbars/helpers/log",
- ["ember-metal/logger","ember-metal/streams/utils","exports"],
- function(__dependency1__, __dependency2__, __exports__) {
- "use strict";
- /**
- @module ember
- @submodule ember-htmlbars
- */
- var Logger = __dependency1__["default"];
- var read = __dependency2__.read;
-
- /**
- `log` allows you to output the value of variables in the current rendering
- context. `log` also accepts primitive types such as strings or numbers.
-
- ```handlebars
- {{log "myVariable:" myVariable }}
- ```
-
- @method log
- @for Ember.Handlebars.helpers
- @param {String} property
- */
- function logHelper(params, hash, options, env) {
- var logger = Logger.log;
- var values = [];
-
- for (var i = 0; i < params.length; i++) {
- values.push(read(params[i]));
- }
-
- logger.apply(logger, values);
- }
-
- __exports__.logHelper = logHelper;
- });
-enifed("ember-htmlbars/helpers/partial",
- ["ember-metal/core","ember-metal/is_none","./binding","ember-metal/streams/utils","exports"],
- function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {
- "use strict";
- var Ember = __dependency1__["default"];
- // Ember.assert
-
- var isNone = __dependency2__["default"];
- var bind = __dependency3__.bind;
- var isStream = __dependency4__.isStream;
-
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- /**
- The `partial` helper renders another template without
- changing the template context:
-
- ```handlebars
- {{foo}}
- {{partial "nav"}}
- ```
-
- The above example template will render a template named
- "_nav", which has the same context as the parent template
- it's rendered into, so if the "_nav" template also referenced
- `{{foo}}`, it would print the same thing as the `{{foo}}`
- in the above example.
-
- If a "_nav" template isn't found, the `partial` helper will
- fall back to a template named "nav".
-
- ## Bound template names
-
- The parameter supplied to `partial` can also be a path
- to a property containing a template name, e.g.:
-
- ```handlebars
- {{partial someTemplateName}}
- ```
-
- The above example will look up the value of `someTemplateName`
- on the template context (e.g. a controller) and use that
- value as the name of the template to render. If the resolved
- value is falsy, nothing will be rendered. If `someTemplateName`
- changes, the partial will be re-rendered using the new template
- name.
-
-
- @method partial
- @for Ember.Handlebars.helpers
- @param {String} partialName the name of the template to render minus the leading underscore
- */
-
- function partialHelper(params, hash, options, env) {
- options.helperName = options.helperName || 'partial';
-
- var name = params[0];
-
- if (isStream(name)) {
- options.template = createPartialTemplate(name);
- bind.call(this, name, hash, options, env, true, exists);
- } else {
- return renderPartial(name, this, env, options.morph.contextualElement);
- }
- }
-
- __exports__.partialHelper = partialHelper;function exists(value) {
- return !isNone(value);
- }
-
- function lookupPartial(view, templateName) {
- var nameParts = templateName.split("/");
- var lastPart = nameParts[nameParts.length - 1];
-
- nameParts[nameParts.length - 1] = "_" + lastPart;
-
- var underscoredName = nameParts.join('/');
- var template = view.templateForName(underscoredName);
- if (!template) {
- template = view.templateForName(templateName);
- }
-
- Ember.assert('Unable to find partial with name "'+templateName+'"', !!template);
-
- return template;
- }
-
- function renderPartial(name, view, env, contextualElement) {
- var template = lookupPartial(view, name);
- return template.render(view, env, contextualElement);
- }
-
- function createPartialTemplate(nameStream) {
- return {
- isHTMLBars: true,
- render: function(view, env, contextualElement) {
- return renderPartial(nameStream.value(), view, env, contextualElement);
- }
- };
- }
- });
-enifed("ember-htmlbars/helpers/template",
- ["ember-metal/core","exports"],
- function(__dependency1__, __exports__) {
- "use strict";
- var Ember = __dependency1__["default"];
- // Ember.deprecate;
-
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- /**
- @deprecated
- @method template
- @for Ember.Handlebars.helpers
- @param {String} templateName the template to render
- */
- function templateHelper(params, hash, options, env) {
- Ember.deprecate("The `template` helper has been deprecated in favor of the `partial` helper." +
- " Please use `partial` instead, which will work the same way.");
-
- options.helperName = options.helperName || 'template';
-
- return env.helpers.partial.helperFunction.call(this, params, hash, options, env);
- }
-
- __exports__.templateHelper = templateHelper;
- });
-enifed("ember-htmlbars/helpers/text_area",
- ["ember-metal/core","ember-views/views/text_area","exports"],
- function(__dependency1__, __dependency2__, __exports__) {
- "use strict";
- /**
- @module ember
- @submodule ember-htmlbars
- */
-
- var Ember = __dependency1__["default"];
- // Ember.assert
- var TextArea = __dependency2__["default"];
-
- /**
- `{{textarea}}` inserts a new instance of `