Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-document-title

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-document-title - npm Package Compare versions

Comparing version 0.0.3 to 0.1.0

config/ember-try.js

5

CHANGELOG.md

@@ -0,1 +1,6 @@

## 0.1.0
+ Removed another use of prototype extensions [#12](https://github.com/kimroen/ember-cli-document-title/pull/12)
+ Made sure use with Fastboot doesn't explode [#13](https://github.com/kimroen/ember-cli-document-title/pull/13)
+ Added testing of more Ember versions (1.10 and up)[#13](https://github.com/kimroen/ember-cli-document-title/pull/13)
## 0.0.3

@@ -2,0 +7,0 @@ + Re-did the addon structure to match newer addon conventions [#3](https://github.com/kimroen/ember-cli-document-title/pull/3)

5

package.json
{
"name": "ember-cli-document-title",
"version": "0.0.3",
"version": "0.1.0",
"description": "Adding document title functionality to your ember app",

@@ -30,4 +30,4 @@ "main": "index.js",

"ember-cli": "0.2.0-beta.1",
"ember-cli-app-version": "0.3.1",
"ember-cli-babel": "^4.0.0",
"ember-cli-app-version": "0.3.1",
"ember-cli-content-security-policy": "0.3.0",

@@ -42,2 +42,3 @@ "ember-cli-dependency-checker": "0.0.7",

"ember-export-application-global": "^1.0.2",
"ember-try": "0.0.5",
"express": "^4.8.5",

@@ -44,0 +45,0 @@ "glob": "^4.0.5"

22

README.md
# Sane Document Title [![Build Status](https://travis-ci.org/kimroen/ember-cli-document-title.svg?branch=master)](https://travis-ci.org/kimroen/ember-cli-document-title)
This addon adds sane `document.title` integration to your ember app.
All it does is include [this gist by @machty](https://gist.github.com/machty/8413411) to your application.
Originally based on [this gist by @machty](https://gist.github.com/machty/8413411), and since improved upon by many fabulous contributors.
Tested to work with Ember 1.10 and up.
## Install
Install by running
```
ember install:addon ember-cli-document-title
ember install ember-cli-document-title
```

@@ -40,3 +43,3 @@

export default Ember.Route.extend({
title: "Our Favorite posts!"
title: 'Our Favorite posts!'
});

@@ -46,3 +49,3 @@

export default Ember.Route.extend({
title: "Please enjoy this post"
title: 'Please enjoy this post'
});

@@ -58,3 +61,3 @@ ```

export default Ember.Route.extend({
titleToken: "Posts"
titleToken: 'Posts'
});

@@ -81,3 +84,3 @@ ```

Ember.Object.create({
name: "Ember is Omakase"
name: 'Ember is Omakase'
});

@@ -101,3 +104,3 @@ ```

export default Ember.Route.extend({
titleToken: "Posts"
titleToken: 'Posts'
});

@@ -112,3 +115,6 @@ ```

title: function(tokens) {
return tokens.reverse().join(' - ') + ' - My Blog';
var base = 'My Blog';
var hasTokens = tokens && tokens.length;
return hasTokens ? tokens.reverse().join(' - ') + ' - ' + base : base;
}

@@ -115,0 +121,0 @@ });

@@ -57,13 +57,15 @@ var get = Ember.get;

Ember.Router.reopen({
updateTitle: function() {
updateTitle: Ember.on('didTransition', function() {
this.send('collectTitleTokens', []);
}.on('didTransition'),
}),
setTitle: function(title) {
if (Ember.testing) {
this._title = title;
var renderer = this.container.lookup('renderer:-dom');
if (renderer) {
Ember.set(renderer, '_dom.document.title', title);
} else {
window.document.title = title;
document.title = title;
}
}
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc