Merge pull request #47 from Tibing/dev-editors

feat(app\pages): add editor page and ckeditor
This commit is contained in:
Dmitry 2016-07-01 12:54:42 +03:00 committed by GitHub
commit d27221c32a
10 changed files with 75 additions and 1 deletions

View file

@ -16,6 +16,7 @@
"tests" "tests"
], ],
"dependencies": { "dependencies": {
"Ionicons": "ionicons#~2.0.1" "Ionicons": "ionicons#~2.0.1",
"ckeditor": "^4.5.9"
} }
} }

View file

@ -35,6 +35,7 @@
"leaflet-map": "^0.2.1", "leaflet-map": "^0.2.1",
"lodash": "^4.12.0", "lodash": "^4.12.0",
"ng2-bootstrap": "^1.0.16", "ng2-bootstrap": "^1.0.16",
"ng2-ckeditor": "^1.0.3",
"normalize.css": "^4.1.1", "normalize.css": "^4.1.1",
"rxjs": "5.0.0-beta.6", "rxjs": "5.0.0-beta.6",
"tether": "^1.2.4", "tether": "^1.2.4",

View file

@ -7,6 +7,18 @@ export const menuItems = [
expanded: false, expanded: false,
order: 0 order: 0
}, },
{
title: 'Editors',
component: 'Editors',
icon: 'ion-edit',
order: 100,
subMenu: [
{
title: 'CKEditor',
component: 'Ckeditor'
}
]
},
{ {
title: 'Charts', title: 'Charts',
component: 'Charts', component: 'Charts',

View file

@ -0,0 +1,21 @@
import {Component} from '@angular/core';
import {CKEditor} from 'ng2-ckeditor';
import {BaCard} from "../../../../theme/components/baCard/baCard.component";
import './ckeditor.loader.ts';
@Component({
selector: 'ckeditor',
directives: [CKEditor, BaCard],
template: require('./ckeditor.html')
})
export class Ckeditor {
private ckeditorContent;
private config;
constructor() {
this.ckeditorContent = `<p>Hello CKEditor</p>`;
this.config = {uiColor: '#F0F3F4', height: '600'};
}
}

View file

@ -0,0 +1,7 @@
<div class="row">
<div class="col-md-12">
<ba-card title="ckeditor" baCardClass="with-scroll">
<ckeditor [(ngModel)]="ckeditorContent" [config]="config"></ckeditor>
</ba-card>
</div>
</div>

View file

@ -0,0 +1,2 @@
window.CKEDITOR_BASEPATH = '//cdn.ckeditor.com/4.5.9/standard/';
require('ckeditor');

View file

@ -0,0 +1 @@
export * from './ckeditor.component';

View file

@ -0,0 +1,22 @@
import {Component} from '@angular/core';
import {RouteConfig} from '@angular/router-deprecated';
import {Ckeditor} from "./components/ckeditor";
@Component({
selector: 'editors',
template: `<router-outlet></router-outlet>`
})
@RouteConfig([
{
name: 'Ckeditor',
component: Ckeditor,
path: '/ckeditor',
useAsDefault: true
}
])
export class Editors {
constructor() {
}
}

View file

@ -0,0 +1 @@
export * from './editors.component';

View file

@ -9,6 +9,7 @@ import {Maps} from './maps';
import {Charts} from './charts'; import {Charts} from './charts';
import {Forms} from './forms'; import {Forms} from './forms';
import {Tables} from './tables'; import {Tables} from './tables';
import {Editors} from "./editors";
@Component({ @Component({
selector: 'pages', selector: 'pages',
@ -40,6 +41,11 @@ import {Tables} from './tables';
` `
}) })
@RouteConfig([ @RouteConfig([
{
name: 'Editors',
component: Editors,
path: '/editors/...',
},
{ {
name: 'Dashboard', name: 'Dashboard',
component: Dashboard, component: Dashboard,