Commit 3bc8e5e6004b4ba0bf63db875af316754c3bdef5
1 parent
ade7c078
Exists in
master
and in
9 other branches
Fix jslint whitespaces warnings
Showing
7 changed files
with
12 additions
and
13 deletions
Show diff stats
src/app/admin/layout-edit/designMode.service.spec.ts
| @@ -3,8 +3,7 @@ import {INoosferoLocalStorage} from "./../../shared/models/interfaces"; | @@ -3,8 +3,7 @@ import {INoosferoLocalStorage} from "./../../shared/models/interfaces"; | ||
| 3 | 3 | ||
| 4 | describe('DesignMode Service', () => { | 4 | describe('DesignMode Service', () => { |
| 5 | let service: DesignModeService; | 5 | let service: DesignModeService; |
| 6 | - | ||
| 7 | - let $localStorage = <INoosferoLocalStorage>{ currentUser: null, settings: { designMode: false } }; | 6 | + let $localStorage = <INoosferoLocalStorage>{ currentUser: null, settings: { designMode: false } }; |
| 8 | beforeEach(() => { | 7 | beforeEach(() => { |
| 9 | service = new DesignModeService($localStorage); | 8 | service = new DesignModeService($localStorage); |
| 10 | }); | 9 | }); |
| @@ -32,4 +31,4 @@ describe('DesignMode Service', () => { | @@ -32,4 +31,4 @@ describe('DesignMode Service', () => { | ||
| 32 | service.setInDesignMode(false); | 31 | service.setInDesignMode(false); |
| 33 | expect(service.onToggle.next).not.toHaveBeenCalled(); | 32 | expect(service.onToggle.next).not.toHaveBeenCalled(); |
| 34 | }); | 33 | }); |
| 35 | -}); | ||
| 36 | \ No newline at end of file | 34 | \ No newline at end of file |
| 35 | +}); |
src/app/admin/layout-edit/designMode.service.ts
| @@ -4,12 +4,13 @@ import {INoosferoLocalStorage} from "./../../shared/models/interfaces"; | @@ -4,12 +4,13 @@ import {INoosferoLocalStorage} from "./../../shared/models/interfaces"; | ||
| 4 | @Injectable() | 4 | @Injectable() |
| 5 | @Inject("$localStorage") | 5 | @Inject("$localStorage") |
| 6 | export class DesignModeService { | 6 | export class DesignModeService { |
| 7 | + | ||
| 7 | @Output() onToggle: EventEmitter<boolean> = new EventEmitter<boolean>(); | 8 | @Output() onToggle: EventEmitter<boolean> = new EventEmitter<boolean>(); |
| 8 | 9 | ||
| 9 | isInDesignMode(): boolean { | 10 | isInDesignMode(): boolean { |
| 10 | return this.$localStorage.settings.designModeOn; | 11 | return this.$localStorage.settings.designModeOn; |
| 11 | } | 12 | } |
| 12 | - | 13 | + |
| 13 | destroy() { | 14 | destroy() { |
| 14 | delete this.$localStorage.settings; | 15 | delete this.$localStorage.settings; |
| 15 | this.$localStorage.settings = {}; | 16 | this.$localStorage.settings = {}; |
src/app/admin/layout-edit/designModeToggler.component.ts
| 1 | import {Component, Inject} from 'ng-forward'; | 1 | import {Component, Inject} from 'ng-forward'; |
| 2 | import {DesignModeService} from './designMode.service'; | 2 | import {DesignModeService} from './designMode.service'; |
| 3 | -import {AuthService, AuthEvents} from '../../login' | 3 | +import {AuthService, AuthEvents} from '../../login'; |
| 4 | 4 | ||
| 5 | @Component({ | 5 | @Component({ |
| 6 | selector: 'noosfero-design-toggler', | 6 | selector: 'noosfero-design-toggler', |
| @@ -26,4 +26,4 @@ export class DesignModeTogglerComponent { | @@ -26,4 +26,4 @@ export class DesignModeTogglerComponent { | ||
| 26 | set inDesignMode(value: boolean) { | 26 | set inDesignMode(value: boolean) { |
| 27 | this.designModeService.setInDesignMode(value); | 27 | this.designModeService.setInDesignMode(value); |
| 28 | }; | 28 | }; |
| 29 | -} | ||
| 30 | \ No newline at end of file | 29 | \ No newline at end of file |
| 30 | +} |
src/app/layout/blocks/block.component.spec.ts
| @@ -43,7 +43,6 @@ describe("Boxes Component", () => { | @@ -43,7 +43,6 @@ describe("Boxes Component", () => { | ||
| 43 | let blockService = jasmine.createSpyObj("blockService", ["update"]); | 43 | let blockService = jasmine.createSpyObj("blockService", ["update"]); |
| 44 | let state = jasmine.createSpyObj("state", ["current"]); | 44 | let state = jasmine.createSpyObj("state", ["current"]); |
| 45 | state.current = { name: "" }; | 45 | state.current = { name: "" }; |
| 46 | - | ||
| 47 | 46 | ||
| 48 | it("set isHomepage as false by default", () => { | 47 | it("set isHomepage as false by default", () => { |
| 49 | expect(helper.component.isHomepage).toBeFalsy(); | 48 | expect(helper.component.isHomepage).toBeFalsy(); |
src/app/layout/blocks/block.component.ts
| @@ -11,8 +11,8 @@ import { DesignModeService } from "../../admin/layout-edit/designMode.service"; | @@ -11,8 +11,8 @@ import { DesignModeService } from "../../admin/layout-edit/designMode.service"; | ||
| 11 | templateUrl: 'app/layout/blocks/block.html', | 11 | templateUrl: 'app/layout/blocks/block.html', |
| 12 | directives: [BlockEditionComponent] | 12 | directives: [BlockEditionComponent] |
| 13 | }) | 13 | }) |
| 14 | -@Inject("$uibModal", "$scope", "$state", "$rootScope", BlockService, NotificationService, | ||
| 15 | -AuthService, SessionService, TranslatorService, DesignModeService) | 14 | +@Inject("$uibModal", "$scope", "$state", "$rootScope", BlockService, NotificationService, |
| 15 | + AuthService, SessionService, TranslatorService, DesignModeService) | ||
| 16 | export class BlockComponent { | 16 | export class BlockComponent { |
| 17 | 17 | ||
| 18 | @Input() block: noosfero.Block; | 18 | @Input() block: noosfero.Block; |
src/app/layout/services/body-state-classes.service.spec.ts
| @@ -22,7 +22,6 @@ describe("BodyStateClasses Service", () => { | @@ -22,7 +22,6 @@ describe("BodyStateClasses Service", () => { | ||
| 22 | authService: any = helpers.mocks.authService, | 22 | authService: any = helpers.mocks.authService, |
| 23 | bodyEl: { className: string }, | 23 | bodyEl: { className: string }, |
| 24 | bodyElJq: any, | 24 | bodyElJq: any, |
| 25 | - | ||
| 26 | designModeService = new DesignModeService($localStorage); | 25 | designModeService = new DesignModeService($localStorage); |
| 27 | 26 | ||
| 28 | 27 | ||
| @@ -177,7 +176,7 @@ describe("BodyStateClasses Service", () => { | @@ -177,7 +176,7 @@ describe("BodyStateClasses Service", () => { | ||
| 177 | 176 | ||
| 178 | it("should add the class noosfero-design-on when designMode is changed to true", () => { | 177 | it("should add the class noosfero-design-on when designMode is changed to true", () => { |
| 179 | let fnOnToggle: Function = null; | 178 | let fnOnToggle: Function = null; |
| 180 | - designModeService.onToggle = <any> { | 179 | + designModeService.onToggle = <any>{ |
| 181 | subscribe: (fn: Function) => { | 180 | subscribe: (fn: Function) => { |
| 182 | fnOnToggle = fn; | 181 | fnOnToggle = fn; |
| 183 | }, | 182 | }, |
src/app/profile/custom-content/custom-content.component.ts
| @@ -12,7 +12,8 @@ import {DesignModeService} from '../../admin/layout-edit/designMode.service'; | @@ -12,7 +12,8 @@ import {DesignModeService} from '../../admin/layout-edit/designMode.service'; | ||
| 12 | @Inject("$uibModal", "$scope", ProfileService, NotificationService, DesignModeService) | 12 | @Inject("$uibModal", "$scope", ProfileService, NotificationService, DesignModeService) |
| 13 | export class CustomContentComponent { | 13 | export class CustomContentComponent { |
| 14 | 14 | ||
| 15 | - static $inject = ["DesignModeService"]; // @Inject doesn't works with uibModal.open | 15 | + // @Inject doesn't works with uibModal.open |
| 16 | + static $inject = ["DesignModeService"]; | ||
| 16 | 17 | ||
| 17 | @Input() attribute: string; | 18 | @Input() attribute: string; |
| 18 | @Input() profile: noosfero.Profile; | 19 | @Input() profile: noosfero.Profile; |
| @@ -35,7 +36,7 @@ export class CustomContentComponent { | @@ -35,7 +36,7 @@ export class CustomContentComponent { | ||
| 35 | if (this.profile) this.content = (<any>this.profile)[this.attribute]; | 36 | if (this.profile) this.content = (<any>this.profile)[this.attribute]; |
| 36 | }); | 37 | }); |
| 37 | } | 38 | } |
| 38 | - | 39 | + |
| 39 | inEditMode() { | 40 | inEditMode() { |
| 40 | return this.designModeService.isInDesignMode(); | 41 | return this.designModeService.isInDesignMode(); |
| 41 | } | 42 | } |