Skip to content

Commit

Permalink
Finish to review README and code for JSPM.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanneculai committed Jul 7, 2017
1 parent 8e87f54 commit f759d44
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 82 deletions.
19 changes: 1 addition & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ jspm install -y

```bash
jspm install aurelia-froala-editor
jspm install npm:froala-editor -o "{format: 'global'}"
```

- In your `src/main.js` or `src/main.ts` file add:
Expand All @@ -311,24 +312,6 @@ aurelia.use.plugin('aurelia-froala-editor');
<froala-editor></froala-editor>
```

- In `package.json` file add the following overrides to the `jspm` entry:

```json
"overrides": {
"npm:froala-editor@^2.6.0": {
"main": "js/froala-editor.min",
"format": "global",
"shim": {
"js/froala-editor.min": {
"deps": [
"jquery"
]
}
}
}
}
```

- In `build/bundles.js` add `aurelia-froala-editor` to `dist/aurelia` bundles:

```javascript
Expand Down
43 changes: 2 additions & 41 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ System.config({
babelOptions: {
"optional": [
"runtime",
"optimisation.modules.system",
"es7.decorators",
"es7.classProperties"
"optimisation.modules.system"
]
},
paths: {
Expand All @@ -16,12 +14,10 @@ System.config({

map: {
"aurelia-binding": "npm:[email protected]",
"aurelia-polyfills": "npm:[email protected]",
"aurelia-templating-resources": "npm:[email protected]",
"aurelia-dependency-injection": "npm:[email protected]",
"babel": "npm:[email protected]",
"babel-runtime": "npm:[email protected]",
"core-js": "npm:[email protected]",
"froala-editor": "npm:[email protected]",
"systemjs/plugin-css": "github:systemjs/[email protected]",
"github:jspm/[email protected]": {
"assert": "npm:[email protected]"
Expand Down Expand Up @@ -57,40 +53,12 @@ System.config({
"aurelia-metadata": "npm:[email protected]",
"aurelia-pal": "npm:[email protected]"
},
"npm:[email protected]": {
"aurelia-metadata": "npm:[email protected]",
"aurelia-path": "npm:[email protected]"
},
"npm:[email protected]": {
"aurelia-pal": "npm:[email protected]"
},
"npm:[email protected]": {
"aurelia-pal": "npm:[email protected]"
},
"npm:[email protected]": {
"aurelia-pal": "npm:[email protected]"
},
"npm:[email protected]": {
"aurelia-binding": "npm:[email protected]",
"aurelia-dependency-injection": "npm:[email protected]",
"aurelia-loader": "npm:[email protected]",
"aurelia-logging": "npm:[email protected]",
"aurelia-metadata": "npm:[email protected]",
"aurelia-pal": "npm:[email protected]",
"aurelia-path": "npm:[email protected]",
"aurelia-task-queue": "npm:[email protected]",
"aurelia-templating": "npm:[email protected]"
},
"npm:[email protected]": {
"aurelia-binding": "npm:[email protected]",
"aurelia-dependency-injection": "npm:[email protected]",
"aurelia-loader": "npm:[email protected]",
"aurelia-logging": "npm:[email protected]",
"aurelia-metadata": "npm:[email protected]",
"aurelia-pal": "npm:[email protected]",
"aurelia-path": "npm:[email protected]",
"aurelia-task-queue": "npm:[email protected]"
},
"npm:[email protected]": {
"process": "github:jspm/[email protected]"
},
Expand All @@ -104,13 +72,6 @@ System.config({
"process": "github:jspm/[email protected]",
"systemjs-json": "github:systemjs/[email protected]"
},
"npm:[email protected]": {
"css": "github:systemjs/[email protected]"
},
"npm:[email protected]": {
"font-awesome": "npm:[email protected]",
"jquery": "npm:[email protected]"
},
"npm:[email protected]": {
"util": "github:jspm/[email protected]"
},
Expand Down
6 changes: 3 additions & 3 deletions dist/amd/froala-editor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['exports', 'aurelia-framework', 'aurelia-binding', 'aurelia-event-aggregator', './froala-editor-config'], function (exports, _aureliaFramework, _aureliaBinding, _aureliaEventAggregator, _froalaEditorConfig) {
define(['exports', 'aurelia-framework', 'aurelia-binding', './froala-editor-config'], function (exports, _aureliaFramework, _aureliaBinding, _froalaEditorConfig) {
'use strict';

Object.defineProperty(exports, "__esModule", {
Expand Down Expand Up @@ -57,8 +57,8 @@ define(['exports', 'aurelia-framework', 'aurelia-binding', 'aurelia-event-aggreg

var _dec, _dec2, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3;

var FroalaEditor = exports.FroalaEditor = (_dec = (0, _aureliaFramework.customElement)('froala-editor'), _dec2 = (0, _aureliaFramework.inject)(Element, _froalaEditorConfig.Config, _aureliaBinding.ObserverLocator, _aureliaEventAggregator.EventAggregator), _dec(_class = _dec2(_class = (_class2 = function () {
function FroalaEditor(element, config, observerLocator, eventAggregator) {
var FroalaEditor = exports.FroalaEditor = (_dec = (0, _aureliaFramework.customElement)('froala-editor'), _dec2 = (0, _aureliaFramework.inject)(Element, _froalaEditorConfig.Config, _aureliaBinding.ObserverLocator), _dec(_class = _dec2(_class = (_class2 = function () {
function FroalaEditor(element, config, observerLocator) {
var _this = this;

_classCallCheck(this, FroalaEditor);
Expand Down
6 changes: 2 additions & 4 deletions dist/commonjs/froala-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ var _aureliaFramework = require('aurelia-framework');

var _aureliaBinding = require('aurelia-binding');

var _aureliaEventAggregator = require('aurelia-event-aggregator');

var _froalaEditorConfig = require('./froala-editor-config');

function _initDefineProp(target, property, descriptor, context) {
Expand Down Expand Up @@ -60,8 +58,8 @@ function _initializerWarningHelper(descriptor, context) {
throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
}

var FroalaEditor = exports.FroalaEditor = (_dec = (0, _aureliaFramework.customElement)('froala-editor'), _dec2 = (0, _aureliaFramework.inject)(Element, _froalaEditorConfig.Config, _aureliaBinding.ObserverLocator, _aureliaEventAggregator.EventAggregator), _dec(_class = _dec2(_class = (_class2 = function () {
function FroalaEditor(element, config, observerLocator, eventAggregator) {
var FroalaEditor = exports.FroalaEditor = (_dec = (0, _aureliaFramework.customElement)('froala-editor'), _dec2 = (0, _aureliaFramework.inject)(Element, _froalaEditorConfig.Config, _aureliaBinding.ObserverLocator), _dec(_class = _dec2(_class = (_class2 = function () {
function FroalaEditor(element, config, observerLocator) {
var _this = this;

_classCallCheck(this, FroalaEditor);
Expand Down
5 changes: 2 additions & 3 deletions dist/es2015/froala-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@ function _initializerWarningHelper(descriptor, context) {

import { inject, customElement, bindable } from 'aurelia-framework';
import { ObserverLocator } from "aurelia-binding";
import { EventAggregator } from 'aurelia-event-aggregator';

import { Config } from './froala-editor-config';

export let FroalaEditor = (_dec = customElement('froala-editor'), _dec2 = inject(Element, Config, ObserverLocator, EventAggregator), _dec(_class = _dec2(_class = (_class2 = class FroalaEditor {
export let FroalaEditor = (_dec = customElement('froala-editor'), _dec2 = inject(Element, Config, ObserverLocator), _dec(_class = _dec2(_class = (_class2 = class FroalaEditor {

constructor(element, config, observerLocator, eventAggregator) {
constructor(element, config, observerLocator) {
_initDefineProp(this, 'value', _descriptor, this);

_initDefineProp(this, 'config', _descriptor2, this);
Expand Down
10 changes: 4 additions & 6 deletions dist/system/froala-editor.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

System.register(['aurelia-framework', 'aurelia-binding', 'aurelia-event-aggregator', './froala-editor-config'], function (_export, _context) {
System.register(['aurelia-framework', 'aurelia-binding', './froala-editor-config'], function (_export, _context) {
"use strict";

var inject, customElement, bindable, ObserverLocator, EventAggregator, Config, _dec, _dec2, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, FroalaEditor;
var inject, customElement, bindable, ObserverLocator, Config, _dec, _dec2, _class, _desc, _value, _class2, _descriptor, _descriptor2, _descriptor3, FroalaEditor;

function _initDefineProp(target, property, descriptor, context) {
if (!descriptor) return;
Expand Down Expand Up @@ -61,14 +61,12 @@ System.register(['aurelia-framework', 'aurelia-binding', 'aurelia-event-aggregat
bindable = _aureliaFramework.bindable;
}, function (_aureliaBinding) {
ObserverLocator = _aureliaBinding.ObserverLocator;
}, function (_aureliaEventAggregator) {
EventAggregator = _aureliaEventAggregator.EventAggregator;
}, function (_froalaEditorConfig) {
Config = _froalaEditorConfig.Config;
}],
execute: function () {
_export('FroalaEditor', FroalaEditor = (_dec = customElement('froala-editor'), _dec2 = inject(Element, Config, ObserverLocator, EventAggregator), _dec(_class = _dec2(_class = (_class2 = function () {
function FroalaEditor(element, config, observerLocator, eventAggregator) {
_export('FroalaEditor', FroalaEditor = (_dec = customElement('froala-editor'), _dec2 = inject(Element, Config, ObserverLocator), _dec(_class = _dec2(_class = (_class2 = function () {
function FroalaEditor(element, config, observerLocator) {
var _this = this;

_classCallCheck(this, FroalaEditor);
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-froala-editor",
"version": "2.7.2_3",
"version": "2.7.3",
"description": "Aurelia plugin for Froala WYSIWYG HTML rich text editor.",
"keywords": [
"aurelia",
Expand Down Expand Up @@ -58,18 +58,18 @@
},
"dependencies": {
"froala-editor": "^2.6.0",
"aurelia-binding": "1.0.0",
"aurelia-binding": "^1.0.0",
"aurelia-dependency-injection": "^1.0.0"
},
"jspm": {
"jspmNodeConversion": false,
"main": "index",
"directories": {
"lib": "dist/system"
},
"dependencies": {
"aurelia-binding": "npm:aurelia-binding@^1.2.1",
"aurelia-templating-resources": "npm:aurelia-templating-resources@^1.4.0",
"froala-editor": "npm:froala-editor@^2.6.2",
"aurelia-dependency-injection": "npm:aurelia-dependency-injection@^1.3.1",
"systemjs/plugin-css": "github:systemjs/plugin-css@^0.1.35"
},
"devDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions src/froala-editor.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import {inject, customElement, bindable} from 'aurelia-framework';
import {ObserverLocator} from "aurelia-binding";
import {EventAggregator} from 'aurelia-event-aggregator';

import {Config} from './froala-editor-config';

@customElement('froala-editor')
@inject(Element, Config, ObserverLocator, EventAggregator)
@inject(Element, Config, ObserverLocator)
export class FroalaEditor {
@bindable value;
@bindable config = {}
Expand All @@ -14,7 +13,7 @@ export class FroalaEditor {
element;
instance;

constructor (element, config, observerLocator, eventAggregator) {
constructor (element, config, observerLocator) {
// Store element.
this.element = element;

Expand Down

0 comments on commit f759d44

Please sign in to comment.