mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
first commit document viewer scaffold
This commit is contained in:
15
ng2-components/ng2-alfresco-viewer/.editorconfig
Normal file
15
ng2-components/ng2-alfresco-viewer/.editorconfig
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# http://editorconfig.org
|
||||||
|
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
insert_final_newline = false
|
||||||
|
trim_trailing_whitespace = false
|
9
ng2-components/ng2-alfresco-viewer/.gitignore
vendored
Normal file
9
ng2-components/ng2-alfresco-viewer/.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
npm-debug.log
|
||||||
|
node_modules
|
||||||
|
jspm_packages
|
||||||
|
.idea
|
||||||
|
typings
|
||||||
|
coverage
|
||||||
|
dist
|
||||||
|
src/**/*.js
|
||||||
|
src/**/*.js.map
|
12
ng2-components/ng2-alfresco-viewer/.travis.yml
Normal file
12
ng2-components/ng2-alfresco-viewer/.travis.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- v5
|
||||||
|
- v4
|
||||||
|
- '0.12'
|
||||||
|
- '0.10'
|
||||||
|
install: npm install
|
||||||
|
sudo: false
|
||||||
|
after_success:
|
||||||
|
npm run coverage
|
||||||
|
# Send coverage data to Coveralls
|
||||||
|
after_script: "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"
|
13
ng2-components/ng2-alfresco-viewer/LICENSE
Normal file
13
ng2-components/ng2-alfresco-viewer/LICENSE
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
Copyright 2016 Eugenio Romano <eugenio.romano@alfresco.com> (www.alfresco.com)
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
81
ng2-components/ng2-alfresco-viewer/README.md
Normal file
81
ng2-components/ng2-alfresco-viewer/README.md
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
# <ng-2-alfresco-viewer>
|
||||||
|
[![NPM version][npm-image]][npm-url]
|
||||||
|
[![Build Status][travis-image]][travis-url]
|
||||||
|
[![Dependency Status][daviddm-image]][daviddm-url]
|
||||||
|
[![Coverage percentage][coveralls-image]][coveralls-url]
|
||||||
|
[![Style guide][style-image]][style-url]
|
||||||
|
[![Alfresco component][alfrescocomponent-image]][alfrescocomponent-url]
|
||||||
|
|
||||||
|
## About ng-2-alfresco-viewer
|
||||||
|
> Alfresco documents viewer
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install ng-2-alfresco-viewer --save
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```html
|
||||||
|
<ng-2-alfresco-viewer></ng-2-alfresco-viewer>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Reference
|
||||||
|
|
||||||
|
Attribute | Options | Default | Description
|
||||||
|
--- | --- | --- | ---
|
||||||
|
`foo` | *string* | `bar` | Lorem ipsum dolor.
|
||||||
|
|
||||||
|
|
||||||
|
Method | Parameters | Returns | Description
|
||||||
|
--- | --- | --- | ---
|
||||||
|
`methodName()` | None. | void | Lorem ipsum dolor.
|
||||||
|
|
||||||
|
## Develop command list
|
||||||
|
|
||||||
|
* To test your project
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm run test
|
||||||
|
```
|
||||||
|
|
||||||
|
* To run the test coverage
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm run coverage
|
||||||
|
```
|
||||||
|
|
||||||
|
* To build the distribution files before releasing a new version.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm run start
|
||||||
|
```
|
||||||
|
|
||||||
|
* To provide a live demo
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ npm run deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
## History
|
||||||
|
|
||||||
|
For detailed changelog, check [Releases](https://github.com/alfresco/ng-2-alfresco-viewer/releases).
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
[Contributors](https://github.com/alfresco/ng-2-alfresco-viewer/graphs/contributors)
|
||||||
|
|
||||||
|
|
||||||
|
[npm-image]: https://badge.fury.io/js/ng-2-alfresco-viewer.svg
|
||||||
|
[npm-url]: https://npmjs.org/package/ng-2-alfresco-viewer
|
||||||
|
[travis-image]: https://travis-ci.org/alfresco/ng-2-alfresco-viewer.svg?branch=master
|
||||||
|
[travis-url]: https://travis-ci.org/alfresco/ng-2-alfresco-viewer
|
||||||
|
[daviddm-image]: https://david-dm.org/alfresco/ng-2-alfresco-viewer.svg?theme=shields.io
|
||||||
|
[daviddm-url]: https://david-dm.org/alfresco/ng-2-alfresco-viewer
|
||||||
|
[coveralls-image]: https://coveralls.io/repos/alfresco/ng-2-alfresco-viewer/badge.svg
|
||||||
|
[coveralls-url]: https://coveralls.io/r/alfresco/ng-2-alfresco-viewer
|
||||||
|
[style-url]: https://github.com/mgechev/angular2-style-guide
|
||||||
|
[style-image]: https://mgechev.github.io/angular2-style-guide/images/badge.svg
|
||||||
|
[alfrescocomponent-image]: https://img.shields.io/badge/Alfresco%20component-approved-green.svg
|
||||||
|
[alfrescocomponent-url]: https://www.alfresco.com
|
16
ng2-components/ng2-alfresco-viewer/assets/license_header.txt
Normal file
16
ng2-components/ng2-alfresco-viewer/assets/license_header.txt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
21
ng2-components/ng2-alfresco-viewer/demo/app/main.ts
Normal file
21
ng2-components/ng2-alfresco-viewer/demo/app/main.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {bootstrap} from 'angular2/platform/browser';
|
||||||
|
import {Ng2AlfrescoViewerComponent} from '../../src/ng-2-alfresco-viewer.component';
|
||||||
|
|
||||||
|
bootstrap(Ng2AlfrescoViewerComponent);
|
33
ng2-components/ng2-alfresco-viewer/demo/demo.html
Normal file
33
ng2-components/ng2-alfresco-viewer/demo/demo.html
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ng-2-alfresco-viewer Angular 2</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<!-- 1. Load libraries -->
|
||||||
|
<!-- IE required polyfills, in this exact order -->
|
||||||
|
<script src="../node_modules/es6-shim/es6-shim.min.js"></script>
|
||||||
|
<script src="../node_modules/systemjs/dist/system-polyfills.js"></script>
|
||||||
|
<script src="../node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
|
||||||
|
<script src="../node_modules/angular2/bundles/angular2-polyfills.js"></script>
|
||||||
|
<script src="../node_modules/systemjs/dist/system.src.js"></script>
|
||||||
|
<script src="../node_modules/rxjs/bundles/Rx.js"></script>
|
||||||
|
<script src="../node_modules/angular2/bundles/angular2.dev.js"></script>
|
||||||
|
<script>
|
||||||
|
// #2. Configure systemjs to use the .js extension
|
||||||
|
// for imports from the app folder
|
||||||
|
System.config({
|
||||||
|
packages: {
|
||||||
|
'app': {defaultExtension: 'js'},
|
||||||
|
'../src': {defaultExtension: 'js'}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// #3. Import the spec file explicitly
|
||||||
|
System.import('app/main')
|
||||||
|
.then(null, console.error.bind(console));
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<!-- 3. Display the application -->
|
||||||
|
<body>
|
||||||
|
<ng-2-alfresco-viewer>Loading...</ng-2-alfresco-viewer>
|
||||||
|
</body>
|
||||||
|
</html>
|
74
ng2-components/ng2-alfresco-viewer/karma-test-shim.js
Normal file
74
ng2-components/ng2-alfresco-viewer/karma-test-shim.js
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
// Tun on full stack traces in errors to help debugging
|
||||||
|
Error.stackTraceLimit = Infinity;
|
||||||
|
|
||||||
|
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;
|
||||||
|
|
||||||
|
// // Cancel Karma's synchronous start,
|
||||||
|
// // we will call `__karma__.start()` later, once all the specs are loaded.
|
||||||
|
__karma__.loaded = function() {};
|
||||||
|
|
||||||
|
System.config({
|
||||||
|
packages: {
|
||||||
|
'base/dist': {
|
||||||
|
defaultExtension: 'js',
|
||||||
|
format: 'register',
|
||||||
|
map: Object.keys(window.__karma__.files).filter(onlyAppFiles).reduce(createPathRecords, {})
|
||||||
|
},
|
||||||
|
'ng2-translate': {
|
||||||
|
defaultExtension: 'js',
|
||||||
|
format: 'register'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
map: {
|
||||||
|
'ng2-translate': '/base/node_modules/ng2-translate/bundles'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
System.import('angular2/src/platform/browser/browser_adapter')
|
||||||
|
.then(function(browser_adapter) { browser_adapter.BrowserDomAdapter.makeCurrent(); })
|
||||||
|
.then(function() { return Promise.all(resolveTestFiles()); })
|
||||||
|
.then(
|
||||||
|
function() {
|
||||||
|
__karma__.start();
|
||||||
|
},
|
||||||
|
function(error) {
|
||||||
|
__karma__.error(error.stack || error);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
function createPathRecords(pathsMapping, appPath) {
|
||||||
|
// creates local module name mapping to global path with karma's fingerprint in path, e.g.:
|
||||||
|
// './vg-player/vg-player':
|
||||||
|
// '/base/dist/vg-player/vg-player.js?f4523daf879cfb7310ef6242682ccf10b2041b3e'
|
||||||
|
var moduleName = './' + resolveKeyPathForMapping('base/dist/', appPath);
|
||||||
|
moduleName = moduleName.replace(/\.js$/, '');
|
||||||
|
pathsMapping[moduleName] = appPath + '?' + window.__karma__.files[appPath];
|
||||||
|
return pathsMapping;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onlyAppFiles(filePath) {
|
||||||
|
return /\/base\/dist\/(?!.*\.spec\.js$).*\.js$/.test(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onlySpecFiles(path) {
|
||||||
|
return /\.spec\.js$/.test(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveTestFiles() {
|
||||||
|
return Object.keys(window.__karma__.files) // All files served by Karma.
|
||||||
|
.filter(onlySpecFiles)
|
||||||
|
.map(function(moduleName) {
|
||||||
|
// loads all spec files via their global module names (e.g.
|
||||||
|
// 'base/dist/vg-player/vg-player.spec')
|
||||||
|
return System.import(moduleName);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveKeyPathForMapping(basePathWhereToStart, appPath) {
|
||||||
|
var location = appPath.indexOf(basePathWhereToStart);
|
||||||
|
if (location > -1) {
|
||||||
|
return appPath.substring(basePathWhereToStart.length + 1);
|
||||||
|
} else {
|
||||||
|
return appPath;
|
||||||
|
}
|
||||||
|
}
|
78
ng2-components/ng2-alfresco-viewer/karma.conf.js
Normal file
78
ng2-components/ng2-alfresco-viewer/karma.conf.js
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
module.exports = function (config) {
|
||||||
|
config.set({
|
||||||
|
|
||||||
|
basePath: '.',
|
||||||
|
|
||||||
|
frameworks: ['jasmine'],
|
||||||
|
|
||||||
|
files: [
|
||||||
|
// paths loaded by Karma
|
||||||
|
{pattern: 'node_modules/angular2/bundles/angular2-polyfills.js', included: true, watched: false},
|
||||||
|
{pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: false},
|
||||||
|
{pattern: 'node_modules/rxjs/bundles/Rx.js', included: true, watched: false},
|
||||||
|
{pattern: 'node_modules/angular2/bundles/angular2.dev.js', included: true, watched: false},
|
||||||
|
{pattern: 'node_modules/angular2/bundles/testing.dev.js', included: true, watched: false},
|
||||||
|
{pattern: 'node_modules/angular2/bundles/http.dev.js', included: true, watched: false},
|
||||||
|
{pattern: 'node_modules/angular2/bundles/router.dev.js', included: true, watched: false},
|
||||||
|
{pattern: 'node_modules/alfresco-core-rest-api/bundle.js', included: true, watched: false},
|
||||||
|
{pattern: 'node_modules/ng2-translate/bundles/ng2-translate.js', included: true, watched: false},
|
||||||
|
|
||||||
|
{pattern: 'karma-test-shim.js', included: true, watched: true},
|
||||||
|
|
||||||
|
// paths loaded via module imports
|
||||||
|
{pattern: 'dist/**/*.js', included: false, watched: true},
|
||||||
|
{pattern: 'dist/**/*.html', included: true, served: true, watched: true},
|
||||||
|
{pattern: 'dist/**/*.css', included: true, served: true, watched: true},
|
||||||
|
|
||||||
|
// paths to support debugging with source maps in dev tools
|
||||||
|
{pattern: 'src/**/*.ts', included: false, watched: false},
|
||||||
|
{pattern: 'dist/**/*.js.map', included: false, watched: false}
|
||||||
|
],
|
||||||
|
|
||||||
|
// proxied base paths
|
||||||
|
proxies: {
|
||||||
|
// required for component assets fetched by Angular's compiler
|
||||||
|
'/src/': '/base/src/'
|
||||||
|
},
|
||||||
|
|
||||||
|
port: 9876,
|
||||||
|
|
||||||
|
// level of logging
|
||||||
|
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||||
|
logLevel: config.LOG_INFO,
|
||||||
|
|
||||||
|
colors: true,
|
||||||
|
|
||||||
|
autoWatch: true,
|
||||||
|
|
||||||
|
browsers: ['Chrome'],
|
||||||
|
|
||||||
|
// Karma plugins loaded
|
||||||
|
plugins: [
|
||||||
|
'karma-jasmine',
|
||||||
|
'karma-coverage',
|
||||||
|
'karma-chrome-launcher',
|
||||||
|
'karma-mocha-reporter'
|
||||||
|
],
|
||||||
|
|
||||||
|
// Coverage reporter generates the coverage
|
||||||
|
reporters: ['mocha', 'coverage'],
|
||||||
|
|
||||||
|
// Source files that you wanna generate coverage for.
|
||||||
|
// Do not include tests or libraries (these files will be instrumented by Istanbul)
|
||||||
|
preprocessors: {
|
||||||
|
'dist/**/!(*spec).js': ['coverage']
|
||||||
|
},
|
||||||
|
|
||||||
|
coverageReporter: {
|
||||||
|
dir: 'coverage/',
|
||||||
|
reporters: [
|
||||||
|
{type: 'text-summary'},
|
||||||
|
{type: 'json', subdir: '.', file: 'coverage-final.json'},
|
||||||
|
{type: 'html'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
18
ng2-components/ng2-alfresco-viewer/ng-2-alfresco-viewer.ts
Normal file
18
ng2-components/ng2-alfresco-viewer/ng-2-alfresco-viewer.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
export * from './src/ng-2-alfresco-viewer.component';
|
88
ng2-components/ng2-alfresco-viewer/package.json
Normal file
88
ng2-components/ng2-alfresco-viewer/package.json
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
{
|
||||||
|
"keywords": [
|
||||||
|
"viewer",
|
||||||
|
"pdf",
|
||||||
|
"alfresco-component"
|
||||||
|
],
|
||||||
|
"name": "ng-2-alfresco-viewer",
|
||||||
|
"description": "Alfresco documents viewer",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"author": "Eugenio Romano",
|
||||||
|
"scripts": {
|
||||||
|
"postinstall": "npm run typings",
|
||||||
|
"typings": "typings install",
|
||||||
|
"start": "npm run test && http-server -c-1 -o -p 8875 .",
|
||||||
|
"build": "npm run tslint && typings install && rm -rf dist && tsc && npm run copytemplates && license-check",
|
||||||
|
"tslint": "npm run tslint-test && npm run tslint-src && npm run tslint-root",
|
||||||
|
"tslint-test": "tslint -c tslint.json test/**/*.ts",
|
||||||
|
"tslint-src": "tslint -c tslint.json src/**/*.ts",
|
||||||
|
"tslint-root": "tslint -c tslint.json *.ts",
|
||||||
|
"copytemplates": "npm run copy-html && npm run copy-css",
|
||||||
|
"copy-html": "copyfiles './src/**/*.html' dist",
|
||||||
|
"copy-css": "copyfiles './src/**/*.css' dist",
|
||||||
|
"licensecheck": "license-check",
|
||||||
|
"tsc": "tsc",
|
||||||
|
"pretest": "npm run build",
|
||||||
|
"test": "karma start karma.conf.js",
|
||||||
|
"posttest": "node_modules/.bin/remap-istanbul -i coverage/coverage-final.json -o coverage -t html",
|
||||||
|
"coverage": "http-server -c-1 -o -p 9875 ./coverage"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/alfresco/ng-2-alfresco-viewer.git"
|
||||||
|
},
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/alfresco/ng-2-alfresco-viewer/issues"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"angular2": "2.0.0-beta.15",
|
||||||
|
"systemjs": "0.19.26",
|
||||||
|
"es6-shim": "^0.35.0",
|
||||||
|
"es6-module-loader": "^0.17.8",
|
||||||
|
"reflect-metadata": "0.1.2",
|
||||||
|
"rxjs": "5.0.0-beta.2",
|
||||||
|
"zone.js": "^0.6.12",
|
||||||
|
"ng2-translate": "^1.11.2",
|
||||||
|
"alfresco-core-rest-api": "https://github.com/Alfresco/dev-platform-js-api"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"angular2": "2.0.0-beta.15"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"copyfiles": "^0.2.1",
|
||||||
|
"coveralls": "^2.11.9",
|
||||||
|
"codelyzer": "0.0.19",
|
||||||
|
"http-server": "0.8.5",
|
||||||
|
"jasmine-core": "2.4.1",
|
||||||
|
"karma": "~0.12.0",
|
||||||
|
"karma-chrome-launcher": "~1.0.1",
|
||||||
|
"karma-coverage": "^1.0.0",
|
||||||
|
"karma-jasmine": "~1.0.2",
|
||||||
|
"karma-jasmine-ajax": "0.1.12",
|
||||||
|
"karma-mocha-reporter": "^2.0.3",
|
||||||
|
"license-check": "^1.0.4",
|
||||||
|
"remap-istanbul": "^0.6.3",
|
||||||
|
"traceur": "^0.0.91",
|
||||||
|
"tslint": "^3.8.1",
|
||||||
|
"typescript": "^1.8.10",
|
||||||
|
"typings": "^0.7.12",
|
||||||
|
"xo": "^0.14.0",
|
||||||
|
"yargs": "^4.7.0"
|
||||||
|
},
|
||||||
|
"license-check-config": {
|
||||||
|
"src": [
|
||||||
|
"**/*.js",
|
||||||
|
"**/*.ts",
|
||||||
|
"!/**/coverage/**/*",
|
||||||
|
"!/**/demo/**/*",
|
||||||
|
"!/**/node_modules/**/*",
|
||||||
|
"!/**/typings/**/*",
|
||||||
|
"!*.js"
|
||||||
|
],
|
||||||
|
"path": "assets/license_header.txt",
|
||||||
|
"blocking": false,
|
||||||
|
"logInfo": false,
|
||||||
|
"logError": true
|
||||||
|
},
|
||||||
|
"license": "Apache-2.0"
|
||||||
|
}
|
@@ -0,0 +1,34 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {describe, expect, it, injectAsync, TestComponentBuilder, setBaseTestProviders} from 'angular2/testing';
|
||||||
|
import {TEST_BROWSER_PLATFORM_PROVIDERS, TEST_BROWSER_APPLICATION_PROVIDERS} from 'angular2/platform/testing/browser';
|
||||||
|
import {Ng2AlfrescoViewerComponent} from '../src/ng-2-alfresco-viewer.component';
|
||||||
|
|
||||||
|
describe('Basic Example test ng-2-alfresco-viewer', () => {
|
||||||
|
setBaseTestProviders(TEST_BROWSER_PLATFORM_PROVIDERS, TEST_BROWSER_APPLICATION_PROVIDERS);
|
||||||
|
|
||||||
|
it('Test hello world', injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => {
|
||||||
|
return tcb
|
||||||
|
.createAsync(Ng2AlfrescoViewerComponent)
|
||||||
|
.then((fixture) => {
|
||||||
|
let element = fixture.nativeElement;
|
||||||
|
expect(element.querySelector('h1')).toBeDefined();
|
||||||
|
expect(element.getElementsByTagName('h1')[0].innerHTML).toEqual('ng-2-alfresco-viewer');
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
});
|
@@ -0,0 +1,31 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import {Component} from 'angular2/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ng-2-alfresco-viewer',
|
||||||
|
styles: [
|
||||||
|
`
|
||||||
|
:host h1 {
|
||||||
|
font-size:22px
|
||||||
|
}
|
||||||
|
`
|
||||||
|
],
|
||||||
|
template: `<H1>ng-2-alfresco-viewer</H1>`
|
||||||
|
})
|
||||||
|
export class Ng2AlfrescoViewerComponent {}
|
49
ng2-components/ng2-alfresco-viewer/tests-runner.html
Normal file
49
ng2-components/ng2-alfresco-viewer/tests-runner.html
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html;charset=utf-8">
|
||||||
|
<title>ng-2-alfresco-viewer component Tests</title>
|
||||||
|
<link rel="stylesheet" href="node_modules/jasmine-core/lib/jasmine-core/jasmine.css">
|
||||||
|
<script src="node_modules/jasmine-core/lib/jasmine-core/jasmine.js"></script>
|
||||||
|
<script src="node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js"></script>
|
||||||
|
<script src="node_modules/jasmine-core/lib/jasmine-core/boot.js"></script>
|
||||||
|
|
||||||
|
<!-- #1. add the system.js library -->
|
||||||
|
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
|
||||||
|
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>
|
||||||
|
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
|
||||||
|
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
|
||||||
|
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
||||||
|
<script src="node_modules/rxjs/bundles/Rx.js"></script>
|
||||||
|
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
|
||||||
|
|
||||||
|
<script src="node_modules/angular2/bundles/http.dev.js"></script>
|
||||||
|
<script src="node_modules/angular2/bundles/router.dev.js"></script>
|
||||||
|
<script src="node_modules/angular2/bundles/testing.dev.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// #2. Configure systemjs to use the .js extension
|
||||||
|
// for imports from the app folder
|
||||||
|
System.config({
|
||||||
|
packages: {
|
||||||
|
'src': {defaultExtension: 'js'}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #3. Import the spec file explicitly
|
||||||
|
Promise.all([
|
||||||
|
System.import('test/ng-2-alfresco-viewer.component.spec.js')
|
||||||
|
])
|
||||||
|
// #4. wait for all imports to load ...
|
||||||
|
// then re-execute `window.onload` which
|
||||||
|
// triggers the Jasmine test-runner start
|
||||||
|
// or explain what went wrong.
|
||||||
|
.then(window.onload)
|
||||||
|
.catch(console.error.bind(console));
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- Unit Testing Chapter #1: Proof of life. -->
|
||||||
|
<script>
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
26
ng2-components/ng2-alfresco-viewer/tsconfig.json
Normal file
26
ng2-components/ng2-alfresco-viewer/tsconfig.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es5",
|
||||||
|
"module": "system",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"removeComments": true,
|
||||||
|
"declaration": true,
|
||||||
|
"noLib": false,
|
||||||
|
"allowUnreachableCode": false,
|
||||||
|
"allowUnusedLabels": false,
|
||||||
|
"noImplicitAny": false,
|
||||||
|
"noImplicitReturns": false,
|
||||||
|
"noImplicitUseStrict": false,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"outDir": "dist"
|
||||||
|
},
|
||||||
|
"exclude": [
|
||||||
|
"demo",
|
||||||
|
"node_modules",
|
||||||
|
"typings/main",
|
||||||
|
"typings/main.d.ts"
|
||||||
|
]
|
||||||
|
}
|
122
ng2-components/ng2-alfresco-viewer/tslint.json
Normal file
122
ng2-components/ng2-alfresco-viewer/tslint.json
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
{
|
||||||
|
"rulesDirectory": [
|
||||||
|
"node_modules/codelyzer"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"align": [
|
||||||
|
true,
|
||||||
|
"parameters",
|
||||||
|
"statements"
|
||||||
|
],
|
||||||
|
"ban": false,
|
||||||
|
"class-name": true,
|
||||||
|
"comment-format": [
|
||||||
|
true,
|
||||||
|
"check-space"
|
||||||
|
],
|
||||||
|
"curly": true,
|
||||||
|
"eofline": true,
|
||||||
|
"forin": true,
|
||||||
|
"indent": [
|
||||||
|
true,
|
||||||
|
"spaces"
|
||||||
|
],
|
||||||
|
"interface-name": false,
|
||||||
|
"jsdoc-format": true,
|
||||||
|
"label-position": true,
|
||||||
|
"label-undefined": true,
|
||||||
|
"max-line-length": [
|
||||||
|
true,
|
||||||
|
140
|
||||||
|
],
|
||||||
|
"member-ordering": [
|
||||||
|
true,
|
||||||
|
"static-before-instance",
|
||||||
|
"variables-before-functions"
|
||||||
|
],
|
||||||
|
"no-any": false,
|
||||||
|
"no-arg": true,
|
||||||
|
"no-bitwise": false,
|
||||||
|
"no-conditional-assignment": true,
|
||||||
|
"no-consecutive-blank-lines": false,
|
||||||
|
"no-console": [
|
||||||
|
true,
|
||||||
|
"debug",
|
||||||
|
"info",
|
||||||
|
"time",
|
||||||
|
"timeEnd",
|
||||||
|
"trace"
|
||||||
|
],
|
||||||
|
"no-construct": true,
|
||||||
|
"no-constructor-vars": false,
|
||||||
|
"no-debugger": true,
|
||||||
|
"no-duplicate-key": true,
|
||||||
|
"no-duplicate-variable": true,
|
||||||
|
"no-empty": false,
|
||||||
|
"no-eval": true,
|
||||||
|
"no-inferrable-types": false,
|
||||||
|
"no-internal-module": true,
|
||||||
|
"no-require-imports": true,
|
||||||
|
"no-shadowed-variable": true,
|
||||||
|
"no-switch-case-fall-through": true,
|
||||||
|
"no-trailing-whitespace": true,
|
||||||
|
"no-unreachable": true,
|
||||||
|
"no-unused-expression": true,
|
||||||
|
"no-unused-variable": true,
|
||||||
|
"no-use-before-declare": true,
|
||||||
|
"no-var-keyword": true,
|
||||||
|
"no-var-requires": true,
|
||||||
|
"object-literal-sort-keys": false,
|
||||||
|
"one-line": [
|
||||||
|
true,
|
||||||
|
"check-open-brace",
|
||||||
|
"check-catch",
|
||||||
|
"check-else",
|
||||||
|
"check-whitespace"
|
||||||
|
],
|
||||||
|
"quotemark": [
|
||||||
|
true,
|
||||||
|
"single",
|
||||||
|
"avoid-escape"
|
||||||
|
],
|
||||||
|
"radix": true,
|
||||||
|
"semicolon": true,
|
||||||
|
"switch-default": true,
|
||||||
|
"trailing-comma": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"multiline": "never",
|
||||||
|
"singleline": "never"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"triple-equals": [
|
||||||
|
true,
|
||||||
|
"allow-null-check"
|
||||||
|
],
|
||||||
|
"typedef": false,
|
||||||
|
"typedef-whitespace": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"call-signature": "nospace",
|
||||||
|
"index-signature": "nospace",
|
||||||
|
"parameter": "nospace",
|
||||||
|
"property-declaration": "nospace",
|
||||||
|
"variable-declaration": "nospace"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"use-strict": false,
|
||||||
|
"variable-name": [
|
||||||
|
true,
|
||||||
|
"check-format",
|
||||||
|
"allow-leading-underscore",
|
||||||
|
"ban-keywords"
|
||||||
|
],
|
||||||
|
"whitespace": [
|
||||||
|
true,
|
||||||
|
"check-branch",
|
||||||
|
"check-decl",
|
||||||
|
"check-operator",
|
||||||
|
"check-separator"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
6
ng2-components/ng2-alfresco-viewer/typings.json
Normal file
6
ng2-components/ng2-alfresco-viewer/typings.json
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"ambientDependencies": {
|
||||||
|
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
|
||||||
|
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b"
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user