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