From 4b4877ed90c439c5bf7d645bc7348b9b3ec69109 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Tue, 5 Apr 2016 14:52:08 -0300 Subject: [PATCH] Load components defined in plugins --- src/app/main/main.component.ts | 3 ++- src/plugins/comment_paragraph/allow-comment/allow-comment.component.ts | 16 ++++++++++++++++ src/plugins/comment_paragraph/allow-comment/allow-comment.html | 2 ++ src/plugins/comment_paragraph/index.ts | 3 +++ src/plugins/index.ts | 4 ++++ 5 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/plugins/comment_paragraph/allow-comment/allow-comment.component.ts create mode 100644 src/plugins/comment_paragraph/allow-comment/allow-comment.html create mode 100644 src/plugins/comment_paragraph/index.ts create mode 100644 src/plugins/index.ts diff --git a/src/app/main/main.component.ts b/src/app/main/main.component.ts index 89720ff..6dd5363 100644 --- a/src/app/main/main.component.ts +++ b/src/app/main/main.component.ts @@ -33,6 +33,7 @@ import {SidebarComponent} from "../layout/sidebar/sidebar.component"; import {MainBlockComponent} from "../layout/blocks/main-block/main-block.component"; import {HtmlEditorComponent} from "../shared/components/html-editor/html-editor.component"; +import * as plugins from "../../plugins"; /** * @ngdoc controller @@ -93,7 +94,7 @@ export class EnvironmentContent { LinkListBlockComponent, CommunitiesBlockComponent, HtmlEditorComponent, MainBlockComponent, RecentDocumentsBlockComponent, Navbar, SidebarComponent, ProfileImageBlockComponent, MembersBlockComponent, NoosferoTemplate, DateFormat, RawHTMLBlockComponent - ], + ].concat(plugins.mainComponents), providers: [AuthService, SessionService, NotificationService, BodyStateClassesService] }) @StateConfig([ diff --git a/src/plugins/comment_paragraph/allow-comment/allow-comment.component.ts b/src/plugins/comment_paragraph/allow-comment/allow-comment.component.ts new file mode 100644 index 0000000..cb75190 --- /dev/null +++ b/src/plugins/comment_paragraph/allow-comment/allow-comment.component.ts @@ -0,0 +1,16 @@ +import {Component, Input} from "ng-forward"; + +@Component({ + selector: "comment-paragraph-plugin-allow-comment", + templateUrl: "plugins/comment_paragraph/allow-comment/allow-comment.html" +}) +export class AllowComment { + + @Input() content: string; + @Input() paragraphUuid: string; + @Input() article: noosfero.Article; + + constructor() { + console.log("ALLOW COMMENT"); + } +} diff --git a/src/plugins/comment_paragraph/allow-comment/allow-comment.html b/src/plugins/comment_paragraph/allow-comment/allow-comment.html new file mode 100644 index 0000000..053e139 --- /dev/null +++ b/src/plugins/comment_paragraph/allow-comment/allow-comment.html @@ -0,0 +1,2 @@ +
+
diff --git a/src/plugins/comment_paragraph/index.ts b/src/plugins/comment_paragraph/index.ts new file mode 100644 index 0000000..1c1b4c6 --- /dev/null +++ b/src/plugins/comment_paragraph/index.ts @@ -0,0 +1,3 @@ +import {AllowComment} from "./allow-comment/allow-comment.component"; + +export let mainComponents: any = [AllowComment]; diff --git a/src/plugins/index.ts b/src/plugins/index.ts new file mode 100644 index 0000000..1a13cab --- /dev/null +++ b/src/plugins/index.ts @@ -0,0 +1,4 @@ +import * as commentParagraph from "./comment_paragraph"; + +export let mainComponents: any = []; +mainComponents = mainComponents.concat(commentParagraph.mainComponents); -- libgit2 0.21.2