mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
ie-polyfills fix
This commit is contained in:
@@ -2,8 +2,6 @@ import 'core-js/es6';
|
||||
import 'core-js/es7/reflect';
|
||||
|
||||
// IE 8-11
|
||||
require('script!element.scrollintoviewifneeded-polyfill/index.js');
|
||||
|
||||
require('zone.js/dist/zone');
|
||||
|
||||
if (process.env.ENV === 'production') {
|
||||
|
@@ -10,45 +10,32 @@ import '@angular/router';
|
||||
import 'rxjs';
|
||||
|
||||
//Alfresco
|
||||
import 'ng2-alfresco-core'
|
||||
import 'ng2-alfresco-datatable'
|
||||
import 'ng2-activiti-diagrams'
|
||||
import 'ng2-activiti-analytics'
|
||||
import 'ng2-activiti-form'
|
||||
import 'ng2-activiti-processlist'
|
||||
import 'ng2-activiti-tasklist'
|
||||
import 'ng2-alfresco-documentlist'
|
||||
import 'ng2-alfresco-login'
|
||||
import 'ng2-alfresco-search'
|
||||
import 'ng2-alfresco-tag'
|
||||
import 'ng2-alfresco-upload'
|
||||
import 'ng2-alfresco-viewer'
|
||||
import 'ng2-alfresco-webscript'
|
||||
import 'ng2-alfresco-userinfo'
|
||||
|
||||
// Other vendors for example jQuery, Lodash or Bootstrap
|
||||
// You can import js, ts, css, sass, ...
|
||||
|
||||
// Google Material Design Lite
|
||||
import '../public/css/material.orange-blue.min.css';
|
||||
import 'material-design-lite/material.min';
|
||||
import 'material-design-icons/iconfont/material-icons.css';
|
||||
|
||||
// Flags
|
||||
import 'flag-icon-css/css/flag-icon.min.css';
|
||||
import 'ng2-alfresco-core';
|
||||
import 'ng2-alfresco-datatable';
|
||||
import 'ng2-activiti-diagrams';
|
||||
import 'ng2-activiti-analytics';
|
||||
import 'ng2-activiti-form';
|
||||
import 'ng2-activiti-processlist';
|
||||
import 'ng2-activiti-tasklist';
|
||||
import 'ng2-alfresco-documentlist';
|
||||
import 'ng2-alfresco-login';
|
||||
import 'ng2-alfresco-search';
|
||||
import 'ng2-alfresco-tag';
|
||||
import 'ng2-alfresco-upload';
|
||||
import 'ng2-alfresco-viewer';
|
||||
import 'ng2-alfresco-webscript';
|
||||
import 'ng2-alfresco-userinfo';
|
||||
|
||||
// Polyfill(s) for dialogs
|
||||
import 'dialog-polyfill/dialog-polyfill';
|
||||
import 'dialog-polyfill/dialog-polyfill.css';
|
||||
|
||||
// app content
|
||||
import '../public/css/app.css';
|
||||
import '../public/css/muli-font.css';
|
||||
// Flags
|
||||
import 'flag-icon-css/css/flag-icon.min.css';
|
||||
|
||||
import 'ng2-activiti-form/stencils/runtime.ng1';
|
||||
import 'ng2-activiti-form/stencils/runtime.adf';
|
||||
|
||||
require('script!../public/js/Polyline.js');
|
||||
import 'chart.js';
|
||||
require('script!raphael/raphael.min.js');
|
||||
|
||||
|
@@ -111,7 +111,110 @@ module.exports = {
|
||||
}),
|
||||
|
||||
new CopyWebpackPlugin([
|
||||
{ from: 'versions.json' }
|
||||
{
|
||||
from: 'versions.json'
|
||||
},{
|
||||
context: 'node_modules',
|
||||
from: 'element.scrollintoviewifneeded-polyfill/index.js',
|
||||
to: 'js/element.scrollintoviewifneeded-polyfill.js',
|
||||
flatten: true
|
||||
},{
|
||||
context: 'node_modules',
|
||||
from: 'classlist-polyfill/src/index.js',
|
||||
to: 'js/classlist-polyfill.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'intl/dist/Intl.min.js',
|
||||
to: 'js/Intl.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'web-animations-js/web-animations.min.js',
|
||||
to: 'js/web-animations.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'core-js/client/shim.min.js',
|
||||
to: 'js/shim.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'es6-shim/es6-shim.min.js',
|
||||
to: 'js/es6-shim.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'es5-shim/es5-shim.min.js',
|
||||
to: 'js/es5-shim.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'systemjs/dist/system-polyfills.js',
|
||||
to: 'js/system-polyfills.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'material-design-lite/material.min.js',
|
||||
to: 'js/material.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'material-design-lite/material.min.js',
|
||||
to: 'js/material.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'public',
|
||||
from: 'css/app.css',
|
||||
to: 'css/app.css',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'public',
|
||||
from: 'css/material.orange-blue.min.css',
|
||||
to: 'css/material.orange-blue.min.css',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'material-design-icons/iconfont/',
|
||||
to: 'css/iconfont/',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'flag-icon-css/css/flag-icon.min.css',
|
||||
to: 'css/flag-icon.min.css',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'public',
|
||||
from: 'fonts',
|
||||
to: 'css',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'public',
|
||||
from: 'js/typedarray.js',
|
||||
to: 'js/typedarray.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'public',
|
||||
from: 'js/Blob.js',
|
||||
to: 'js/Blob.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'public',
|
||||
from: 'js/formdata.js',
|
||||
to: 'js/formdata.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'public',
|
||||
from: 'js/promisePolyfill.js',
|
||||
to: 'js/promisePolyfill.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'public',
|
||||
from: 'css/muli-font.css',
|
||||
to: 'css/muli-font.css',
|
||||
flatten: true
|
||||
}
|
||||
|
||||
]),
|
||||
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
|
@@ -5,15 +5,36 @@
|
||||
<title>Demo Application - Angular 2</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link href="css/app.css" rel="stylesheet">
|
||||
<link rel="icon" type="image/png" href="favicon-96x96.png" sizes="96x96">
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- 1. Load libraries -->
|
||||
<!-- Polyfill(s) for Safari (pre-10.x) -->
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~locale.en"></script>
|
||||
<!--[if lt IE 7]>
|
||||
<script src="js/dialog-polyfill.js"></script>
|
||||
|
||||
<script src=js/shim.min.js></script>
|
||||
<script src=//cdnjs.cloudflare.com/ajax/libs/dom4/1.8.3/dom4.js></script>
|
||||
<script src=js/element.scrollintoviewifneeded-polyfill.js></script>
|
||||
<script src=js/classlist-polyfill.js></script>
|
||||
<script src=js/Intl.min.js></script>
|
||||
<script src=js/web-animations.min.js></script>
|
||||
<script src=js/typedarray.js></script>
|
||||
<script src=js/Blob.js></script>
|
||||
<script src=js/formdata.js></script>
|
||||
<script src=https://npmcdn.com/angular2/es6/dev/src/testing/shims_for_IE.js></script>
|
||||
<script src=js/es6-shim.min.js></script>
|
||||
<script src=js/es5-shim.min.js></script>
|
||||
<script src=js/system-polyfills.js></script>
|
||||
<![endif]-->
|
||||
<link href=css/flag-icon.min.css rel="stylesheet" type="text/css/">
|
||||
<link href=css/muli-font.csss rel="stylesheet" type="text/css/">
|
||||
|
||||
<!-- Google Material Design Lite -->
|
||||
<link href="css/material.orange-blue.min.css" rel="stylesheet">
|
||||
<script src="js/material.min.js"></script>
|
||||
<link href="css/iconfont/material-icons.css" rel="stylesheet">
|
||||
|
||||
<!-- Polyfill(s) for older browsers -->
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/dom4/1.8.3/dom4.js"></script>
|
||||
|
||||
<style>
|
||||
.main_header_adf .mdl-layout__drawer-button {
|
||||
@@ -24,13 +45,14 @@
|
||||
</head>
|
||||
<!-- 3. Display the application -->
|
||||
<body>
|
||||
<alfresco-app>
|
||||
<alfresco-app>
|
||||
<div id="loader-container" class="loader-container">
|
||||
<div class="loader-item">
|
||||
<div id="loader-spin" class="mdl-progress mdl-js-progress mdl-progress__indeterminate"></div>
|
||||
<div id="loader-text" class="loader-text">Loading Demo Shell..</div>
|
||||
</div >
|
||||
</div>
|
||||
</alfresco-app>
|
||||
</alfresco-app>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
"clean-build": "rimraf 'app/{,**/}**.js' 'app/{,**/}**.js.map' 'app/{,**/}**.d.ts'",
|
||||
"test": "karma start",
|
||||
"build": "npm run server-versions && rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail",
|
||||
"server-versions" : "rimraf versions.json && npm list --depth=0 --json=true --prod=true > versions.json || true",
|
||||
"server-versions": "rimraf versions.json && npm list --depth=0 --json=true --prod=true > versions.json || true",
|
||||
"aws": "node app.js",
|
||||
"tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json 'app/{,**/}**.ts'",
|
||||
"licensecheck": "license-check"
|
||||
@@ -63,8 +63,8 @@
|
||||
"systemjs": "0.19.40",
|
||||
"core-js": "^2.4.1",
|
||||
"reflect-metadata": "^0.1.8",
|
||||
"rxjs": "5.0.0-beta.12",
|
||||
"zone.js": "^0.6.26",
|
||||
"rxjs": "5.0.1",
|
||||
"zone.js": "^0.7.2",
|
||||
"material-design-icons": "2.2.3",
|
||||
"material-design-lite": "1.2.1",
|
||||
"ng2-translate": "2.5.0",
|
||||
@@ -98,8 +98,10 @@
|
||||
"@types/node": "^6.0.45",
|
||||
"angular2-template-loader": "^0.6.0",
|
||||
"awesome-typescript-loader": "^2.2.4",
|
||||
"classlist-polyfill": "^1.0.3",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"css-loader": "^0.23.1",
|
||||
"es6-shim": "^0.35.2",
|
||||
"extract-text-webpack-plugin": "^1.0.1",
|
||||
"file-loader": "^0.8.5",
|
||||
"glob": "^7.1.1",
|
||||
@@ -124,13 +126,10 @@
|
||||
"style-loader": "^0.13.1",
|
||||
"tslint": "3.15.1",
|
||||
"typescript": "2.0.3",
|
||||
"web-animations-js": "^2.2.2",
|
||||
"webpack": "^1.13.0",
|
||||
"webpack-dev-server": "^1.14.1",
|
||||
"webpack-merge": "^0.14.0",
|
||||
"source-map-loader": "^0.1.5",
|
||||
"script-loader": "^0.7.0",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"glob": "^7.1.1",
|
||||
"wsrv": "^0.1.6"
|
||||
},
|
||||
"license-check-config": {
|
||||
|
211
demo-shell-ng2/public/js/Blob.js
Normal file
211
demo-shell-ng2/public/js/Blob.js
Normal file
@@ -0,0 +1,211 @@
|
||||
/* Blob.js
|
||||
* A Blob implementation.
|
||||
* 2014-07-24
|
||||
*
|
||||
* By Eli Grey, http://eligrey.com
|
||||
* By Devin Samarin, https://github.com/dsamarin
|
||||
* License: MIT
|
||||
* See https://github.com/eligrey/Blob.js/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
/*global self, unescape */
|
||||
/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
|
||||
plusplus: true */
|
||||
|
||||
/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
|
||||
|
||||
(function (view) {
|
||||
"use strict";
|
||||
|
||||
view.URL = view.URL || view.webkitURL;
|
||||
|
||||
if (view.Blob && view.URL) {
|
||||
try {
|
||||
new Blob;
|
||||
return;
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
// Internally we use a BlobBuilder implementation to base Blob off of
|
||||
// in order to support older browsers that only have BlobBuilder
|
||||
var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
|
||||
var
|
||||
get_class = function(object) {
|
||||
return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
|
||||
}
|
||||
, FakeBlobBuilder = function BlobBuilder() {
|
||||
this.data = [];
|
||||
}
|
||||
, FakeBlob = function Blob(data, type, encoding) {
|
||||
this.data = data;
|
||||
this.size = data.length;
|
||||
this.type = type;
|
||||
this.encoding = encoding;
|
||||
}
|
||||
, FBB_proto = FakeBlobBuilder.prototype
|
||||
, FB_proto = FakeBlob.prototype
|
||||
, FileReaderSync = view.FileReaderSync
|
||||
, FileException = function(type) {
|
||||
this.code = this[this.name = type];
|
||||
}
|
||||
, file_ex_codes = (
|
||||
"NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
|
||||
+ "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
|
||||
).split(" ")
|
||||
, file_ex_code = file_ex_codes.length
|
||||
, real_URL = view.URL || view.webkitURL || view
|
||||
, real_create_object_URL = real_URL.createObjectURL
|
||||
, real_revoke_object_URL = real_URL.revokeObjectURL
|
||||
, URL = real_URL
|
||||
, btoa = view.btoa
|
||||
, atob = view.atob
|
||||
|
||||
, ArrayBuffer = view.ArrayBuffer
|
||||
, Uint8Array = view.Uint8Array
|
||||
|
||||
, origin = /^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/
|
||||
;
|
||||
FakeBlob.fake = FB_proto.fake = true;
|
||||
while (file_ex_code--) {
|
||||
FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
|
||||
}
|
||||
// Polyfill URL
|
||||
if (!real_URL.createObjectURL) {
|
||||
URL = view.URL = function(uri) {
|
||||
var
|
||||
uri_info = document.createElementNS("http://www.w3.org/1999/xhtml", "a")
|
||||
, uri_origin
|
||||
;
|
||||
uri_info.href = uri;
|
||||
if (!("origin" in uri_info)) {
|
||||
if (uri_info.protocol.toLowerCase() === "data:") {
|
||||
uri_info.origin = null;
|
||||
} else {
|
||||
uri_origin = uri.match(origin);
|
||||
uri_info.origin = uri_origin && uri_origin[1];
|
||||
}
|
||||
}
|
||||
return uri_info;
|
||||
};
|
||||
}
|
||||
URL.createObjectURL = function(blob) {
|
||||
var
|
||||
type = blob.type
|
||||
, data_URI_header
|
||||
;
|
||||
if (type === null) {
|
||||
type = "application/octet-stream";
|
||||
}
|
||||
if (blob instanceof FakeBlob) {
|
||||
data_URI_header = "data:" + type;
|
||||
if (blob.encoding === "base64") {
|
||||
return data_URI_header + ";base64," + blob.data;
|
||||
} else if (blob.encoding === "URI") {
|
||||
return data_URI_header + "," + decodeURIComponent(blob.data);
|
||||
} if (btoa) {
|
||||
return data_URI_header + ";base64," + btoa(blob.data);
|
||||
} else {
|
||||
return data_URI_header + "," + encodeURIComponent(blob.data);
|
||||
}
|
||||
} else if (real_create_object_URL) {
|
||||
return real_create_object_URL.call(real_URL, blob);
|
||||
}
|
||||
};
|
||||
URL.revokeObjectURL = function(object_URL) {
|
||||
if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
|
||||
real_revoke_object_URL.call(real_URL, object_URL);
|
||||
}
|
||||
};
|
||||
FBB_proto.append = function(data/*, endings*/) {
|
||||
var bb = this.data;
|
||||
// decode data to a binary string
|
||||
if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
|
||||
var
|
||||
str = ""
|
||||
, buf = new Uint8Array(data)
|
||||
, i = 0
|
||||
, buf_len = buf.length
|
||||
;
|
||||
for (; i < buf_len; i++) {
|
||||
str += String.fromCharCode(buf[i]);
|
||||
}
|
||||
bb.push(str);
|
||||
} else if (get_class(data) === "Blob" || get_class(data) === "File") {
|
||||
if (FileReaderSync) {
|
||||
var fr = new FileReaderSync;
|
||||
bb.push(fr.readAsBinaryString(data));
|
||||
} else {
|
||||
// async FileReader won't work as BlobBuilder is sync
|
||||
throw new FileException("NOT_READABLE_ERR");
|
||||
}
|
||||
} else if (data instanceof FakeBlob) {
|
||||
if (data.encoding === "base64" && atob) {
|
||||
bb.push(atob(data.data));
|
||||
} else if (data.encoding === "URI") {
|
||||
bb.push(decodeURIComponent(data.data));
|
||||
} else if (data.encoding === "raw") {
|
||||
bb.push(data.data);
|
||||
}
|
||||
} else {
|
||||
if (typeof data !== "string") {
|
||||
data += ""; // convert unsupported types to strings
|
||||
}
|
||||
// decode UTF-16 to binary string
|
||||
bb.push(unescape(encodeURIComponent(data)));
|
||||
}
|
||||
};
|
||||
FBB_proto.getBlob = function(type) {
|
||||
if (!arguments.length) {
|
||||
type = null;
|
||||
}
|
||||
return new FakeBlob(this.data.join(""), type, "raw");
|
||||
};
|
||||
FBB_proto.toString = function() {
|
||||
return "[object BlobBuilder]";
|
||||
};
|
||||
FB_proto.slice = function(start, end, type) {
|
||||
var args = arguments.length;
|
||||
if (args < 3) {
|
||||
type = null;
|
||||
}
|
||||
return new FakeBlob(
|
||||
this.data.slice(start, args > 1 ? end : this.data.length)
|
||||
, type
|
||||
, this.encoding
|
||||
);
|
||||
};
|
||||
FB_proto.toString = function() {
|
||||
return "[object Blob]";
|
||||
};
|
||||
FB_proto.close = function() {
|
||||
this.size = 0;
|
||||
delete this.data;
|
||||
};
|
||||
return FakeBlobBuilder;
|
||||
}(view));
|
||||
|
||||
view.Blob = function(blobParts, options) {
|
||||
var type = options ? (options.type || "") : "";
|
||||
var builder = new BlobBuilder();
|
||||
if (blobParts) {
|
||||
for (var i = 0, len = blobParts.length; i < len; i++) {
|
||||
if (Uint8Array && blobParts[i] instanceof Uint8Array) {
|
||||
builder.append(blobParts[i].buffer);
|
||||
}
|
||||
else {
|
||||
builder.append(blobParts[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
var blob = builder.getBlob(type);
|
||||
if (!blob.slice && blob.webkitSlice) {
|
||||
blob.slice = blob.webkitSlice;
|
||||
}
|
||||
return blob;
|
||||
};
|
||||
|
||||
var getPrototypeOf = Object.getPrototypeOf || function(object) {
|
||||
return object.__proto__;
|
||||
};
|
||||
view.Blob.prototype = getPrototypeOf(new view.Blob());
|
||||
}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));
|
@@ -1,372 +0,0 @@
|
||||
/**
|
||||
* Class to generate polyline
|
||||
*
|
||||
* @author Dmitry Farafonov
|
||||
*/
|
||||
|
||||
var ANCHOR_TYPE= {
|
||||
main: "main",
|
||||
middle: "middle",
|
||||
first: "first",
|
||||
last: "last"
|
||||
};
|
||||
|
||||
function Anchor(uuid, type, x, y) {
|
||||
this.uuid = uuid;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.type = (type == ANCHOR_TYPE.middle) ? ANCHOR_TYPE.middle : ANCHOR_TYPE.main;
|
||||
};
|
||||
Anchor.prototype = {
|
||||
uuid: null,
|
||||
x: 0,
|
||||
y: 0,
|
||||
type: ANCHOR_TYPE.main,
|
||||
isFirst: false,
|
||||
isLast: false,
|
||||
ndex: 0,
|
||||
typeIndex: 0
|
||||
};
|
||||
|
||||
function Polyline(uuid, points, strokeWidth, paper) {
|
||||
/* Array on coordinates:
|
||||
* points: [{x: 410, y: 110}, 1
|
||||
* {x: 570, y: 110}, 1 2
|
||||
* {x: 620, y: 240}, 2 3
|
||||
* {x: 750, y: 270}, 3 4
|
||||
* {x: 650, y: 370}]; 4
|
||||
*/
|
||||
this.points = points;
|
||||
|
||||
/*
|
||||
* path for graph
|
||||
* [["M", x1, y1], ["L", x2, y2], ["C", ax, ay, bx, by, x3, y3], ["L", x3, y3]]
|
||||
*/
|
||||
this.path = [];
|
||||
|
||||
this.anchors = [];
|
||||
|
||||
if (strokeWidth) this.strokeWidth = strokeWidth;
|
||||
|
||||
this.paper = paper;
|
||||
|
||||
this.closePath = false;
|
||||
|
||||
this.init();
|
||||
};
|
||||
|
||||
Polyline.prototype = {
|
||||
id: null,
|
||||
points: [],
|
||||
path: [],
|
||||
anchors: [],
|
||||
strokeWidth: 1,
|
||||
radius: 1,
|
||||
showDetails: false,
|
||||
paper: null,
|
||||
element: null,
|
||||
isDefaultConditionAvailable: false,
|
||||
closePath: false,
|
||||
|
||||
init: function(points){
|
||||
var linesCount = this.getLinesCount();
|
||||
if (linesCount < 1)
|
||||
return;
|
||||
|
||||
this.normalizeCoordinates();
|
||||
|
||||
// create anchors
|
||||
|
||||
this.pushAnchor(ANCHOR_TYPE.first, this.getLine(0).x1, this.getLine(0).y1);
|
||||
|
||||
for (var i = 1; i < linesCount; i++)
|
||||
{
|
||||
var line1 = this.getLine(i-1);
|
||||
this.pushAnchor(ANCHOR_TYPE.main, line1.x2, line1.y2);
|
||||
}
|
||||
|
||||
this.pushAnchor(ANCHOR_TYPE.last, this.getLine(linesCount-1).x2, this.getLine(linesCount-1).y2);
|
||||
|
||||
this.rebuildPath();
|
||||
},
|
||||
|
||||
normalizeCoordinates: function(){
|
||||
for(var i=0; i < this.points.length; i++){
|
||||
this.points[i].x = parseFloat(this.points[i].x);
|
||||
this.points[i].y = parseFloat(this.points[i].y);
|
||||
}
|
||||
},
|
||||
|
||||
getLinesCount: function(){
|
||||
return this.points.length-1;
|
||||
},
|
||||
_getLine: function(i){
|
||||
if (this.points.length > i && this.points[i]) {
|
||||
return {x1: this.points[i].x, y1: this.points[i].y, x2: this.points[i+1].x, y2: this.points[i+1].y};
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
},
|
||||
getLine: function(i){
|
||||
var line = this._getLine(i);
|
||||
if (line != undefined) {
|
||||
line.angle = this.getLineAngle(i);
|
||||
}
|
||||
return line;
|
||||
},
|
||||
getLineAngle: function(i){
|
||||
var line = this._getLine(i);
|
||||
return Math.atan2(line.y2 - line.y1, line.x2 - line.x1);
|
||||
},
|
||||
getLineLengthX: function(i){
|
||||
var line = this.getLine(i);
|
||||
return (line.x2 - line.x1);
|
||||
},
|
||||
getLineLengthY: function(i){
|
||||
var line = this.getLine(i);
|
||||
return (line.y2 - line.y1);
|
||||
},
|
||||
getLineLength: function(i){
|
||||
return Math.sqrt(Math.pow(this.getLineLengthX(i), 2) + Math.pow(this.getLineLengthY(i), 2));
|
||||
},
|
||||
|
||||
getAnchors: function(){
|
||||
return this.anchors;
|
||||
},
|
||||
getAnchorsCount: function(type){
|
||||
if (!type)
|
||||
return this.anchors.length;
|
||||
else {
|
||||
var count = 0;
|
||||
for(var i=0; i < this.getAnchorsCount(); i++){
|
||||
var anchor = this.anchors[i];
|
||||
if (anchor.getType() == type) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
},
|
||||
|
||||
pushAnchor: function(type, x, y, index){
|
||||
if (type == ANCHOR_TYPE.first) {
|
||||
index = 0;
|
||||
typeIndex = 0;
|
||||
} else if (type == ANCHOR_TYPE.last) {
|
||||
index = this.getAnchorsCount();
|
||||
typeIndex = 0;
|
||||
} else if (!index) {
|
||||
index = this.anchors.length;
|
||||
} else {
|
||||
for(var i=0; i < this.getAnchorsCount(); i++){
|
||||
var anchor = this.anchors[i];
|
||||
if (anchor.index > index) {
|
||||
anchor.index++;
|
||||
anchor.typeIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var anchor = new Anchor(this.id, ANCHOR_TYPE.main, x, y, index, typeIndex);
|
||||
|
||||
this.anchors.push(anchor);
|
||||
},
|
||||
|
||||
getAnchor: function(position){
|
||||
return this.anchors[position];
|
||||
},
|
||||
|
||||
getAnchorByType: function(type, position){
|
||||
if (type == ANCHOR_TYPE.first)
|
||||
return this.anchors[0];
|
||||
if (type == ANCHOR_TYPE.last)
|
||||
return this.anchors[this.getAnchorsCount()-1];
|
||||
|
||||
for(var i=0; i < this.getAnchorsCount(); i++){
|
||||
var anchor = this.anchors[i];
|
||||
if (anchor.type == type) {
|
||||
if( position == anchor.position)
|
||||
return anchor;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
addNewPoint: function(position, x, y){
|
||||
//
|
||||
for(var i = 0; i < this.getLinesCount(); i++){
|
||||
var line = this.getLine(i);
|
||||
if (x > line.x1 && x < line.x2 && y > line.y1 && y < line.y2) {
|
||||
this.points.splice(i+1,0,{x: x, y: y});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.rebuildPath();
|
||||
},
|
||||
|
||||
rebuildPath: function(){
|
||||
var path = [];
|
||||
|
||||
for(var i = 0; i < this.getAnchorsCount(); i++){
|
||||
var anchor = this.getAnchor(i);
|
||||
|
||||
var pathType = "";
|
||||
if (i == 0)
|
||||
pathType = "M";
|
||||
else
|
||||
pathType = "L";
|
||||
|
||||
// TODO: save previous points and calculate new path just if points are updated, and then save currents values as previous
|
||||
|
||||
var targetX = anchor.x, targetY = anchor.y;
|
||||
if (i>0 && i < this.getAnchorsCount()-1) {
|
||||
// get new x,y
|
||||
var cx = anchor.x, cy = anchor.y;
|
||||
|
||||
// pivot point of prev line
|
||||
var AO = this.getLineLength(i-1);
|
||||
if (AO < this.radius) {
|
||||
AO = this.radius;
|
||||
}
|
||||
|
||||
this.isDefaultConditionAvailable = (this.isDefaultConditionAvailable || (i == 1 && AO > 10));
|
||||
|
||||
var ED = this.getLineLengthY(i-1) * this.radius / AO;
|
||||
var OD = this.getLineLengthX(i-1) * this.radius / AO;
|
||||
targetX = anchor.x - OD;
|
||||
targetY = anchor.y - ED;
|
||||
|
||||
if (AO < 2*this.radius && i>1) {
|
||||
targetX = anchor.x - this.getLineLengthX(i-1)/2;
|
||||
targetY = anchor.y - this.getLineLengthY(i-1)/2;;
|
||||
}
|
||||
|
||||
// pivot point of next line
|
||||
var AO = this.getLineLength(i);
|
||||
if (AO < this.radius) {
|
||||
AO = this.radius;
|
||||
}
|
||||
var ED = this.getLineLengthY(i) * this.radius / AO;
|
||||
var OD = this.getLineLengthX(i) * this.radius / AO;
|
||||
var nextSrcX = anchor.x + OD;
|
||||
var nextSrcY = anchor.y + ED;
|
||||
|
||||
if (AO < 2*this.radius && i<this.getAnchorsCount()-2) {
|
||||
nextSrcX = anchor.x + this.getLineLengthX(i)/2;
|
||||
nextSrcY = anchor.y + this.getLineLengthY(i)/2;;
|
||||
}
|
||||
|
||||
|
||||
var dx0 = (cx - targetX) / 3,
|
||||
dy0 = (cy - targetY) / 3,
|
||||
ax = cx - dx0,
|
||||
ay = cy - dy0,
|
||||
|
||||
dx1 = (cx - nextSrcX) / 3,
|
||||
dy1 = (cy - nextSrcY) / 3,
|
||||
bx = cx - dx1,
|
||||
by = cy - dy1,
|
||||
|
||||
zx=nextSrcX, zy=nextSrcY;
|
||||
|
||||
} else if (i==1 && this.getAnchorsCount() == 2){
|
||||
var AO = this.getLineLength(i-1);
|
||||
if (AO < this.radius) {
|
||||
AO = this.radius;
|
||||
}
|
||||
this.isDefaultConditionAvailable = (this.isDefaultConditionAvailable || (i == 1 && AO > 10));
|
||||
}
|
||||
|
||||
// anti smoothing
|
||||
if (this.strokeWidth%2 == 1) {
|
||||
targetX += 0.5;
|
||||
targetY += 0.5;
|
||||
}
|
||||
|
||||
path.push([pathType, targetX, targetY]);
|
||||
|
||||
if (i>0 && i < this.getAnchorsCount()-1) {
|
||||
path.push(["C", ax, ay, bx, by, zx, zy]);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.closePath)
|
||||
{
|
||||
path.push(["Z"]);
|
||||
}
|
||||
|
||||
this.path = path;
|
||||
},
|
||||
|
||||
transform: function(transformation)
|
||||
{
|
||||
this.element.transform(transformation);
|
||||
},
|
||||
attr: function(attrs)
|
||||
{
|
||||
// TODO: foreach and set each
|
||||
this.element.attr(attrs);
|
||||
}
|
||||
};
|
||||
|
||||
function Polygone(points, strokeWidth) {
|
||||
/* Array on coordinates:
|
||||
* points: [{x: 410, y: 110}, 1
|
||||
* {x: 570, y: 110}, 1 2
|
||||
* {x: 620, y: 240}, 2 3
|
||||
* {x: 750, y: 270}, 3 4
|
||||
* {x: 650, y: 370}]; 4
|
||||
*/
|
||||
this.points = points;
|
||||
|
||||
/*
|
||||
* path for graph
|
||||
* [["M", x1, y1], ["L", x2, y2], ["C", ax, ay, bx, by, x3, y3], ["L", x3, y3]]
|
||||
*/
|
||||
this.path = [];
|
||||
|
||||
this.anchors = [];
|
||||
|
||||
if (strokeWidth) this.strokeWidth = strokeWidth;
|
||||
|
||||
this.closePath = true;
|
||||
this.init();
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Poligone is inherited from Poliline: draws closedPath of polyline
|
||||
*/
|
||||
|
||||
var Foo = function () { };
|
||||
Foo.prototype = Polyline.prototype;
|
||||
|
||||
Polygone.prototype = new Foo();
|
||||
|
||||
Polygone.prototype.rebuildPath = function(){
|
||||
var path = [];
|
||||
for(var i = 0; i < this.getAnchorsCount(); i++){
|
||||
var anchor = this.getAnchor(i);
|
||||
|
||||
var pathType = "";
|
||||
if (i == 0)
|
||||
pathType = "M";
|
||||
else
|
||||
pathType = "L";
|
||||
|
||||
var targetX = anchor.x, targetY = anchor.y;
|
||||
|
||||
// anti smoothing
|
||||
if (this.strokeWidth%2 == 1) {
|
||||
targetX += 0.5;
|
||||
targetY += 0.5;
|
||||
}
|
||||
|
||||
path.push([pathType, targetX, targetY]);
|
||||
}
|
||||
if (this.closePath)
|
||||
path.push(["Z"]);
|
||||
|
||||
this.path = path;
|
||||
};
|
37
demo-shell-ng2/public/js/formdata.js
Normal file
37
demo-shell-ng2/public/js/formdata.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Emulate FormData for some browsers
|
||||
* MIT License
|
||||
* (c) 2010 François de Metz
|
||||
*/
|
||||
(function(w) {
|
||||
if (w.FormData)
|
||||
return;
|
||||
function FormData() {
|
||||
this.fake = true;
|
||||
this.boundary = "--------FormData" + Math.random();
|
||||
this._fields = [];
|
||||
}
|
||||
FormData.prototype.append = function(key, value) {
|
||||
this._fields.push([key, value]);
|
||||
}
|
||||
FormData.prototype.toString = function() {
|
||||
var boundary = this.boundary;
|
||||
var body = "";
|
||||
this._fields.forEach(function(field) {
|
||||
body += "--" + boundary + "\r\n";
|
||||
// file upload
|
||||
if (field[1].name) {
|
||||
var file = field[1];
|
||||
body += "Content-Disposition: form-data; name=\""+ field[0] +"\"; filename=\""+ file.name +"\"\r\n";
|
||||
body += "Content-Type: "+ file.type +"\r\n\r\n";
|
||||
body += file.getAsBinary() + "\r\n";
|
||||
} else {
|
||||
body += "Content-Disposition: form-data; name=\""+ field[0] +"\";\r\n\r\n";
|
||||
body += field[1] + "\r\n";
|
||||
}
|
||||
});
|
||||
body += "--" + boundary +"--";
|
||||
return body;
|
||||
}
|
||||
w.FormData = FormData;
|
||||
})(window);
|
3
demo-shell-ng2/public/js/promisePolyfill.js
Normal file
3
demo-shell-ng2/public/js/promisePolyfill.js
Normal file
@@ -0,0 +1,3 @@
|
||||
/* Disable minification (remove `.min` from URL path) for more info */
|
||||
|
||||
(function(undefined) {if (!('Symbol' in this && 'iterator' in this.Symbol && !!Array.prototype[Symbol.iterator] && !!Array.prototype.values && (Array.prototype[Symbol.iterator] === Array.prototype.values))) {Object.defineProperty(Array.prototype,"values",{value:Array.prototype[Symbol.iterator],enumerable:!1,writable:!1});}if (!('contains' in String.prototype)) {String.prototype.contains=String.prototype.includes;}var ArrayIterator=function(){var e=function(){var e=function(){return this.length=0,this},t=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},_=function(e,n){return this instanceof _?(Object.defineProperties(this,{__list__:{writable:!0,value:e},__context__:{writable:!0,value:n},__nextIndex__:{writable:!0,value:0}}),void(n&&(t(n.on),n.on("_add",this._onAdd.bind(this)),n.on("_delete",this._onDelete.bind(this)),n.on("_clear",this._onClear.bind(this))))):new _(e,n)};return Object.defineProperties(_.prototype,Object.assign({constructor:{value:_,configurable:!0,enumerable:!1,writable:!0},_next:{value:function(){var e;if(this.__list__)return this.__redo__&&(e=this.__redo__.shift(),void 0!==e)?e:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()},configurable:!0,enumerable:!1,writable:!0},next:{value:function(){return this._createResult(this._next())},configurable:!0,enumerable:!1,writable:!0},_createResult:{value:function(e){return void 0===e?{done:!0,value:void 0}:{done:!1,value:this._resolve(e)}},configurable:!0,enumerable:!1,writable:!0},_resolve:{value:function(e){return this.__list__[e]},configurable:!0,enumerable:!1,writable:!0},_unBind:{value:function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd.bind(this)),this.__context__.off("_delete",this._onDelete.bind(this)),this.__context__.off("_clear",this._onClear.bind(this)),this.__context__=null)},configurable:!0,enumerable:!1,writable:!0},toString:{value:function(){return"[object Iterator]"},configurable:!0,enumerable:!1,writable:!0}},{_onAdd:{value:function(e){if(!(e>=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void Object.defineProperty(this,"__redo__",{value:[e],configurable:!0,enumerable:!1,writable:!1});this.__redo__.forEach(function(t,_){t>=e&&(this.__redo__[_]=++t)},this),this.__redo__.push(e)}},configurable:!0,enumerable:!1,writable:!0},_onDelete:{value:function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(t=this.__redo__.indexOf(e),t!==-1&&this.__redo__.splice(t,1),this.__redo__.forEach(function(t,_){t>e&&(this.__redo__[_]=--t)},this)))},configurable:!0,enumerable:!1,writable:!0},_onClear:{value:function(){this.__redo__&&e.call(this.__redo__),this.__nextIndex__=0},configurable:!0,enumerable:!1,writable:!0}})),Object.defineProperty(_.prototype,Symbol.iterator,{value:function(){return this},configurable:!0,enumerable:!1,writable:!0}),Object.defineProperty(_.prototype,Symbol.toStringTag,{value:"Iterator",configurable:!1,enumerable:!1,writable:!1}),_}(),t=function(_,n){return this instanceof t?(e.call(this,_),n=n?String.prototype.contains.call(n,"key+value")?"key+value":String.prototype.contains.call(n,"key")?"key":"value":"value",void Object.defineProperty(this,"__kind__",{value:n,configurable:!1,enumerable:!1,writable:!1})):new t(_,n)};return Object.setPrototypeOf&&Object.setPrototypeOf(t,e.prototype),t.prototype=Object.create(e.prototype,{constructor:{value:t,configurable:!0,enumerable:!1,writable:!0},_resolve:{value:function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e},configurable:!0,enumerable:!1,writable:!0},toString:{value:function(){return"[object Array Iterator]"},configurable:!0,enumerable:!1,writable:!0}}),t}();}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
|
1048
demo-shell-ng2/public/js/typedarray.js
Normal file
1048
demo-shell-ng2/public/js/typedarray.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -20,11 +20,14 @@
|
||||
padding: 0px 0;
|
||||
}
|
||||
|
||||
.user-profile-list-mdl{
|
||||
@media only screen
|
||||
and (min-device-width: 480px) {
|
||||
.user-profile-list-mdl{
|
||||
max-height: 450px;
|
||||
min-width: 450px;
|
||||
overflow: auto;
|
||||
padding:0px;
|
||||
}
|
||||
}
|
||||
|
||||
.header-profile{
|
||||
|
Reference in New Issue
Block a user