3 |
4 |
12 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/Perplex.ContentBlocks.StaticAssets/src/App_Plugins/Perplex.ContentBlocks/components/perplex.content-blocks.add-block.js:
--------------------------------------------------------------------------------
1 | angular.module("perplexContentBlocks").component("perplexContentBlocksAddBlock", {
2 | templateUrl: "/App_Plugins/Perplex.ContentBlocks/components/perplex.content-blocks.add-block.html",
3 |
4 | bindings: {
5 | addBlock: "&",
6 | paste: "&",
7 | canPaste: "<",
8 | show: "<",
9 | isHeader: "<",
10 | noPaddingTop: "<",
11 | },
12 | });
13 |
--------------------------------------------------------------------------------
/src/Perplex.ContentBlocks.StaticAssets/src/App_Plugins/Perplex.ContentBlocks/components/perplex.content-blocks.custom-component.js:
--------------------------------------------------------------------------------
1 | angular.module("perplexContentBlocks").component("perplexContentBlocksCustomComponent", {
2 | bindings: {
3 | component: "<",
4 | data: "<",
5 | },
6 | controller: [
7 | "$scope",
8 | "$compile",
9 | "$element",
10 | function perplexContentBlocksCustomComponent($scope, $compile, $element) {
11 | this.$onInit = function () {
12 | if (this.component == null) {
13 | throw new Error("perplexContentBlocksCustomComponent: component binding is required but missing");
14 | }
15 |
16 | this.renderCustomComponent();
17 | }
18 |
19 | this.renderCustomComponent = function () {
20 | var params = this.data == null ? "" : " " + Object.keys(this.data).map(function (key) {
21 | return key + '="$ctrl.data[\'' + key + '\']"';
22 | }.bind(this)).join(" ");
23 |
24 | var template = '<' + this.component + params + '>' + this.component + '>';
25 |
26 | var compiled = $compile(template)($scope);
27 |
28 | $element.append(compiled);
29 | }
30 | },
31 | ],
32 | });
33 |
--------------------------------------------------------------------------------
/src/Perplex.ContentBlocks.StaticAssets/src/App_Plugins/Perplex.ContentBlocks/components/perplex.content-blocks.custom-components.js:
--------------------------------------------------------------------------------
1 | angular.module("perplexContentBlocks").constant("perplexContentBlocksCustomComponents", {
2 | block: {
3 | main: null,
4 | buttons: [],
5 | }
6 | });
7 |
--------------------------------------------------------------------------------
/src/Perplex.ContentBlocks.StaticAssets/src/App_Plugins/Perplex.ContentBlocks/components/perplex.content-blocks.icon.js:
--------------------------------------------------------------------------------
1 | angular.module("perplexContentBlocks").component("contentBlocksIcon", {
2 | template:
3 | '