Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #457 and make style consistent between firefox and chrome
- Loading branch information
Showing
8 changed files
with
101 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
module Core { | ||
|
||
export class PageTitle { | ||
|
||
private titleElements: { (): string } [] = []; | ||
|
||
public addTitleElement(element:() => string):void { | ||
this.titleElements.push(element); | ||
} | ||
|
||
public getTitle():string { | ||
return this.getTitleExcluding([], ' '); | ||
} | ||
|
||
public getTitleWithSeparator(separator:string):string { | ||
return this.getTitleExcluding([], separator); | ||
} | ||
|
||
public getTitleExcluding(excludes:string[], separator:string):string { | ||
return this.getTitleArrayExcluding(excludes).join(separator); | ||
} | ||
|
||
public getTitleArrayExcluding(excludes:string[]):string[] { | ||
return <string[]>this.titleElements.map((element):string => { | ||
var answer:string = ''; | ||
if (element) { | ||
answer = element(); | ||
if (answer === null) { | ||
return ''; | ||
} | ||
} | ||
return answer; | ||
}).exclude(excludes); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters