text
stringlengths 2
1.05M
|
|---|
import resolve from "@rollup/plugin-node-resolve";
import replace from "@rollup/plugin-replace";
import commonjs from "@rollup/plugin-commonjs";
import svelte from "rollup-plugin-svelte";
import { terser } from "rollup-plugin-terser";
import config from "sapper/config/rollup.js";
import pkg from "./package.json";
import sveltePreprocess from "svelte-preprocess";
import autoprefixer from "autoprefixer";
import cssnano from "cssnano";
const mode = process.env.NODE_ENV;
const dev = mode === "development";
const preprocess = sveltePreprocess({
scss: {
includePaths: ["src"],
},
postcss: {
plugins: [autoprefixer, cssnano],
},
});
const onwarn = (warning, onwarn) => {
if (warning.code === "CIRCULAR_DEPENDENCY") return;
return (
(warning.code === "MISSING_EXPORT" && /'preload'/.test(warning.message)) ||
(warning.code === "CIRCULAR_DEPENDENCY" &&
/[/\\]@sapper[/\\]/.test(warning.message)) ||
onwarn(warning)
);
};
export default {
client: {
input: config.client.input(),
output: config.client.output(),
plugins: [
replace({
"process.browser": true,
"process.env.NODE_ENV": JSON.stringify(mode),
}),
svelte({
dev,
hydratable: true,
preprocess,
emitCss: true,
}),
resolve({
browser: true,
dedupe: ["svelte"],
}),
commonjs(),
!dev &&
terser({
module: true,
}),
],
preserveEntrySignatures: "strict",
onwarn,
},
server: {
input: config.server.input(),
output: config.server.output(),
plugins: [
replace({
"process.browser": false,
"process.env.NODE_ENV": JSON.stringify(mode),
}),
svelte({
generate: "ssr",
hydratable: true,
preprocess,
dev,
}),
resolve({
dedupe: ["svelte"],
}),
commonjs(),
],
external: Object.keys(pkg.dependencies).concat(
// eslint-disable-next-line node/no-deprecated-api
require("module").builtinModules ||
Object.keys(process.binding("natives"))
),
preserveEntrySignatures: "strict",
onwarn,
},
};
|
'use strict';
var path = require('path');
var ozcss = require('postcss-australian-stylesheets');
var postcss = require('postcss');
var diff = require('diff');
var chalk = require('chalk');
module.exports = function(grunt) {
var options;
var processor;
/**
* Returns an input map contents if a custom map path was specified
* @param {string} from Input CSS path
* @returns {?string}
*/
function getPrevMap(from) {
if (typeof options.map.prev === 'string') {
var mapPath = options.map.prev + path.basename(from) + '.map';
if (grunt.file.exists(mapPath)) {
return grunt.file.read(mapPath);
}
}
}
/**
* @param {string} input Input CSS contents
* @param {string} from Input CSS path
* @param {string} to Output CSS path
* @returns {{css: string, map: ?string}}
*/
function processing(input, from, to) {
return processor.process(input, {
map: (typeof options.map === 'boolean') ? options.map : {
prev: getPrevMap(from),
inline: (typeof options.map.inline === 'boolean') ? options.map.inline : true,
annotation: (typeof options.map.annotation === 'string') ? options.map.annotation : true,
sourcesContent: (typeof options.map.sourcesContent === 'boolean') ? options.map.sourcesContent : true
},
from: from,
to: to
});
}
/**
* @param {string} msg Log message
*/
function log(msg) {
grunt.verbose.writeln(msg);
}
function task(self) {
options = self.options({
diff: false,
map: false
});
var tally = {
sheets: 0,
maps: 0,
diffs: 0
};
processor = postcss()
.use(ozcss());
self.files.forEach(function(f) {
if (!f.src.length) {
return grunt.fail.warn('No source files were found.');
}
try {
f.src.forEach(function(filepath) {
var dest = f.dest || filepath;
var input = grunt.file.read(filepath);
var output = processing(input, filepath, dest);
grunt.file.write(dest, output.css);
log('File ' + chalk.cyan(dest) + ' created.');
tally.sheets++;
if (output.map) {
grunt.file.write(dest + '.map', output.map.toString());
log('File ' + chalk.cyan(dest + '.map') + ' created (source map).');
tally.maps++;
}
if (options.diff) {
var diffPath = (typeof options.diff === 'string') ? options.diff : dest + '.diff';
grunt.file.write(diffPath, diff.createPatch(dest, input, output.css));
log('File ' + chalk.cyan(diffPath) + ' created (diff).');
tally.diffs++;
}
});
} catch (e) {
grunt.fail.fatal(e);
}
});
if (tally.sheets) {
grunt.log.ok(tally.sheets + ' ' + 'compiled ' + grunt.util.pluralize(tally.sheets, 'stylesheet/stylesheets') + ' created.');
}
if (tally.maps) {
grunt.log.ok(tally.maps + ' ' + grunt.util.pluralize(tally.maps, 'sourcemap/sourcemaps') + ' created.');
}
if (tally.diffs) {
grunt.log.ok(tally.diffs + ' ' + grunt.util.pluralize(tally.diffs, 'diff/diffs') + ' created.');
}
}
grunt.registerMultiTask('australianStylesheets', 'Compile Australian CSS.', function() {
task(this);
});
grunt.registerMultiTask('ozcss', 'Compile Australian CSS.', function() {
task(this);
});
};
|
import { expect } from "chai";
import sinon from "sinon";
import React from "react";
import { renderIntoDocument, Simulate } from "react-addons-test-utils";
import { findDOMNode } from "react-dom";
import Form from "../src";
import {
createComponent,
createFormComponent,
createSandbox,
} from "./test_utils";
describe("Form", () => {
let sandbox;
beforeEach(() => {
sandbox = createSandbox();
});
afterEach(() => {
sandbox.restore();
});
describe("Empty schema", () => {
it("should render a form tag", () => {
const { node } = createFormComponent({ schema: {} });
expect(node.tagName).eql("FORM");
});
it("should render a submit button", () => {
const { node } = createFormComponent({ schema: {} });
expect(node.querySelectorAll("button[type=submit]")).to.have.length.of(1);
});
it("should render children buttons", () => {
const props = { schema: {} };
const comp = renderIntoDocument(
<Form {...props}>
<button type="submit">Submit</button>
<button type="submit">Another submit</button>
</Form>
);
const node = findDOMNode(comp);
expect(node.querySelectorAll("button[type=submit]")).to.have.length.of(2);
});
});
describe("on component creation", () => {
let comp;
let onChangeProp;
let formData;
let schema;
function createComponent() {
comp = renderIntoDocument(
<Form schema={schema} onChange={onChangeProp} formData={formData}>
<button type="submit">Submit</button>
<button type="submit">Another submit</button>
</Form>
);
}
beforeEach(() => {
onChangeProp = sinon.spy();
schema = {
type: "object",
title: "root object",
required: ["count"],
properties: {
count: {
type: "number",
default: 789,
},
},
};
});
describe("when props.formData does not equal the default values", () => {
beforeEach(() => {
formData = {
foo: 123,
};
createComponent();
});
it("should call props.onChange with current state", () => {
sinon.assert.calledOnce(onChangeProp);
sinon.assert.calledWith(onChangeProp, comp.state);
});
});
describe("when props.formData equals the default values", () => {
beforeEach(() => {
formData = {
count: 789,
};
createComponent();
});
it("should not call props.onChange", () => {
sinon.assert.notCalled(onChangeProp);
});
});
});
describe("Option idPrefix", function() {
it("should change the rendered ids", function() {
const schema = {
type: "object",
title: "root object",
required: ["foo"],
properties: {
count: {
type: "number",
},
},
};
const comp = renderIntoDocument(<Form schema={schema} idPrefix="rjsf" />);
const node = findDOMNode(comp);
const inputs = node.querySelectorAll("input");
const ids = [];
for (var i = 0, len = inputs.length; i < len; i++) {
const input = inputs[i];
ids.push(input.getAttribute("id"));
}
expect(ids).to.eql(["rjsf_count"]);
expect(node.querySelector("fieldset").id).to.eql("rjsf");
});
});
describe("Changing idPrefix", function() {
it("should work with simple example", function() {
const schema = {
type: "object",
title: "root object",
required: ["foo"],
properties: {
count: {
type: "number",
},
},
};
const comp = renderIntoDocument(<Form schema={schema} idPrefix="rjsf" />);
const node = findDOMNode(comp);
const inputs = node.querySelectorAll("input");
const ids = [];
for (var i = 0, len = inputs.length; i < len; i++) {
const input = inputs[i];
ids.push(input.getAttribute("id"));
}
expect(ids).to.eql(["rjsf_count"]);
expect(node.querySelector("fieldset").id).to.eql("rjsf");
});
it("should work with oneOf", function() {
const schema = {
$schema: "http://json-schema.org/draft-06/schema#",
type: "object",
properties: {
connector: {
type: "string",
enum: ["aws", "gcp"],
title: "Provider",
default: "aws",
},
},
dependencies: {
connector: {
oneOf: [
{
type: "object",
properties: {
connector: {
type: "string",
enum: ["aws"],
},
key_aws: {
type: "string",
},
},
},
{
type: "object",
properties: {
connector: {
type: "string",
enum: ["gcp"],
},
key_gcp: {
type: "string",
},
},
},
],
},
},
};
const comp = renderIntoDocument(<Form schema={schema} idPrefix="rjsf" />);
const node = findDOMNode(comp);
const inputs = node.querySelectorAll("input");
const ids = [];
for (var i = 0, len = inputs.length; i < len; i++) {
const input = inputs[i];
ids.push(input.getAttribute("id"));
}
expect(ids).to.eql(["rjsf_key_aws"]);
});
});
describe("Custom field template", () => {
const schema = {
type: "object",
title: "root object",
required: ["foo"],
properties: {
foo: {
type: "string",
description: "this is description",
minLength: 32,
},
},
};
const uiSchema = {
foo: {
"ui:help": "this is help",
},
};
const formData = { foo: "invalid" };
function FieldTemplate(props) {
const {
id,
classNames,
label,
help,
rawHelp,
required,
description,
rawDescription,
errors,
rawErrors,
children,
} = props;
return (
<div className={"my-template " + classNames}>
<label htmlFor={id}>
{label}
{required ? "*" : null}
</label>
{description}
{children}
{errors}
{help}
<span className="raw-help">
{`${rawHelp} rendered from the raw format`}
</span>
<span className="raw-description">
{`${rawDescription} rendered from the raw format`}
</span>
{rawErrors ? (
<ul>
{rawErrors.map((error, i) => (
<li key={i} className="raw-error">
{error}
</li>
))}
</ul>
) : null}
</div>
);
}
let node;
beforeEach(() => {
node = createFormComponent({
schema,
uiSchema,
formData,
FieldTemplate,
liveValidate: true,
}).node;
});
it("should use the provided field template", () => {
expect(node.querySelector(".my-template")).to.exist;
});
it("should use the provided template for labels", () => {
expect(node.querySelector(".my-template > label").textContent).eql(
"root object"
);
expect(
node.querySelector(".my-template .field-string > label").textContent
).eql("foo*");
});
it("should pass description as the provided React element", () => {
expect(node.querySelector("#root_foo__description").textContent).eql(
"this is description"
);
});
it("should pass rawDescription as a string", () => {
expect(node.querySelector(".raw-description").textContent).eql(
"this is description rendered from the raw format"
);
});
it("should pass errors as the provided React component", () => {
expect(node.querySelectorAll(".error-detail li")).to.have.length.of(1);
});
it("should pass rawErrors as an array of strings", () => {
expect(node.querySelectorAll(".raw-error")).to.have.length.of(1);
});
it("should pass help as a the provided React element", () => {
expect(node.querySelector(".help-block").textContent).eql("this is help");
});
it("should pass rawHelp as a string", () => {
expect(node.querySelector(".raw-help").textContent).eql(
"this is help rendered from the raw format"
);
});
});
describe("Custom submit buttons", () => {
it("should submit the form when clicked", done => {
let submitCount = 0;
const onSubmit = () => {
submitCount++;
if (submitCount === 2) {
done();
}
};
const comp = renderIntoDocument(
<Form onSubmit={onSubmit} schema={{}}>
<button type="submit">Submit</button>
<button type="submit">Another submit</button>
</Form>
);
const node = findDOMNode(comp);
const buttons = node.querySelectorAll("button[type=submit]");
buttons[0].click();
buttons[1].click();
});
});
describe("Schema definitions", () => {
it("should use a single schema definition reference", () => {
const schema = {
definitions: {
testdef: { type: "string" },
},
$ref: "#/definitions/testdef",
};
const { node } = createFormComponent({ schema });
expect(node.querySelectorAll("input[type=text]")).to.have.length.of(1);
});
it("should handle multiple schema definition references", () => {
const schema = {
definitions: {
testdef: { type: "string" },
},
type: "object",
properties: {
foo: { $ref: "#/definitions/testdef" },
bar: { $ref: "#/definitions/testdef" },
},
};
const { node } = createFormComponent({ schema });
expect(node.querySelectorAll("input[type=text]")).to.have.length.of(2);
});
it("should handle deeply referenced schema definitions", () => {
const schema = {
definitions: {
testdef: { type: "string" },
},
type: "object",
properties: {
foo: {
type: "object",
properties: {
bar: { $ref: "#/definitions/testdef" },
},
},
},
};
const { node } = createFormComponent({ schema });
expect(node.querySelectorAll("input[type=text]")).to.have.length.of(1);
});
it("should handle references to deep schema definitions", () => {
const schema = {
definitions: {
testdef: {
type: "object",
properties: {
bar: { type: "string" },
},
},
},
type: "object",
properties: {
foo: { $ref: "#/definitions/testdef/properties/bar" },
},
};
const { node } = createFormComponent({ schema });
expect(node.querySelectorAll("input[type=text]")).to.have.length.of(1);
});
it("should handle referenced definitions for array items", () => {
const schema = {
definitions: {
testdef: { type: "string" },
},
type: "object",
properties: {
foo: {
type: "array",
items: { $ref: "#/definitions/testdef" },
},
},
};
const { node } = createFormComponent({
schema,
formData: {
foo: ["blah"],
},
});
expect(node.querySelectorAll("input[type=text]")).to.have.length.of(1);
});
it("should raise for non-existent definitions referenced", () => {
const schema = {
type: "object",
properties: {
foo: { $ref: "#/definitions/nonexistent" },
},
};
expect(() => createFormComponent({ schema })).to.Throw(
Error,
/#\/definitions\/nonexistent/
);
});
it("should propagate referenced definition defaults", () => {
const schema = {
definitions: {
testdef: { type: "string", default: "hello" },
},
$ref: "#/definitions/testdef",
};
const { node } = createFormComponent({ schema });
expect(node.querySelector("input[type=text]").value).eql("hello");
});
it("should propagate nested referenced definition defaults", () => {
const schema = {
definitions: {
testdef: { type: "string", default: "hello" },
},
type: "object",
properties: {
foo: { $ref: "#/definitions/testdef" },
},
};
const { node } = createFormComponent({ schema });
expect(node.querySelector("input[type=text]").value).eql("hello");
});
it("should propagate referenced definition defaults for array items", () => {
const schema = {
definitions: {
testdef: { type: "string", default: "hello" },
},
type: "array",
items: {
$ref: "#/definitions/testdef",
},
};
const { node } = createFormComponent({ schema });
Simulate.click(node.querySelector(".array-item-add button"));
expect(node.querySelector("input[type=text]").value).eql("hello");
});
it("should recursively handle referenced definitions", () => {
const schema = {
$ref: "#/definitions/node",
definitions: {
node: {
type: "object",
properties: {
name: { type: "string" },
children: {
type: "array",
items: {
$ref: "#/definitions/node",
},
},
},
},
},
};
const { node } = createFormComponent({ schema });
expect(node.querySelector("#root_children_0_name")).to.not.exist;
Simulate.click(node.querySelector(".array-item-add button"));
expect(node.querySelector("#root_children_0_name")).to.exist;
});
it("should priorize definition over schema type property", () => {
// Refs bug #140
const schema = {
type: "object",
properties: {
name: { type: "string" },
childObj: {
type: "object",
$ref: "#/definitions/childObj",
},
},
definitions: {
childObj: {
type: "object",
properties: {
otherName: { type: "string" },
},
},
},
};
const { node } = createFormComponent({ schema });
expect(node.querySelectorAll("input[type=text]")).to.have.length.of(2);
});
it("should priorize local properties over definition ones", () => {
// Refs bug #140
const schema = {
type: "object",
properties: {
foo: {
title: "custom title",
$ref: "#/definitions/objectDef",
},
},
definitions: {
objectDef: {
type: "object",
title: "definition title",
properties: {
field: { type: "string" },
},
},
},
};
const { node } = createFormComponent({ schema });
expect(node.querySelector("legend").textContent).eql("custom title");
});
it("should propagate and handle a resolved schema definition", () => {
const schema = {
definitions: {
enumDef: { type: "string", enum: ["a", "b"] },
},
type: "object",
properties: {
name: { $ref: "#/definitions/enumDef" },
},
};
const { node } = createFormComponent({ schema });
expect(node.querySelectorAll("option")).to.have.length.of(3);
});
});
describe("Default value handling on clear", () => {
const schema = {
type: "string",
default: "foo",
};
it("should not set default when a text field is cleared", () => {
const { node } = createFormComponent({ schema, formData: "bar" });
Simulate.change(node.querySelector("input"), {
target: { value: "" },
});
expect(node.querySelector("input").value).eql("");
});
});
describe("Defaults array items default propagation", () => {
const schema = {
type: "object",
title: "lvl 1 obj",
properties: {
object: {
type: "object",
title: "lvl 2 obj",
properties: {
array: {
type: "array",
items: {
type: "object",
title: "lvl 3 obj",
properties: {
bool: {
type: "boolean",
default: true,
},
},
},
},
},
},
},
};
it("should propagate deeply nested defaults to form state", done => {
const { comp, node } = createFormComponent({ schema });
Simulate.click(node.querySelector(".array-item-add button"));
Simulate.submit(node);
// For some reason this may take some time to render, hence the safe wait.
setTimeout(() => {
expect(comp.state.formData).eql({
object: {
array: [
{
bool: true,
},
],
},
});
done();
}, 250);
});
});
describe("Submit handler", () => {
it("should call provided submit handler with form state", () => {
const schema = {
type: "object",
properties: {
foo: { type: "string" },
},
};
const formData = {
foo: "bar",
};
const onSubmit = sandbox.spy();
const { comp, node } = createFormComponent({
schema,
formData,
onSubmit,
});
Simulate.submit(node);
sinon.assert.calledWithMatch(onSubmit, comp.state);
});
it("should not call provided submit handler on validation errors", () => {
const schema = {
type: "object",
properties: {
foo: {
type: "string",
minLength: 1,
},
},
};
const formData = {
foo: "",
};
const onSubmit = sandbox.spy();
const onError = sandbox.spy();
const { node } = createFormComponent({
schema,
formData,
onSubmit,
onError,
});
Simulate.submit(node);
sinon.assert.notCalled(onSubmit);
});
});
describe("Change handler", () => {
it("should call provided change handler on form state change", () => {
const schema = {
type: "object",
properties: {
foo: {
type: "string",
},
},
};
const formData = {
foo: "",
};
const onChange = sandbox.spy();
const { node } = createFormComponent({
schema,
formData,
onChange,
});
Simulate.change(node.querySelector("[type=text]"), {
target: { value: "new" },
});
sinon.assert.calledWithMatch(onChange, {
formData: {
foo: "new",
},
});
});
});
describe("Blur handler", () => {
it("should call provided blur handler on form input blur event", () => {
const schema = {
type: "object",
properties: {
foo: {
type: "string",
},
},
};
const formData = {
foo: "",
};
const onBlur = sandbox.spy();
const { node } = createFormComponent({ schema, formData, onBlur });
const input = node.querySelector("[type=text]");
Simulate.blur(input, {
target: { value: "new" },
});
sinon.assert.calledWithMatch(onBlur, input.id, "new");
});
});
describe("Focus handler", () => {
it("should call provided focus handler on form input focus event", () => {
const schema = {
type: "object",
properties: {
foo: {
type: "string",
},
},
};
const formData = {
foo: "",
};
const onFocus = sandbox.spy();
const { node } = createFormComponent({ schema, formData, onFocus });
const input = node.querySelector("[type=text]");
Simulate.focus(input, {
target: { value: "new" },
});
sinon.assert.calledWithMatch(onFocus, input.id, "new");
});
});
describe("Error handler", () => {
it("should call provided error handler on validation errors", () => {
const schema = {
type: "object",
properties: {
foo: {
type: "string",
minLength: 1,
},
},
};
const formData = {
foo: "",
};
const onError = sandbox.spy();
const { node } = createFormComponent({ schema, formData, onError });
Simulate.submit(node);
sinon.assert.calledOnce(onError);
});
});
describe("Schema and external formData updates", () => {
let comp;
let onChangeProp;
beforeEach(() => {
onChangeProp = sinon.spy();
const formProps = {
schema: {
type: "string",
default: "foobar",
},
formData: "some value",
onChange: onChangeProp,
};
comp = createFormComponent(formProps).comp;
});
describe("when the form data is set to null", () => {
beforeEach(() => comp.componentWillReceiveProps({ formData: null }));
it("should call onChange", () => {
sinon.assert.calledOnce(onChangeProp);
sinon.assert.calledWith(onChangeProp, comp.state);
expect(comp.state.formData).eql("foobar");
});
});
describe("when the schema default is changed but formData is not changed", () => {
const newSchema = {
type: "string",
default: "the new default",
};
beforeEach(() =>
comp.componentWillReceiveProps({
schema: newSchema,
formData: "some value",
})
);
it("should not call onChange", () => {
sinon.assert.notCalled(onChangeProp);
expect(comp.state.formData).eql("some value");
expect(comp.state.schema).deep.eql(newSchema);
});
});
describe("when the schema default is changed and formData is changed", () => {
const newSchema = {
type: "string",
default: "the new default",
};
beforeEach(() =>
comp.componentWillReceiveProps({
schema: newSchema,
formData: "something else",
})
);
it("should not call onChange", () => {
sinon.assert.notCalled(onChangeProp);
expect(comp.state.formData).eql("something else");
expect(comp.state.schema).deep.eql(newSchema);
});
});
describe("when the schema default is changed and formData is nulled", () => {
const newSchema = {
type: "string",
default: "the new default",
};
beforeEach(() =>
comp.componentWillReceiveProps({ schema: newSchema, formData: null })
);
it("should call onChange", () => {
sinon.assert.calledOnce(onChangeProp);
sinon.assert.calledWith(onChangeProp, comp.state);
expect(comp.state.formData).eql("the new default");
});
});
describe("when the onChange prop sets formData to a falsey value", () => {
class TestForm extends React.Component {
constructor() {
super();
this.state = {
formData: {},
};
}
onChange = () => {
this.setState({ formData: this.props.falseyValue });
};
render() {
const schema = {
type: "object",
properties: {
value: {
type: "string",
},
},
};
return (
<Form
onChange={this.onChange}
schema={schema}
formData={this.state.formData}
/>
);
}
}
const falseyValues = [0, false, null, undefined, NaN];
falseyValues.forEach(falseyValue => {
it("Should not crash due to 'Maximum call stack size exceeded...'", () => {
// It is expected that this will throw an error due to non-matching propTypes,
// so the error message needs to be inspected
try {
createComponent(TestForm, { falseyValue });
} catch (e) {
expect(e.message).to.not.equal("Maximum call stack size exceeded");
}
});
});
});
});
describe("External formData updates", () => {
describe("root level", () => {
const formProps = {
schema: { type: "string" },
liveValidate: true,
};
it("should update form state from new formData prop value", () => {
const { comp } = createFormComponent(formProps);
comp.componentWillReceiveProps({ formData: "yo" });
expect(comp.state.formData).eql("yo");
});
it("should validate formData when the schema is updated", () => {
const { comp } = createFormComponent(formProps);
comp.componentWillReceiveProps({
formData: "yo",
schema: { type: "number" },
});
expect(comp.state.errors).to.have.length.of(1);
expect(comp.state.errors[0].stack).to.eql("should be number");
});
});
describe("object level", () => {
it("should update form state from new formData prop value", () => {
const { comp } = createFormComponent({
schema: {
type: "object",
properties: {
foo: {
type: "string",
},
},
},
});
comp.componentWillReceiveProps({ formData: { foo: "yo" } });
expect(comp.state.formData).eql({ foo: "yo" });
});
});
describe("array level", () => {
it("should update form state from new formData prop value", () => {
const schema = {
type: "array",
items: {
type: "string",
},
};
const { comp } = createFormComponent({ schema });
comp.componentWillReceiveProps({ formData: ["yo"] });
expect(comp.state.formData).eql(["yo"]);
});
});
});
describe("Error contextualization", () => {
describe("on form state updated", () => {
const schema = {
type: "string",
minLength: 8,
};
describe("Lazy validation", () => {
it("should not update the errorSchema when the formData changes", () => {
const { comp, node } = createFormComponent({ schema });
Simulate.change(node.querySelector("input[type=text]"), {
target: { value: "short" },
});
expect(comp.state.errorSchema).eql({});
});
it("should not denote an error in the field", () => {
const { node } = createFormComponent({ schema });
Simulate.change(node.querySelector("input[type=text]"), {
target: { value: "short" },
});
expect(node.querySelectorAll(".field-error")).to.have.length.of(0);
});
it("should clean contextualized errors up when they're fixed", () => {
const altSchema = {
type: "object",
properties: {
field1: { type: "string", minLength: 8 },
field2: { type: "string", minLength: 8 },
},
};
const { node } = createFormComponent({
schema: altSchema,
formData: {
field1: "short",
field2: "short",
},
});
function submit(node) {
try {
Simulate.submit(node);
} catch (err) {
// Validation is expected to fail and call console.error, which is
// stubbed to actually throw in createSandbox().
}
}
submit(node);
// Fix the first field
Simulate.change(node.querySelectorAll("input[type=text]")[0], {
target: { value: "fixed error" },
});
submit(node);
expect(node.querySelectorAll(".field-error")).to.have.length.of(1);
// Fix the second field
Simulate.change(node.querySelectorAll("input[type=text]")[1], {
target: { value: "fixed error too" },
});
submit(node);
// No error remaining, shouldn't throw.
Simulate.submit(node);
expect(node.querySelectorAll(".field-error")).to.have.length.of(0);
});
});
describe("Live validation", () => {
it("should update the errorSchema when the formData changes", () => {
const { comp, node } = createFormComponent({
schema,
liveValidate: true,
});
Simulate.change(node.querySelector("input[type=text]"), {
target: { value: "short" },
});
expect(comp.state.errorSchema).eql({
__errors: ["should NOT be shorter than 8 characters"],
});
});
it("should denote the new error in the field", () => {
const { node } = createFormComponent({
schema,
liveValidate: true,
});
Simulate.change(node.querySelector("input[type=text]"), {
target: { value: "short" },
});
expect(node.querySelectorAll(".field-error")).to.have.length.of(1);
expect(
node.querySelector(".field-string .error-detail").textContent
).eql("should NOT be shorter than 8 characters");
});
});
describe("Disable validation onChange event", () => {
it("should not update errorSchema when the formData changes", () => {
const { comp, node } = createFormComponent({
schema,
noValidate: true,
liveValidate: true,
});
Simulate.change(node.querySelector("input[type=text]"), {
target: { value: "short" },
});
expect(comp.state.errorSchema).eql({});
});
});
describe("Disable validation onSubmit event", () => {
it("should not update errorSchema when the formData changes", () => {
const { comp, node } = createFormComponent({
schema,
noValidate: true,
});
Simulate.change(node.querySelector("input[type=text]"), {
target: { value: "short" },
});
Simulate.submit(node);
expect(comp.state.errorSchema).eql({});
});
});
});
describe("on form submitted", () => {
const schema = {
type: "string",
minLength: 8,
};
it("should update the errorSchema on form submission", () => {
const { comp, node } = createFormComponent({
schema,
onError: () => {},
});
Simulate.change(node.querySelector("input[type=text]"), {
target: { value: "short" },
});
Simulate.submit(node);
expect(comp.state.errorSchema).eql({
__errors: ["should NOT be shorter than 8 characters"],
});
});
it("should call the onError handler", () => {
const onError = sandbox.spy();
const { node } = createFormComponent({ schema, onError });
Simulate.change(node.querySelector("input[type=text]"), {
target: { value: "short" },
});
Simulate.submit(node);
sinon.assert.calledWithMatch(
onError,
sinon.match(value => {
return (
value.length === 1 &&
value[0].message === "should NOT be shorter than 8 characters"
);
})
);
});
it("should reset errors and errorSchema state to initial state after correction and resubmission", () => {
const onError = sandbox.spy();
const { comp, node } = createFormComponent({
schema,
onError,
});
Simulate.change(node.querySelector("input[type=text]"), {
target: { value: "short" },
});
Simulate.submit(node);
expect(comp.state.errorSchema).eql({
__errors: ["should NOT be shorter than 8 characters"],
});
expect(comp.state.errors.length).eql(1);
sinon.assert.calledOnce(onError);
Simulate.change(node.querySelector("input[type=text]"), {
target: { value: "long enough" },
});
Simulate.submit(node);
expect(comp.state.errorSchema).eql({});
expect(comp.state.errors).eql([]);
sinon.assert.calledOnce(onError);
});
});
describe("root level", () => {
const formProps = {
liveValidate: true,
schema: {
type: "string",
minLength: 8,
},
formData: "short",
};
it("should reflect the contextualized error in state", () => {
const { comp } = createFormComponent(formProps);
expect(comp.state.errorSchema).eql({
__errors: ["should NOT be shorter than 8 characters"],
});
});
it("should denote the error in the field", () => {
const { node } = createFormComponent(formProps);
expect(node.querySelectorAll(".field-error")).to.have.length.of(1);
expect(
node.querySelector(".field-string .error-detail").textContent
).eql("should NOT be shorter than 8 characters");
});
});
describe("root level with multiple errors", () => {
const formProps = {
liveValidate: true,
schema: {
type: "string",
minLength: 8,
pattern: "d+",
},
formData: "short",
};
it("should reflect the contextualized error in state", () => {
const { comp } = createFormComponent(formProps);
expect(comp.state.errorSchema).eql({
__errors: [
"should NOT be shorter than 8 characters",
'should match pattern "d+"',
],
});
});
it("should denote the error in the field", () => {
const { node } = createFormComponent(formProps);
const liNodes = node.querySelectorAll(".field-string .error-detail li");
const errors = [].map.call(liNodes, li => li.textContent);
expect(errors).eql([
"should NOT be shorter than 8 characters",
'should match pattern "d+"',
]);
});
});
describe("nested field level", () => {
const schema = {
type: "object",
properties: {
level1: {
type: "object",
properties: {
level2: {
type: "string",
minLength: 8,
},
},
},
},
};
const formProps = {
schema,
liveValidate: true,
formData: {
level1: {
level2: "short",
},
},
};
it("should reflect the contextualized error in state", () => {
const { comp } = createFormComponent(formProps);
expect(comp.state.errorSchema).eql({
level1: {
level2: {
__errors: ["should NOT be shorter than 8 characters"],
},
},
});
});
it("should denote the error in the field", () => {
const { node } = createFormComponent(formProps);
const errorDetail = node.querySelector(
".field-object .field-string .error-detail"
);
expect(node.querySelectorAll(".field-error")).to.have.length.of(1);
expect(errorDetail.textContent).eql(
"should NOT be shorter than 8 characters"
);
});
});
describe("array indices", () => {
const schema = {
type: "array",
items: {
type: "string",
minLength: 4,
},
};
const formProps = {
schema,
liveValidate: true,
formData: ["good", "bad", "good"],
};
it("should contextualize the error for array indices", () => {
const { comp } = createFormComponent(formProps);
expect(comp.state.errorSchema).eql({
1: {
__errors: ["should NOT be shorter than 4 characters"],
},
});
});
it("should denote the error in the item field in error", () => {
const { node } = createFormComponent(formProps);
const fieldNodes = node.querySelectorAll(".field-string");
const liNodes = fieldNodes[1].querySelectorAll(
".field-string .error-detail li"
);
const errors = [].map.call(liNodes, li => li.textContent);
expect(fieldNodes[1].classList.contains("field-error")).eql(true);
expect(errors).eql(["should NOT be shorter than 4 characters"]);
});
it("should not denote errors on non impacted fields", () => {
const { node } = createFormComponent(formProps);
const fieldNodes = node.querySelectorAll(".field-string");
expect(fieldNodes[0].classList.contains("field-error")).eql(false);
expect(fieldNodes[2].classList.contains("field-error")).eql(false);
});
});
describe("nested array indices", () => {
const schema = {
type: "object",
properties: {
level1: {
type: "array",
items: {
type: "string",
minLength: 4,
},
},
},
};
const formProps = { schema, liveValidate: true };
it("should contextualize the error for nested array indices", () => {
const { comp } = createFormComponent({
...formProps,
formData: {
level1: ["good", "bad", "good", "bad"],
},
});
expect(comp.state.errorSchema).eql({
level1: {
1: {
__errors: ["should NOT be shorter than 4 characters"],
},
3: {
__errors: ["should NOT be shorter than 4 characters"],
},
},
});
});
it("should denote the error in the nested item field in error", () => {
const { node } = createFormComponent({
...formProps,
formData: {
level1: ["good", "bad", "good"],
},
});
const liNodes = node.querySelectorAll(".field-string .error-detail li");
const errors = [].map.call(liNodes, li => li.textContent);
expect(errors).eql(["should NOT be shorter than 4 characters"]);
});
});
describe("nested arrays", () => {
const schema = {
type: "object",
properties: {
outer: {
type: "array",
items: {
type: "array",
items: {
type: "string",
minLength: 4,
},
},
},
},
};
const formData = {
outer: [["good", "bad"], ["bad", "good"]],
};
const formProps = { schema, formData, liveValidate: true };
it("should contextualize the error for nested array indices", () => {
const { comp } = createFormComponent(formProps);
expect(comp.state.errorSchema).eql({
outer: {
0: {
1: {
__errors: ["should NOT be shorter than 4 characters"],
},
},
1: {
0: {
__errors: ["should NOT be shorter than 4 characters"],
},
},
},
});
});
it("should denote the error in the nested item field in error", () => {
const { node } = createFormComponent(formProps);
const fields = node.querySelectorAll(".field-string");
const errors = [].map.call(fields, field => {
const li = field.querySelector(".error-detail li");
return li && li.textContent;
});
expect(errors).eql([
null,
"should NOT be shorter than 4 characters",
"should NOT be shorter than 4 characters",
null,
]);
});
});
describe("array nested items", () => {
const schema = {
type: "array",
items: {
type: "object",
properties: {
foo: {
type: "string",
minLength: 4,
},
},
},
};
const formProps = {
schema,
liveValidate: true,
formData: [{ foo: "good" }, { foo: "bad" }, { foo: "good" }],
};
it("should contextualize the error for array nested items", () => {
const { comp } = createFormComponent(formProps);
expect(comp.state.errorSchema).eql({
1: {
foo: {
__errors: ["should NOT be shorter than 4 characters"],
},
},
});
});
it("should denote the error in the array nested item", () => {
const { node } = createFormComponent(formProps);
const fieldNodes = node.querySelectorAll(".field-string");
const liNodes = fieldNodes[1].querySelectorAll(
".field-string .error-detail li"
);
const errors = [].map.call(liNodes, li => li.textContent);
expect(fieldNodes[1].classList.contains("field-error")).eql(true);
expect(errors).eql(["should NOT be shorter than 4 characters"]);
});
});
describe("schema dependencies", () => {
const schema = {
type: "object",
properties: {
branch: {
type: "number",
enum: [1, 2, 3],
default: 1,
},
},
required: ["branch"],
dependencies: {
branch: {
oneOf: [
{
properties: {
branch: {
enum: [1],
},
field1: {
type: "number",
},
},
required: ["field1"],
},
{
properties: {
branch: {
enum: [2],
},
field1: {
type: "number",
},
field2: {
type: "number",
},
},
required: ["field1", "field2"],
},
],
},
},
};
it("should only show error for property in selected branch", () => {
const { comp, node } = createFormComponent({
schema,
liveValidate: true,
});
Simulate.change(node.querySelector("input[type=text]"), {
target: { value: "not a number" },
});
expect(comp.state.errorSchema).eql({
field1: {
__errors: ["should be number"],
},
});
});
it("should only show errors for properties in selected branch", () => {
const { comp, node } = createFormComponent({
schema,
liveValidate: true,
formData: { branch: 2 },
});
Simulate.change(node.querySelector("input[type=text]"), {
target: { value: "not a number" },
});
expect(comp.state.errorSchema).eql({
field1: {
__errors: ["should be number"],
},
field2: {
__errors: ["is a required property"],
},
});
});
it("should not show any errors when branch is empty", () => {
const { comp, node } = createFormComponent({
schema,
liveValidate: true,
formData: { branch: 3 },
});
Simulate.change(node.querySelector("select"), {
target: { value: 3 },
});
expect(comp.state.errorSchema).eql({});
});
});
});
describe("Schema and formData updates", () => {
// https://github.com/mozilla-services/react-jsonschema-form/issues/231
const schema = {
type: "object",
properties: {
foo: { type: "string" },
bar: { type: "string" },
},
};
it("should replace state when formData have keys removed", () => {
const formData = { foo: "foo", bar: "bar" };
const { comp, node } = createFormComponent({ schema, formData });
comp.componentWillReceiveProps({
schema: {
type: "object",
properties: {
bar: { type: "string" },
},
},
formData: { bar: "bar" },
});
Simulate.change(node.querySelector("#root_bar"), {
target: { value: "baz" },
});
expect(comp.state.formData).eql({ bar: "baz" });
});
it("should replace state when formData keys have changed", () => {
const formData = { foo: "foo", bar: "bar" };
const { comp, node } = createFormComponent({ schema, formData });
comp.componentWillReceiveProps({
schema: {
type: "object",
properties: {
foo: { type: "string" },
baz: { type: "string" },
},
},
formData: { foo: "foo", baz: "bar" },
});
Simulate.change(node.querySelector("#root_baz"), {
target: { value: "baz" },
});
expect(comp.state.formData).eql({ foo: "foo", baz: "baz" });
});
});
describe("idSchema updates based on formData", () => {
const schema = {
type: "object",
properties: {
a: { type: "string", enum: ["int", "bool"] },
},
dependencies: {
a: {
oneOf: [
{
properties: {
a: { enum: ["int"] },
},
},
{
properties: {
a: { enum: ["bool"] },
b: { type: "boolean" },
},
},
],
},
},
};
it("should not update idSchema for a falsey value", () => {
const formData = { a: "int" };
const { comp } = createFormComponent({ schema, formData });
comp.componentWillReceiveProps({
schema: {
type: "object",
properties: {
a: { type: "string", enum: ["int", "bool"] },
},
dependencies: {
a: {
oneOf: [
{
properties: {
a: { enum: ["int"] },
},
},
{
properties: {
a: { enum: ["bool"] },
b: { type: "boolean" },
},
},
],
},
},
},
formData: { a: "int" },
});
expect(comp.state.idSchema).eql({ $id: "root", a: { $id: "root_a" } });
});
it("should update idSchema based on truthy value", () => {
const formData = {
a: "int",
};
const { comp } = createFormComponent({ schema, formData });
comp.componentWillReceiveProps({
schema: {
type: "object",
properties: {
a: { type: "string", enum: ["int", "bool"] },
},
dependencies: {
a: {
oneOf: [
{
properties: {
a: { enum: ["int"] },
},
},
{
properties: {
a: { enum: ["bool"] },
b: { type: "boolean" },
},
},
],
},
},
},
formData: { a: "bool" },
});
expect(comp.state.idSchema).eql({
$id: "root",
a: { $id: "root_a" },
b: { $id: "root_b" },
});
});
});
describe("Form disable prop", () => {
const schema = {
type: "object",
properties: {
foo: { type: "string" },
bar: { type: "string" },
},
};
const formData = { foo: "foo", bar: "bar" };
it("should enable all items", () => {
const { node } = createFormComponent({ schema, formData });
expect(node.querySelectorAll("input:disabled")).to.have.length.of(0);
});
it("should disable all items", () => {
const { node } = createFormComponent({
schema,
formData,
disabled: true,
});
expect(node.querySelectorAll("input:disabled")).to.have.length.of(2);
});
});
describe("Attributes", () => {
const formProps = {
schema: {},
id: "test-form",
className: "test-class other-class",
name: "testName",
method: "post",
target: "_blank",
action: "/users/list",
autocomplete: "off",
enctype: "multipart/form-data",
acceptcharset: "ISO-8859-1",
noHtml5Validate: true,
};
let node;
beforeEach(() => {
node = createFormComponent(formProps).node;
});
it("should set attr id of form", () => {
expect(node.getAttribute("id")).eql(formProps.id);
});
it("should set attr class of form", () => {
expect(node.getAttribute("class")).eql(formProps.className);
});
it("should set attr name of form", () => {
expect(node.getAttribute("name")).eql(formProps.name);
});
it("should set attr method of form", () => {
expect(node.getAttribute("method")).eql(formProps.method);
});
it("should set attr target of form", () => {
expect(node.getAttribute("target")).eql(formProps.target);
});
it("should set attr action of form", () => {
expect(node.getAttribute("action")).eql(formProps.action);
});
it("should set attr autoComplete of form", () => {
expect(node.getAttribute("autocomplete")).eql(formProps.autocomplete);
});
it("should set attr enctype of form", () => {
expect(node.getAttribute("enctype")).eql(formProps.enctype);
});
it("should set attr acceptcharset of form", () => {
expect(node.getAttribute("accept-charset")).eql(formProps.acceptcharset);
});
it("should set attr novalidate of form", () => {
expect(node.getAttribute("novalidate")).not.to.be.null;
});
});
});
|
const AssetLockOutputNotFoundError = require('../../errors/AssetLockOutputNotFoundError');
/**
* @param {fetchAssetLockTransactionOutput} fetchAssetLockTransactionOutput
* @return {fetchAssetLockPublicKeyHash}
*/
function fetchAssetLockPublicKeyHashFactory(fetchAssetLockTransactionOutput) {
/**
* @typedef {fetchAssetLockPublicKeyHash}
* @param {InstantAssetLockProof|ChainAssetLockProof} assetLockProof
* @param {StateTransitionExecutionContext} executionContext
* @return {Promise<Buffer>}
*/
async function fetchAssetLockPublicKeyHash(assetLockProof, executionContext) {
const output = await fetchAssetLockTransactionOutput(assetLockProof, executionContext);
if (!output) {
throw new AssetLockOutputNotFoundError();
}
return output.script.getData();
}
return fetchAssetLockPublicKeyHash;
}
module.exports = fetchAssetLockPublicKeyHashFactory;
|
// More info on Webpack's Node API here: https://webpack.github.io/docs/node.js-api.html
// Allowing console calls below since this is a build file.
/* eslint-disable no-console */
import webpack from 'webpack';
import config from '../webpack.config.prod';
import { chalkError, chalkProcessing, chalkSuccess, chalkWarning } from './chalkConfig';
process.env.NODE_ENV = 'production'; // this assures React is built in prod mode and that the Babel dev config doesn't apply.
console.log(chalkProcessing('Generating minified bundle. This will take a moment...'));
webpack(config).run((error, stats) => {
if (error) { // so a fatal error occurred. Stop here.
console.log(chalkError(error));
return 1;
}
const jsonStats = stats.toJson();
if (jsonStats.hasErrors) {
return jsonStats.errors.map(error => console.log(chalkError(error)));
}
if (jsonStats.hasWarnings) {
console.log(chalkWarning('Webpack generated the following warnings: '));
jsonStats.warnings.map(warning => console.log(chalkWarning(warning)));
}
console.log(`Webpack stats: ${stats}`);
// if we got this far, the build succeeded.
console.log(chalkSuccess('Your app is compiled in production mode in /front-end/dist. It\'s ready to roll!'));
return 0;
});
|
// **This example illustrates the declaration and instantiation of a minimalist View.**
//
// _Working example: [1.html](../1.html)._
// _[Go to Example 2](2.html)_
// Self-executing wrapper
(function($){
// **ListView class**: Our main app view.
var ListView = Backbone.View.extend({
el: $('body'), // attaches `this.el` to an existing element.
// `initialize()`: Automatically called upon instantiation. Where you make all types of bindings, _excluding_ UI events, such as clicks, etc.
initialize: function(){
_.bindAll(this, 'render'); // fixes loss of context for 'this' within methods
this.render(); // not all views are self-rendering. This one is.
},
// `render()`: Function in charge of rendering the entire view in `this.el`. Needs to be manually called by the user.
render: function(){
$(this.el).append("<ul> <li>hello world</li> </ul>");
}
});
// **listView instance**: Instantiate main app view.
var listView = new ListView();
})(jQuery);
// <div style="float:left; margin-bottom:40px;"><img style="width:36px; margin:5px 10px 0 5px;" src="https://g.twimg.com/Twitter_logo_blue.png"/></div> <div style="background:rgb(245,245,255); padding:10px;">Follow me on Twitter: <a target="_blank" href="http://twitter.com/r2r">@r2r</a> </div>
// <script>
// if (window.location.href.search(/\?x/) < 0) {
// var _gaq = _gaq || [];
// _gaq.push(['_setAccount', 'UA-924459-7']);
// _gaq.push(['_trackPageview']);
// (function() {
// var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
// ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
// var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
// })();
// }
// </script>
|
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.15/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.
//>>built
define({"widgets/Scalebar/setting/nls/strings":{unit:"\u0415\u0434\u0438\u043d\u0438\u0446\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f",style:"\u0421\u0442\u0438\u043b\u044c",dual:"\u0434\u0432\u043e\u0439\u043d\u0430\u044f",english:"\u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439",metric:"\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f",ruler:"\u043b\u0438\u043d\u0435\u0439\u043a\u0430",line:"\u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f",_localized:{}}});
|
positionForPages[17]={page:17,positions:[{w:"",p:[0.097491,0.109074,0.102551,0.109074,0.102551,0.093238,0.097491,0.093238,0.005060]}]};
|
'use strict';
const Path = require('fire-path');
const Fs = require('fire-fs');
const WECHAT = 'wechatgame';
function onBuildFinish(dest) {
let subpackagesPath = Path.join(dest, 'res/raw-assets/game.js');
Fs.ensureFile(subpackagesPath);
let jsonPath = Path.join(dest, 'game.json');
let contents = Fs.readFileSync(jsonPath, 'utf8');
contents = contents.replace(/\"deviceOrientation\"/, ' \"subpackages\":[{\"name\":\"raw-assets\",\"root\":\"res/raw-assets\"}],\n \"deviceOrientation\"');
Fs.writeFileSync(jsonPath, contents);
let jsPath = Path.join(dest, 'game.js');
let jsContent = Fs.readFileSync(jsPath, 'utf8');
jsContent = jsContent.replace(/window\.boot\(\)/, 'if (wx.loadSubpackage) \n wx.loadSubpackage({ name: \'raw-assets\', success(res) {window.boot();}, fail(res) {} });\nelse \n window.boot()');
Fs.writeFileSync(jsPath, jsContent);
}
module.exports = {
load() {
// execute when package loaded
},
unload() {
// execute when package unloaded
},
// register your ipc messages here
messages: {
'open'() {
// open entry panel registered in package.json
Editor.Panel.open('cc-wx-subpackages');
},
'clicked'() {
Editor.log('Button clicked!');
}, 'editor:build-finished'(e, options) {
// Editor.log('editor:build-finished ~~~~~~~~~', options);
if (WECHAT == options.platform)
onBuildFinish(options.dest);
}
},
};
|
document.getElementById("modif_effectue").style.display = 'none';
document.getElementById("suppression_effectue").style.display = 'none';
function modifierprof(event,objet)
{
event.preventDefault();
var $id=(($(objet)).attr('id'));
var id_to_hide = "#prof"+$id;
var id_tel="#telprof"+$id;
//---------//---------//
var $tel=$(id_tel).val();
$.ajax({
headers:
{
'X-CSRF-TOKEN': $('input[name="_token"]').val()
},
type:"POST",
url:"/home/profs/modifier/ajax",
data:{id:$id,tel:$tel},
success:function(data)
{
$("#modif_effectue").show(1000,function()
{
setTimeout(function() { $("#modif_effectue").hide(1000);}, 5000);
});
//
}
})
// body...
}
function verif_prof()
{
var nom = $("#nomduprof").val();
var prenom = $("#prenomduprof").val();
if (nom.includes("-") || nom.includes("1")|| nom.includes("2")|| nom.includes("3")|| nom.includes("4")|| nom.includes("5")|| nom.includes("6")|| nom.includes("7")|| nom.includes("8")|| nom.includes("9")|| nom.includes("0"))
{
$("#nomduprof").removeClass("is-valid state-valid").addClass("is-invalid state-invalid");
$(".btn_ajouter").hide('1000');
return false;
}
else
{
$("#nomduprof").removeClass("is-invalid state-invalid").addClass("is-valid state-valid");
$(".btn_ajouter").show('1000');
}
if (prenom.includes("-") || nom.includes("1")|| nom.includes("2")|| nom.includes("3")|| nom.includes("4")|| nom.includes("5")|| nom.includes("6")|| nom.includes("7")|| nom.includes("8")|| nom.includes("9")|| nom.includes("0"))
{
$("#prenomduprof").removeClass("is-valid state-valid").addClass("is-invalid state-invalid");
$(".btn_ajouter").hide('1000');
return false;
}
else
{
$("#prenomduprof").removeClass("is-invalid state-invalid").addClass("is-valid state-valid");
$(".btn_ajouter").show('1000');
}
$.ajax({
headers:
{
'X-CSRF-TOKEN': $('input[name="_token"]').val()
},
type:"POST",
url:"/home/Enseignants/verif_existance/ajax",
data:{nom:nom,prenom:prenom},
success:function(data)
{
if (data==true)
{
$("#nomduprof").removeClass("is-invalid state-invalid").addClass("is-valid state-valid");
$("#prenomduprof").removeClass("is-invalid state-invalid").addClass("is-valid state-valid");
$("#il_existe_deja").hide('1000', function()
{
$(".btn_ajouter").show(1000);
});
$(".btn_ajouter").show(1000);
//
}
else
{
$("#nomduprof").removeClass("is-valid state-valid").addClass("is-invalid state-invalid");
$("#prenomduprof").removeClass("is-valid state-valid").addClass("is-invalid state-invalid");
$(".btn_ajouter").hide('1000', function()
{
$("#il_existe_deja").show('1000');
});
var element = $('<p id="il_existe_deja" style="font-size: 1.2em;" class="invalid-feedback text-center">Le Prof existe déja</p>');
$(".btn_ajouter").after(element);
//
}
//
}
});
//
}
function supprimerprof (event,objet)
{
event.preventDefault();
$id=(objet.getAttribute('id'));
$id=($id.substr(3));
var id_hide="#prof"+$id;
console.log(id_hide)
$.ajax({
headers:
{
'X-CSRF-TOKEN': $('input[name="_token"]').val()
},
type:"POST",
url:"/home/profs/supprimer/ajax",
data:{id:$id},
success:function(data)
{
if(data!==false)
{
$(id_hide).hide(1000);
$("#suppression_effectue").show(1000,function()
{
setTimeout(function() { $("#suppression_effectue").hide(1000);}, 5000);
});
}
else
{
swal("Suppression Impossible", "Vous Pouvez pas supprimer, ce prof a un groupe", "error");
//
}
//
}
});
// body...
}
function verif_tel(objet)
{
if($(objet).val()=="")
{
$(objet).val(0)
}
if ($(objet).val().length>10 || !$.isNumeric($(objet).val()) )
{
$("#telduprof").removeClass("is-valid state-valid").addClass("is-invalid state-invalid");
$(".btn_ajouter").hide('1000');
//
}
else
{
$("#telduprof").removeClass("is-invalid state-invalid").addClass("is-valid state-valid");
$(".btn_ajouter").show('1000');
//
}
//
}
function ajouterprof(event,ojbet)
{
event.preventDefault();
var selected=[];
var selecteds="";
$('#cycleduprof :selected').each(function()
{
selected[$(this).val()]=$(this).text();
selecteds += $(this).text()+","
});
console.log(selecteds);
var $nom = $("#nomduprof").val();
var $prenom = $("#prenomduprof").val();
var $tel = $("#telduprof").val();
if ($nom == "" || $nom.includes("-"))
{
$("#nomduprof").removeClass("is-valid state-valid").addClass("is-invalid state-invalid");
return false;
//
}
else
{
$("#nomduprof").removeClass("is-invalid state-invalid").addClass("is-valid state-valid");
//
}
if ($prenom == "" || $prenom.includes("-"))
{
$("#prenomduprof").removeClass("is-valid state-valid").addClass("is-invalid state-invalid");
return false;
//
}
else
{
$("#prenomduprof").removeClass("is-invalid state-invalid").addClass("is-valid state-valid");
//
}
if ($tel == "")
{
$("#telduprof").removeClass("is-valid state-valid").addClass("is-invalid state-invalid");
return false;
//
}
else
{
$("#telduprof").removeClass("is-invalid state-invalid").addClass("is-valid state-valid");
//
}
var $cycle = $("#cycleduprof").val();
var $matiere = $("#matiereduprof").val();
var new_id = $(ojbet).attr('id');
var xx=new_id;
new_id=(new_id.substr(5));
new_id = parseInt(new_id)+1;
console.log(new_id);
var currentdate = new Date();
var datetime = currentdate.getDate() + "/"
+ (currentdate.getMonth()+1) + "/"
+ currentdate.getFullYear() + " "
+ currentdate.getHours() + ":"
+ currentdate.getMinutes() + ":"
+ currentdate.getSeconds();
var to_append = '<tr class="alert alert-success" id="prof'+new_id+'"><form>{{ csrf_field() }} <td>'+new_id+'</td>'
to_append+='<td> <span> '+$nom+' </span></td>'
to_append+='<td> <span> '+$prenom+' </span></td>'
to_append+='<td> <input type="text" id="telprof'+new_id+'" class="form-control" value="'+$tel+'"> <span style="display: none;">'+$tel+'</span></td>'
to_append+='<td> <span> '+$cycle+' </span></td>'
to_append+='<td> <span> '+$matiere+' </span></td>'
to_append+='<td> <span> '+datetime+' </span></td>'
to_append+='<td><button style="margin-right:2%;" class="btn btn-primary btn-sm" id="'+new_id+'" onclick="modifierprof(event,this)"> Enregistrer</button>'
to_append+='<a class="btn btn-danger btn-sm" data-toggle="modal" data-target="#myModalsup-'+new_id+'" style="color: #fff;"> supprimer</a><div id="myModalsup-'+new_id+'" class="modal fade" role="dialog">'
to_append+='<div class="modal-dialog modal-lg"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal">×</button><h4 class="modal-title">Voulez-vous vraiment supprimer ce prof</h4></div>'
to_append+='<div class="modal-body"><button style="color:#ffffff; margin-right:1%;" class="col-md-5 btn btn-primary" onclick="supprimerprof(event,this)" data-dismiss="modal" id="mod'+new_id+'">OUI,je supprime</button><a style="color:#ffffff;" data-dismiss="modal" class="col-md-6 btn btn-danger">NON,je ne veux pas supprimer</a></div><div class="modal-footer"><button type="button" class="btn btn-warning" data-dismiss="modal">Fermer</button></div></div></div></div></td></form></tr>'
to_append=$(to_append)
to_append=$(to_append)
to_append.hide(0);
//var newest=new_id+1;
var newest=new_id;
console.log('le newest : ');
console.log(newest);
var xxx = "#"+xx;
console.log($(xxx));
newest="ajout"+newest;
$(xxx).attr('id',newest);
$("#nomduprof").val("");
$.ajax({
headers:
{
'X-CSRF-TOKEN': $('input[name="_token"]').val()
},
type:"POST",
url:"/home/profs/ajouter/ajax",
data:{nom:$nom,prenom:$prenom,tel:$tel,cycle:$cycle,matiere:$matiere},
success:function(data)
{
$("#all_the_profs").append(to_append).show(1500);
to_append.show(1500)
$('html, body').animate({scrollTop:$(document).height()}, 'slow');
//
}
});
// body...
}
|
class HeaderMobile extends Widget {
constructor(node) {
super(node, 'js-header',);
this.opened = false;
this.mobileInit = false;
this.$burgerButton = this.queryElement('.burger');
this.$headerMenu = this.queryElement('.menu');
this.$headerLinks = this.queryElements('.link');
this.$headerSubLinks = this.queryElements('.submenu-link');
this.$headerSubmenu = this.queryElements('.submenu');
this.$headerSubmenu2 = this.queryElements('.submenu_2');
this.$sub = this.queryElement('.sub');
this.$subBack = this.queryElement('.sub_back');
this.$subTitle = this.queryElement('.sub_title');
this.prevTitle = '';
this.onClickLinksEvents = [];
this.onClickSublinksEvents = [];
this.onSubBackClick = this.onSubBackClick.bind(this);
this.toggle = this.toggle.bind(this);
this.resizeEvents = this.resizeEvents.bind(this);
this.events();
}
events() {
this.resizeEvents();
onResize(this.resizeEvents);
}
resizeEvents() {
if (!Layout.isTabletLayout() && !this.mobileInit) return null;
if (!Layout.isTabletLayout() && this.mobileInit) {
this.removeAll();
this.close();
return null;
}
this.setup();
}
setup() {
this.$burgerButton.addEventListener('click', this.toggle);
this.$headerLinks.forEach(link => {
const event = this.onHeaderLinkClick(link);
link.addEventListener('click', event);
this.onClickLinksEvents.push(event);
});
this.$headerSubLinks.forEach(subLink => {
const event = this.onHeaderSubLinkClick(subLink);
subLink.addEventListener('click', event);
this.onClickSublinksEvents.push(event);
});
this.$subBack.addEventListener('click', this.onSubBackClick);
this.mobileInit = true;
}
removeAll() {
this.$burgerButton.removeEventListener('click', this.toggle);
this.$headerLinks.forEach((item, index) => item.removeEventListener('click', this.onClickLinksEvents[index]));
this.$headerSubLinks.forEach((item, index) => item.removeEventListener('click', this.onClickSublinksEvents[index]));
this.$subBack.removeEventListener('click', this.onSubBackClick);
}
hideDropdowns() {
if (this.$sub.classList.contains('_submenu_2-opened')) {
this.$headerSubmenu2.forEach(item => item.classList.contains('visible') ? item.classList.remove('visible') : null);
this.$headerSubLinks.forEach(item => {
if (item.classList.contains('hidden')) {
item.classList.remove('hidden');
this.$subTitle.innerText = this.prevTitle;
}
});
this.$sub.classList.remove('_submenu_2-opened');
} else {
this.$sub.classList.remove('visible');
this.$headerSubmenu.forEach(item => item.classList.contains('visible') ? item.classList.remove('visible') : null);
this.$headerLinks.forEach(link => link.classList.contains('hidden') ? link.classList.remove('hidden') : null);
this.$node.classList.remove('dropdown-opened');
}
}
onSubBackClick(e) {
e.preventDefault();
this.hideDropdowns();
}
onHeaderLinkClick(link) {
return e => {
if (!this.opened) return true;
const $dropdown = link.nextElementSibling;
if (!$dropdown) return;
e.preventDefault();
$dropdown.classList.add('visible');
this.$sub.classList.add('visible');
this.prevTitle = this.$subTitle.innerText;
this.$subTitle.innerText = link.innerText;
this.$node.classList.add('dropdown-opened');
this.$headerLinks.forEach(item => item.classList.add('hidden'));
$dropdown.scrollTop = 0;
};
}
onHeaderSubLinkClick(link) {
return e => {
if (!this.opened) return true;
const $dropdown = link.nextElementSibling;
if (!$dropdown) return;
e.preventDefault();
$dropdown.classList.add('visible');
this.$sub.classList.add('_submenu_2-opened');
this.prevTitle = this.$subTitle.innerText;
this.$subTitle.innerText = link.innerText;
this.$headerSubLinks.forEach(item => item.classList.add('hidden'));
$dropdown.scrollTop = 0;
};
}
open() {
this.$burgerButton.classList.add('opened');
this.$node.classList.add('mobile-opened');
this.$node.classList.add('header--filled');
this.$headerMenu.classList.add('mobile-opened');
this.opened = true;
this.$headerMenu.scrollTop = 0;
hideScrollbar();
}
close() {
this.$burgerButton.classList.remove('opened');
this.$node.classList.remove('mobile-opened');
this.$node.classList.remove('header--filled');
this.$node.classList.remove('dropdown-opened');
this.$headerMenu.classList.remove('mobile-opened');
this.$headerLinks.forEach(link => link.classList.contains('hidden') ? link.classList.remove('hidden') : null);
this.$headerSubmenu.forEach(item => item.classList.contains('visible') ? item.classList.remove('visible') : null);
this.$headerSubLinks.forEach(item => item.classList.contains('hidden') ? item.classList.remove('hidden') : null);
this.$headerSubmenu2.forEach(item => item.classList.contains('visible') ? item.classList.remove('visible') : null);
this.$sub.classList.remove('_submenu_2-opened');
this.$sub.classList.remove('visible');
this.$subTitle.innerText = '';
this.opened = false;
showScrollbar();
this.hideDropdowns();
}
toggle() {
this.opened ? this.close() : this.open();
}
static init(el) {
new HeaderMobile(el);
}
}
window.HeaderMobile = HeaderMobile;
|
const { NotImplementedError } = require('../extensions/index.js')
/**
* Extract season from given date and expose the enemy scout!
*
* @param {Date | FakeDate} date real or fake date
* @returns {String} time of the year
*
* @example
*
* getSeason(new Date(2020, 02, 31)) => 'spring'
*
*/
function getSeason(date) {
// console.log('===========================================')
// console.log(typeof date, date, date.month)
if (!date) return 'Unable to determine the time of year!'
if (
Object.prototype.toString.call(date) !== '[object Date]' ||
Object.getOwnPropertySymbols(date).length !== 0
)
throw new Error('Invalid date!')
const month = date.getMonth()
switch (month) {
case 11:
case 0:
case 1:
return 'winter'
break
case 2:
case 3:
case 4:
return 'spring'
break
case 5:
case 6:
case 7:
return 'summer'
break
case 8:
case 9:
case 10:
return 'autumn'
break
default:
return 'fall'
break
}
}
module.exports = {
getSeason,
}
|
/**
* @license
* Copyright (c) 2018 amCharts (Antanas Marcelionis, Martynas Majeris)
*
* This sofware is provided under multiple licenses. Please see below for
* links to appropriate usage.
*
* Free amCharts linkware license. Details and conditions:
* https://github.com/amcharts/amcharts4/blob/master/LICENSE
*
* One of the amCharts commercial licenses. Details and pricing:
* https://www.amcharts.com/online-store/
* https://www.amcharts.com/online-store/licenses-explained/
*
* If in doubt, contact amCharts at contact@amcharts.com
*
* PLEASE DO NOT REMOVE THIS COPYRIGHT NOTICE.
* @hidden
*/
am4internal_webpackJsonp(["3f14"],{VN5A:function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0});window.am4geodata_moroccoLow={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-14.9062,24.6829],[-14.8688,24.6032],[-14.7499,24.627],[-14.6904,24.5913],[-14.6547,24.4902],[-14.5833,24.4426],[-14.4584,24.5199],[-14.393,24.4783],[-14.3156,24.5259],[-14.2383,24.5259],[-14.155,24.5794],[-14.0717,24.5378],[-14.0063,24.5437],[-13.8457,24.5021],[-13.6077,24.4485],[-13.4114,24.5794],[-13.3163,24.5616],[-13.1735,24.5497],[-12.9415,24.5675],[-12.7154,24.4961],[-12.5489,24.4485],[-12.4418,24.4664],[-12.3228,24.5199],[-12.186,24.5378],[-12.0194,24.5021],[-12.0033,24.4948],[-12.0049,24.3786],[-12.003,24.2394],[-12.0039,24.1052],[-12,24],[-12,23.4545],[-12.0379,23.4477],[-12.0761,23.4443],[-12.1241,23.4441],[-12.1265,23.4373],[-12.3585,23.3242],[-12.5905,23.2885],[-13.0129,23.0208],[-13.1313,22.8136],[-13.1383,22.7863],[-13.1447,22.7521],[-13.1457,22.7314],[-13.138,22.6486],[-13.1341,22.6278],[-13.1285,22.5576],[-13.1062,22.3357],[-13.0921,22.2094],[-13.084,22.115],[-13.0802,22.0908],[-13.0635,21.9291],[-13.0583,21.8739],[-13.0591,21.8601],[-13.0565,21.8539],[-13.0548,21.84],[-13.0555,21.8201],[-13.053,21.8145],[-13.0468,21.7441],[-13.0444,21.7298],[-13.045,21.7096],[-13.042,21.7026],[-13.0315,21.5927],[-13.0245,21.542],[-13.0248,21.5213],[-13.0229,21.5168],[-13.0143,21.4505],[-13.0018,21.3308],[-13.1092,21.3329],[-13.1427,21.333],[-13.1501,21.3317],[-13.2016,21.3338],[-13.4296,21.3367],[-13.8829,21.3404],[-14.2227,21.3424],[-14.2326,21.3413],[-14.5479,21.3431],[-14.5818,21.3418],[-14.5965,21.3436],[-14.6443,21.3433],[-14.6517,21.3419],[-14.7228,21.3433],[-14.7367,21.342],[-14.8282,21.3436],[-14.9609,21.3436],[-15.3653,21.3432],[-15.8771,21.3412],[-16.309,21.337],[-16.8285,21.3306],[-16.9193,21.3304],[-16.9397,21.3266],[-16.9702,21.2208],[-16.9774,21.202],[-16.9873,21.1695],[-17.0031,21.1046],[-17.0093,21.0927],[-17.0261,21.0697],[-17.0398,21.0403],[-17.0488,20.9802],[-17.0664,20.923],[-17.0665,20.8398],[-17.0519,20.7742],[-17.0588,20.7787],[-17.0629,20.7907],[-17.0662,20.7901],[-17.0735,20.8043],[-17.0729,20.8124],[-17.0793,20.8152],[-17.0854,20.8285],[-17.0957,20.8257],[-17.0999,20.8338],[-17.104,20.836],[-17.104,20.8493],[-17.0946,20.8568],[-17.0804,20.8788],[-17.0782,20.8851],[-17.0815,20.9015],[-17.0849,20.9093],[-17.0915,20.9115],[-17.096,20.9224],[-17.0885,20.939],[-17.0863,20.956],[-17.0826,20.966],[-17.0737,20.9776],[-17.0643,21.0007],[-17.0654,21.006],[-17.0632,21.0363],[-17.0626,21.0707],[-17.0651,21.0793],[-17.0638,21.0874],[-17.0593,21.0954],[-17.0579,21.1068],[-17.0538,21.1179],[-17.0546,21.124],[-17.0515,21.1446],[-17.0443,21.1621],[-17.0507,21.1735],[-17.051,21.1846],[-17.0488,21.1924],[-17.0479,21.2104],[-17.0449,21.229],[-17.0404,21.2404],[-17.0357,21.2746],[-17.0279,21.2915],[-17.031,21.2985],[-17.0307,21.3182],[-17.0329,21.3199],[-17.0304,21.3399],[-17.0276,21.346],[-17.0271,21.3599],[-17.0168,21.3854],[-17.0129,21.4023],[-17.0143,21.4215],[-17.0118,21.4287],[-17.011,21.4451],[-17.0035,21.4618],[-17.0032,21.4676],[-16.9954,21.4885],[-16.9932,21.4982],[-16.9929,21.5263],[-16.9876,21.5479],[-16.9821,21.5599],[-16.9804,21.5863],[-16.984,21.5904],[-16.9857,21.6018],[-16.9832,21.6201],[-16.9768,21.6346],[-16.9746,21.6454],[-16.9754,21.666],[-16.9796,21.6726],[-16.9788,21.6826],[-16.9815,21.6887],[-16.9826,21.7007],[-16.9821,21.7188],[-16.9768,21.7262],[-16.9701,21.7287],[-16.9662,21.7368],[-16.9593,21.7426],[-16.9507,21.7599],[-16.9501,21.7685],[-16.9562,21.7724],[-16.9654,21.7729],[-16.9649,21.7865],[-16.9671,21.7935],[-16.9607,21.8051],[-16.9615,21.8124],[-16.9571,21.821],[-16.9551,21.8332],[-16.9443,21.8482],[-16.934,21.8549],[-16.926,21.8654],[-16.9107,21.8813],[-16.9085,21.8876],[-16.9007,21.899],[-16.8937,21.9204],[-16.894,21.9271],[-16.8996,21.9299],[-16.8974,21.9418],[-16.8876,21.9552],[-16.8801,21.9699],[-16.879,21.9813],[-16.8721,21.9885],[-16.8715,21.9998],[-16.8593,22.0315],[-16.8499,22.0454],[-16.8371,22.0882],[-16.8313,22.1015],[-16.824,22.1132],[-16.8237,22.1207],[-16.8174,22.1307],[-16.8157,22.141],[-16.8071,22.1623],[-16.7888,22.1671],[-16.774,22.1765],[-16.7693,22.1832],[-16.7699,22.1946],[-16.7757,22.2021],[-16.7574,22.2265],[-16.7365,22.2388],[-16.7218,22.2518],[-16.7082,22.2665],[-16.7076,22.2724],[-16.7001,22.2812],[-16.6815,22.2957],[-16.6712,22.2965],[-16.6529,22.294],[-16.6463,22.2804],[-16.641,22.2776],[-16.6363,22.269],[-16.6079,22.2715],[-16.5843,22.2779],[-16.569,22.284],[-16.5604,22.2856],[-16.5218,22.3043],[-16.4949,22.3243],[-16.4965,22.3335],[-16.4932,22.3423],[-16.4957,22.3474],[-16.4776,22.3624],[-16.4687,22.3774],[-16.4665,22.3854],[-16.4599,22.3924],[-16.4615,22.4082],[-16.4557,22.4187],[-16.4551,22.429],[-16.4518,22.4337],[-16.4502,22.4524],[-16.4524,22.4582],[-16.446,22.4721],[-16.4424,22.4757],[-16.4399,22.4857],[-16.4418,22.4896],[-16.4404,22.5015],[-16.431,22.5179],[-16.4215,22.5274],[-16.4093,22.5332],[-16.3982,22.5429],[-16.3943,22.5435],[-16.3704,22.5638],[-16.3599,22.5785],[-16.3593,22.6018],[-16.3546,22.6224],[-16.3551,22.6251],[-16.3429,22.6507],[-16.3463,22.6582],[-16.346,22.6652],[-16.3418,22.6768],[-16.3399,22.6907],[-16.3432,22.706],[-16.3437,22.7246],[-16.3396,22.734],[-16.3354,22.7535],[-16.3365,22.7571],[-16.3279,22.7674],[-16.3304,22.7746],[-16.3235,22.7787],[-16.3159,22.7904],[-16.3162,22.794],[-16.3029,22.8091],[-16.2907,22.8268],[-16.2879,22.8349],[-16.2879,22.8446],[-16.2938,22.8518],[-16.3015,22.8524],[-16.3032,22.8626],[-16.301,22.8693],[-16.2912,22.8868],[-16.2882,22.8949],[-16.2868,22.9071],[-16.2821,22.9037],[-16.2799,22.8968],[-16.2676,22.8976],[-16.2546,22.9035],[-16.2279,22.9118],[-16.2143,22.9182],[-16.1943,22.9329],[-16.179,22.9485],[-16.1574,22.9746],[-16.1468,22.9949],[-16.1421,23.0129],[-16.1415,23.0337],[-16.1437,23.0463],[-16.1479,23.0588],[-16.1554,23.0712],[-16.1621,23.079],[-16.1713,23.0863],[-16.1815,23.091],[-16.1899,23.0913],[-16.1999,23.0879],[-16.2065,23.0913],[-16.1993,23.1074],[-16.1943,23.1138],[-16.1888,23.1268],[-16.1637,23.1432],[-16.1629,23.1474],[-16.156,23.1532],[-16.1451,23.1663],[-16.1437,23.1718],[-16.1312,23.1798],[-16.124,23.1896],[-16.1221,23.1971],[-16.114,23.209],[-16.1182,23.226],[-16.1157,23.2329],[-16.0985,23.2501],[-16.0969,23.2549],[-16.0882,23.2649],[-16.0743,23.2912],[-16.0654,23.299],[-16.0601,23.311],[-16.0621,23.3229],[-16.0668,23.329],[-16.0565,23.3349],[-16.0335,23.3546],[-16.0093,23.3771],[-15.9976,23.3893],[-15.9879,23.4068],[-15.981,23.4135],[-15.9793,23.4237],[-15.974,23.4318],[-15.9674,23.4468],[-15.9579,23.4571],[-15.9518,23.4735],[-15.9526,23.4801],[-15.9587,23.4874],[-15.9663,23.4901],[-15.9649,23.4996],[-15.9763,23.504],[-15.9754,23.509],[-15.9599,23.5215],[-15.9429,23.5271],[-15.9376,23.5365],[-15.926,23.5471],[-15.9221,23.556],[-15.9065,23.5646],[-15.9004,23.5749],[-15.9013,23.5813],[-15.8915,23.5932],[-15.8818,23.6129],[-15.8763,23.6171],[-15.8757,23.6274],[-15.8651,23.629],[-15.8599,23.6323],[-15.8565,23.6401],[-15.8482,23.6454],[-15.8474,23.651],[-15.8421,23.6551],[-15.8396,23.6657],[-15.8329,23.6698],[-15.8218,23.6882],[-15.8146,23.6921],[-15.8021,23.7096],[-15.7954,23.7296],[-15.7826,23.7451],[-15.7813,23.7513],[-15.7638,23.7615],[-15.754,23.7721],[-15.7468,23.7774],[-15.7418,23.7857],[-15.739,23.8001],[-15.7349,23.8079],[-15.7282,23.8132],[-15.7176,23.8159],[-15.7135,23.8226],[-15.7143,23.8274],[-15.7212,23.8276],[-15.7271,23.819],[-15.7324,23.8179],[-15.7462,23.8096],[-15.7462,23.8251],[-15.7424,23.831],[-15.7424,23.8382],[-15.736,23.8554],[-15.7218,23.8721],[-15.7232,23.8787],[-15.7182,23.8871],[-15.7101,23.8924],[-15.7132,23.9015],[-15.7126,23.9085],[-15.7204,23.9179],[-15.7143,23.934],[-15.7115,23.9454],[-15.7074,23.9507],[-15.7054,23.959],[-15.7007,23.9674],[-15.6996,23.9796],[-15.7149,23.9729],[-15.7224,23.9601],[-15.7326,23.951],[-15.7499,23.9457],[-15.7515,23.9354],[-15.7471,23.9288],[-15.7482,23.9188],[-15.7538,23.9185],[-15.7568,23.906],[-15.7651,23.9051],[-15.7651,23.9215],[-15.7754,23.914],[-15.7829,23.9118],[-15.7851,23.8998],[-15.7943,23.8924],[-15.7946,23.8865],[-15.801,23.8737],[-15.8101,23.8668],[-15.819,23.8646],[-15.8288,23.856],[-15.8346,23.8551],[-15.8396,23.861],[-15.8474,23.8579],[-15.8571,23.8454],[-15.8637,23.8307],[-15.8735,23.8282],[-15.879,23.821],[-15.8849,23.8054],[-15.8896,23.8026],[-15.896,23.7937],[-15.8988,23.7846],[-15.9004,23.7701],[-15.9063,23.7673],[-15.9087,23.7413],[-15.9135,23.7351],[-15.9165,23.7254],[-15.9168,23.7151],[-15.9224,23.7096],[-15.9246,23.7015],[-15.9351,23.6918],[-15.939,23.6829],[-15.951,23.676],[-15.9565,23.6696],[-15.9649,23.666],[-15.9671,23.6565],[-15.9821,23.6371],[-15.9813,23.6301],[-15.9965,23.6307],[-16.0018,23.6335],[-16.0071,23.6418],[-16.006,23.6496],[-15.9996,23.6554],[-15.9887,23.669],[-15.9846,23.6801],[-15.9679,23.6907],[-15.9582,23.7035],[-15.9596,23.7196],[-15.9582,23.724],[-15.9446,23.7335],[-15.9304,23.7465],[-15.9215,23.7621],[-15.9257,23.7671],[-15.9235,23.7774],[-15.9182,23.7865],[-15.9168,23.7976],[-15.9046,23.8187],[-15.8679,23.8554],[-15.8651,23.861],[-15.8462,23.8832],[-15.8332,23.8957],[-15.8149,23.9063],[-15.8032,23.9179],[-15.8049,23.9226],[-15.7924,23.9265],[-15.7818,23.936],[-15.7699,23.9424],[-15.7638,23.9493],[-15.7488,23.9579],[-15.7338,23.964],[-15.731,23.9671],[-15.6979,23.9818],[-15.6837,23.9896],[-15.6801,23.9899],[-15.6615,23.999],[-15.6565,24.0052],[-15.6338,24.0162],[-15.6087,24.036],[-15.5996,24.039],[-15.5929,24.044],[-15.581,24.0579],[-15.5768,24.0696],[-15.5837,24.0785],[-15.5735,24.0943],[-15.5551,24.1026],[-15.544,24.1132],[-15.5399,24.1149],[-15.5263,24.1293],[-15.5215,24.1371],[-15.5207,24.1448],[-15.5035,24.1546],[-15.4999,24.1596],[-15.4865,24.1707],[-15.479,24.1829],[-15.4654,24.1946],[-15.4538,24.2079],[-15.4385,24.2221],[-15.426,24.231],[-15.4176,24.241],[-15.4093,24.2457],[-15.396,24.2571],[-15.3715,24.269],[-15.354,24.2851],[-15.3324,24.3021],[-15.3251,24.3093],[-15.3132,24.3268],[-15.2951,24.3443],[-15.2882,24.3551],[-15.2779,24.3657],[-15.264,24.3849],[-15.2643,24.3874],[-15.256,24.401],[-15.2351,24.4246],[-15.2279,24.4301],[-15.2215,24.4401],[-15.2076,24.4479],[-15.2051,24.4526],[-15.1915,24.4618],[-15.1671,24.4887],[-15.1551,24.4935],[-15.1501,24.4988],[-15.1135,24.5146],[-15.0976,24.5201],[-15.0835,24.5235],[-15.0718,24.5288],[-15.0554,24.5321],[-15.0518,24.5357],[-15.0343,24.5421],[-15.0221,24.5485],[-15.0065,24.5613],[-15.0024,24.5693],[-15.0021,24.5851],[-14.9943,24.5932],[-14.989,24.6088],[-14.9857,24.6321],[-14.9735,24.6399],[-14.959,24.6446],[-14.9376,24.6565],[-14.924,24.6673],[-14.9138,24.6779],[-14.9062,24.6829]]]},properties:{name:"Dakhla-Oued Ed-Dahab",id:"MA-12",TYPE:"Region",CNTRY:"Morooco"},id:"MA-12"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-11.7752,28.2151],[-11.7453,28.1471],[-11.714,28.0712],[-11.6738,28.0396],[-11.644,28.0066],[-11.6197,27.9515],[-11.6106,27.9182],[-11.5637,27.8509],[-11.5142,27.7987],[-11.3139,27.7974],[-11.195,27.7319],[-11.1474,27.726],[-11.0938,27.7795],[-10.7726,27.7795],[-10.5823,27.7855],[-10.5287,27.7438],[-10.3741,27.8033],[-10.3205,27.7914],[-10.2372,27.7795],[-10.1599,27.6844],[-10.0528,27.5951],[-9.8922,27.6546],[-9.7137,27.4405],[-9.6245,27.4286],[-9.5591,27.3869],[-9.3925,27.3988],[-9.339,27.4524],[-9.2736,27.4583],[-8.9761,27.0122],[-8.8512,26.9765],[-8.7025,26.9527],[-8.6729,26.952],[-8.672,26.3044],[-8.6742,25.9976],[-8.9791,25.9969],[-9.2838,25.9993],[-9.4871,25.9979],[-9.5629,26],[-9.686,25.9975],[-9.697,25.999],[-9.8889,25.9978],[-10.2179,25.9997],[-10.3741,25.9987],[-10.6862,26],[-10.8413,25.9985],[-11.5652,25.9985],[-11.9186,25.9978],[-12.0039,25.9986],[-12.0051,25.8631],[-12.0034,25.7292],[-12.0063,24.7866],[-12.003,24.5133],[-12.0033,24.4948],[-12.0194,24.5021],[-12.186,24.5378],[-12.3228,24.5199],[-12.4418,24.4664],[-12.5489,24.4485],[-12.7154,24.4961],[-12.9415,24.5675],[-13.1735,24.5497],[-13.3163,24.5616],[-13.4114,24.5794],[-13.6077,24.4485],[-13.8457,24.5021],[-14.0063,24.5437],[-14.0717,24.5378],[-14.155,24.5794],[-14.2383,24.5259],[-14.3156,24.5259],[-14.393,24.4783],[-14.4584,24.5199],[-14.5833,24.4426],[-14.6547,24.4902],[-14.6904,24.5913],[-14.7499,24.627],[-14.8688,24.6032],[-14.9062,24.6829],[-14.8938,24.6904],[-14.8826,24.7018],[-14.8818,24.7104],[-14.8846,24.716],[-14.8843,24.7346],[-14.8879,24.741],[-14.8824,24.759],[-14.8826,24.7687],[-14.8754,24.7879],[-14.8751,24.7951],[-14.8679,24.8154],[-14.8593,24.8287],[-14.859,24.8349],[-14.8504,24.8485],[-14.8474,24.8649],[-14.841,24.8735],[-14.8387,24.884],[-14.8329,24.8957],[-14.8307,24.9071],[-14.831,24.9274],[-14.8338,24.9435],[-14.8321,24.9574],[-14.8265,24.9671],[-14.8238,24.989],[-14.8232,25.0213],[-14.8193,25.0393],[-14.8207,25.0571],[-14.8254,25.0635],[-14.829,25.0743],[-14.8415,25.0818],[-14.8421,25.0885],[-14.8374,25.1004],[-14.841,25.1176],[-14.846,25.1254],[-14.8396,25.1374],[-14.8396,25.1479],[-14.8371,25.1615],[-14.841,25.1807],[-14.8449,25.1915],[-14.846,25.2046],[-14.8432,25.2149],[-14.8387,25.2213],[-14.8332,25.2385],[-14.829,25.2432],[-14.826,25.2529],[-14.8248,25.2648],[-14.829,25.284],[-14.8288,25.2957],[-14.8168,25.3135],[-14.8126,25.3221],[-14.8146,25.3376],[-14.8104,25.3407],[-14.8004,25.3574],[-14.7929,25.3782],[-14.7949,25.3957],[-14.7874,25.419],[-14.7774,25.4301],[-14.776,25.4382],[-14.7668,25.449],[-14.7615,25.4582],[-14.7499,25.4704],[-14.7418,25.4762],[-14.7321,25.4871],[-14.7288,25.4951],[-14.721,25.5027],[-14.7096,25.524],[-14.7071,25.5312],[-14.6979,25.5446],[-14.6957,25.5532],[-14.6879,25.5732],[-14.6854,25.5904],[-14.6871,25.5954],[-14.6849,25.6129],[-14.6865,25.6188],[-14.6801,25.6265],[-14.6732,25.6493],[-14.6651,25.6652],[-14.6651,25.6735],[-14.6621,25.6818],[-14.6621,25.6912],[-14.6563,25.7082],[-14.6518,25.7143],[-14.6485,25.7271],[-14.6424,25.741],[-14.6385,25.7574],[-14.6388,25.7649],[-14.6346,25.7735],[-14.6146,25.7857],[-14.6099,25.7935],[-14.601,25.8018],[-14.5863,25.826],[-14.5774,25.8348],[-14.5674,25.8476],[-14.5635,25.856],[-14.5627,25.8638],[-14.5362,25.9043],[-14.5299,25.916],[-14.5262,25.9368],[-14.5168,25.9462],[-14.5093,25.971],[-14.5046,25.9757],[-14.4985,25.9873],[-14.496,25.9962],[-14.4932,26.0232],[-14.4879,26.036],[-14.4899,26.0499],[-14.4896,26.0738],[-14.4876,26.0774],[-14.486,26.094],[-14.4896,26.1076],[-14.4976,26.1221],[-14.5015,26.126],[-14.4851,26.1585],[-14.4829,26.1662],[-14.4779,26.1704],[-14.4743,26.1807],[-14.4613,26.1954],[-14.4429,26.2215],[-14.439,26.224],[-14.4293,26.2379],[-14.4171,26.246],[-14.4035,26.2626],[-14.396,26.2651],[-14.386,26.2651],[-14.364,26.2676],[-14.3443,26.2718],[-14.3279,26.2768],[-14.3126,26.2851],[-14.3124,26.2882],[-14.2979,26.301],[-14.2707,26.3174],[-14.266,26.3226],[-14.2529,26.3307],[-14.2449,26.3374],[-14.231,26.3579],[-14.221,26.3649],[-14.2054,26.3826],[-14.1901,26.4079],[-14.189,26.4154],[-14.1829,26.4246],[-14.174,26.4274],[-14.1571,26.4251],[-14.1418,26.4251],[-14.1079,26.429],[-14.0807,26.4346],[-14.036,26.4465],[-14.0285,26.4507],[-14.016,26.4538],[-14.0046,26.4585],[-13.996,26.4643],[-13.9776,26.4707],[-13.9704,26.4774],[-13.9615,26.4823],[-13.9504,26.4938],[-13.9387,26.4998],[-13.9313,26.5074],[-13.9196,26.5154],[-13.9029,26.5246],[-13.8946,26.5268],[-13.8804,26.5349],[-13.866,26.541],[-13.8471,26.5562],[-13.8268,26.5635],[-13.8113,26.5735],[-13.8035,26.5757],[-13.7854,26.5857],[-13.7768,26.5921],[-13.7679,26.594],[-13.7416,26.6096],[-13.7107,26.6254],[-13.7018,26.6318],[-13.6774,26.6457],[-13.631,26.6779],[-13.6132,26.6924],[-13.6082,26.6987],[-13.5801,26.7262],[-13.5737,26.7315],[-13.5624,26.746],[-13.5613,26.7513],[-13.5493,26.769],[-13.5418,26.7863],[-13.5324,26.7974],[-13.5268,26.8118],[-13.5268,26.8179],[-13.5165,26.8363],[-13.4988,26.8732],[-13.486,26.9096],[-13.4885,26.9149],[-13.486,26.9246],[-13.4785,26.9376],[-13.4729,26.961],[-13.4626,26.9821],[-13.4499,27.0113],[-13.4404,27.0293],[-13.4343,27.0443],[-13.4321,27.0576],[-13.4274,27.069],[-13.4204,27.0776],[-13.4185,27.0924],[-13.4224,27.0973],[-13.4168,27.111],[-13.4157,27.1271],[-13.4115,27.1385],[-13.409,27.1535],[-13.4088,27.1651],[-13.4007,27.1737],[-13.391,27.1874],[-13.3876,27.1965],[-13.3763,27.2115],[-13.3721,27.2246],[-13.349,27.2601],[-13.3362,27.2721],[-13.3232,27.2907],[-13.3149,27.3074],[-13.3049,27.3238],[-13.3015,27.344],[-13.2907,27.3571],[-13.2771,27.3855],[-13.2749,27.399],[-13.2705,27.4121],[-13.2637,27.4263],[-13.2585,27.4432],[-13.2496,27.4624],[-13.2435,27.4782],[-13.2299,27.5046],[-13.2265,27.5237],[-13.2224,27.5335],[-13.2171,27.5554],[-13.2101,27.5679],[-13.2049,27.5815],[-13.2035,27.6001],[-13.1976,27.6171],[-13.1979,27.6221],[-13.1918,27.634],[-13.1851,27.6429],[-13.1671,27.6831],[-13.1668,27.6904],[-13.1599,27.6971],[-13.129,27.7074],[-13.1129,27.721],[-13.0887,27.7304],[-13.0707,27.7354],[-13.0501,27.7512],[-13.0446,27.759],[-13.0376,27.7754],[-13.0274,27.7951],[-13.0085,27.8085],[-13.0063,27.8224],[-13.0013,27.8313],[-13.0018,27.8362],[-12.9965,27.851],[-12.989,27.8582],[-12.9885,27.8665],[-12.9826,27.8826],[-12.9826,27.8879],[-12.9654,27.9043],[-12.959,27.921],[-12.9368,27.9301],[-12.9326,27.941],[-12.9193,27.9496],[-12.9171,27.9532],[-12.8743,27.9549],[-12.8512,27.959],[-12.8443,27.9585],[-12.8296,27.9646],[-12.7868,27.9687],[-12.759,27.9721],[-12.7476,27.9724],[-12.7218,27.9754],[-12.7168,27.9776],[-12.6838,27.9807],[-12.669,27.9807],[-12.6318,27.9865],[-12.6187,27.9876],[-12.6046,27.9915],[-12.5785,27.9938],[-12.5682,27.9962],[-12.5404,28.0007],[-12.5251,28.0063],[-12.4896,28.0124],[-12.4632,28.0154],[-12.4563,28.0179],[-12.4354,28.0207],[-12.381,28.0304],[-12.3746,28.0304],[-12.344,28.0377],[-12.2932,28.0446],[-12.2729,28.0485],[-12.2585,28.0532],[-12.2337,28.0537],[-12.2112,28.0587],[-12.1938,28.061],[-12.1593,28.0704],[-12.109,28.0821],[-12.0843,28.0859],[-12.0651,28.0946],[-12.0515,28.0971],[-12.0463,28.1046],[-12.0196,28.1179],[-12.0101,28.1204],[-11.9954,28.1279],[-11.9754,28.136],[-11.9574,28.1476],[-11.9451,28.1518],[-11.9226,28.1621],[-11.9157,28.1635],[-11.9051,28.169],[-11.8393,28.1907],[-11.8215,28.199],[-11.7963,28.2088],[-11.7752,28.2151]]]},properties:{name:"Laâyoune-Sakia El Hamra",id:"MA-11",TYPE:"Region",CNTRY:"Morooco"},id:"MA-11"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-10.0304,29.6072],[-9.9922,29.514],[-9.8994,29.5711],[-9.8779,29.4426],[-9.8137,29.3962],[-9.7637,29.4462],[-9.6995,29.4747],[-9.6424,29.4176],[-9.5603,29.4854],[-9.5139,29.4605],[-9.4996,29.4105],[-9.4675,29.4391],[-9.4318,29.4283],[-9.4104,29.4497],[-9.3961,29.514],[-9.2462,29.4997],[-9.1784,29.3998],[-9.1605,29.3034],[-9.1393,29.2769],[-9.1403,29.2743],[-9.0784,29.2356],[-9.082,29.1678],[-9.1177,29.1535],[-9.1248,29.0928],[-9.1534,29.0786],[-9.2176,29.0821],[-9.2569,29.0572],[-9.2426,29],[-9.2176,28.9857],[-9.1891,28.9715],[-9.2034,28.9108],[-9.1141,28.9108],[-9.1427,28.8501],[-9.1534,28.793],[-9.1391,28.7538],[-9.0713,28.7538],[-9.0642,28.6788],[-8.9392,28.6574],[-8.9357,28.5646],[-8.7179,28.3255],[-8.6674,28.3191],[-8.6677,28.2403],[-8.6663,27.9247],[-8.6668,27.6701],[-8.67,27.6701],[-8.6721,27.6079],[-8.6713,27.4471],[-8.6739,27.2981],[-8.6725,27.2883],[-8.6733,27.2079],[-8.6711,27.1265],[-8.673,27.0457],[-8.6729,26.952],[-8.7025,26.9527],[-8.8512,26.9765],[-8.9761,27.0122],[-9.2736,27.4583],[-9.339,27.4524],[-9.3925,27.3988],[-9.5591,27.3869],[-9.6245,27.4286],[-9.7137,27.4405],[-9.8922,27.6546],[-10.0528,27.5951],[-10.1599,27.6844],[-10.2372,27.7795],[-10.3205,27.7914],[-10.3741,27.8033],[-10.5287,27.7438],[-10.5823,27.7855],[-10.7726,27.7795],[-11.0938,27.7795],[-11.1474,27.726],[-11.195,27.7319],[-11.3139,27.7974],[-11.5142,27.7987],[-11.5637,27.8509],[-11.6106,27.9182],[-11.6197,27.9515],[-11.644,28.0066],[-11.6738,28.0396],[-11.714,28.0712],[-11.7453,28.1471],[-11.7752,28.2151],[-11.7568,28.2235],[-11.7407,28.2276],[-11.734,28.2321],[-11.711,28.238],[-11.7035,28.2432],[-11.6976,28.2432],[-11.6713,28.2518],[-11.6638,28.2518],[-11.6462,28.2582],[-11.6165,28.2654],[-11.6121,28.2687],[-11.5874,28.2765],[-11.571,28.2849],[-11.5535,28.2896],[-11.5435,28.2946],[-11.5351,28.2921],[-11.536,28.2857],[-11.5265,28.2852],[-11.529,28.2918],[-11.5263,28.299],[-11.5179,28.3063],[-11.5074,28.3087],[-11.4926,28.3226],[-11.4729,28.3315],[-11.4624,28.3379],[-11.4504,28.3538],[-11.446,28.3718],[-11.4424,28.3776],[-11.4318,28.3824],[-11.4268,28.3913],[-11.4201,28.3935],[-11.4046,28.4088],[-11.3951,28.4254],[-11.3899,28.4285],[-11.3887,28.4396],[-11.3815,28.4465],[-11.3701,28.4512],[-11.3574,28.4618],[-11.3504,28.471],[-11.3532,28.4749],[-11.3479,28.4871],[-11.3246,28.5112],[-11.3199,28.5174],[-11.3101,28.5238],[-11.3054,28.5312],[-11.2818,28.5457],[-11.2624,28.5626],[-11.2529,28.5688],[-11.226,28.5968],[-11.2185,28.6084],[-11.2065,28.6201],[-11.1812,28.6346],[-11.1665,28.6451],[-11.1335,28.6774],[-11.1135,28.6871],[-11.1118,28.6923],[-11.0971,28.7043],[-11.0893,28.7162],[-11.0749,28.7315],[-11.0749,28.7415],[-11.0676,28.7443],[-11.0457,28.7599],[-11.0335,28.7651],[-11.0254,28.7663],[-11.0054,28.7732],[-10.991,28.7835],[-10.9754,28.7896],[-10.9721,28.7932],[-10.9632,28.7949],[-10.9501,28.8029],[-10.9426,28.804],[-10.9149,28.8171],[-10.9079,28.8188],[-10.8918,28.8276],[-10.8668,28.8379],[-10.8587,28.8429],[-10.8451,28.8479],[-10.8132,28.8643],[-10.7679,28.8846],[-10.7632,28.8885],[-10.7129,28.9115],[-10.699,28.9198],[-10.671,28.9335],[-10.6482,28.9468],[-10.6413,28.9496],[-10.6118,28.966],[-10.6007,28.9737],[-10.5949,28.9757],[-10.5824,28.9843],[-10.5521,29.0004],[-10.5099,29.0285],[-10.4913,29.0499],[-10.4865,29.0515],[-10.4829,29.059],[-10.4751,29.0635],[-10.4643,29.0749],[-10.4576,29.0857],[-10.449,29.0896],[-10.4476,29.0946],[-10.4404,29.0943],[-10.4396,29.1018],[-10.4329,29.114],[-10.4249,29.1246],[-10.4246,29.1299],[-10.4135,29.1373],[-10.4063,29.1379],[-10.4057,29.1468],[-10.3935,29.1613],[-10.3918,29.1688],[-10.3785,29.1829],[-10.3679,29.191],[-10.3412,29.2176],[-10.3388,29.2263],[-10.3151,29.2432],[-10.2957,29.2632],[-10.2849,29.2646],[-10.2629,29.2762],[-10.2571,29.2821],[-10.2521,29.2826],[-10.2374,29.2971],[-10.2326,29.2982],[-10.2254,29.3062],[-10.2154,29.3135],[-10.2146,29.3207],[-10.2071,29.3371],[-10.1876,29.3618],[-10.1821,29.3774],[-10.1688,29.3943],[-10.1565,29.4071],[-10.1557,29.4112],[-10.1238,29.4371],[-10.1157,29.4471],[-10.0954,29.4871],[-10.0851,29.4946],[-10.0771,29.5029],[-10.0765,29.5126],[-10.0707,29.529],[-10.074,29.5326],[-10.0649,29.5382],[-10.0674,29.544],[-10.0635,29.551],[-10.0568,29.5518],[-10.0601,29.561],[-10.0546,29.574],[-10.0493,29.5779],[-10.0454,29.5893],[-10.034,29.5951],[-10.0304,29.6072]]]},properties:{name:"Guelmim-Oued Noun",id:"MA-10",TYPE:"Region",CNTRY:"Morooco"},id:"MA-10"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-6.4568,29.5621],[-6.467,29.559],[-6.4861,29.5505],[-6.4953,29.5442],[-6.5137,29.5346],[-6.5211,29.524],[-6.5264,29.5204],[-6.5337,29.5202],[-6.5471,29.5245],[-6.561,29.5222],[-6.5753,29.522],[-6.5892,29.5249],[-6.6176,29.5292],[-6.623,29.5265],[-6.623,29.5207],[-6.6302,29.5192],[-6.6444,29.5197],[-6.6582,29.5171],[-6.6796,29.5175],[-6.6935,29.5147],[-6.7198,29.5052],[-6.7454,29.4751],[-6.762,29.4635],[-6.7761,29.4616],[-6.7902,29.4632],[-6.8045,29.4633],[-6.8326,29.4675],[-6.8453,29.4729],[-6.8549,29.4822],[-6.8616,29.4842],[-6.8758,29.4827],[-6.8898,29.4844],[-6.9075,29.4951],[-6.9214,29.4971],[-6.9356,29.496],[-6.9498,29.497],[-6.9636,29.4939],[-6.9706,29.4947],[-6.9813,29.5028],[-6.9883,29.5034],[-7.0023,29.5011],[-7.0146,29.4947],[-7.0215,29.4931],[-7.0343,29.4982],[-7.0415,29.4984],[-7.062,29.5033],[-7.0798,29.5137],[-7.1066,29.522],[-7.1137,29.5228],[-7.1276,29.52],[-7.1487,29.5222],[-7.1553,29.5201],[-7.1863,29.5045],[-7.2196,29.4934],[-7.2387,29.4849],[-7.251,29.477],[-7.2931,29.4602],[-7.336,29.4388],[-7.3949,29.4138],[-7.5037,29.4049],[-7.5986,29.3758],[-7.6174,29.367],[-7.6257,29.3569],[-7.6237,29.345],[-7.6241,29.3333],[-7.6327,29.3244],[-7.6347,29.3184],[-7.6448,29.3102],[-7.65,29.2983],[-7.6627,29.3019],[-7.6831,29.2972],[-7.6948,29.2901],[-7.7083,29.2868],[-7.7478,29.2732],[-7.7853,29.2554],[-7.7963,29.2476],[-7.8169,29.2303],[-7.8284,29.223],[-7.8437,29.2101],[-7.8623,29.201],[-7.8758,29.197],[-7.8841,29.1878],[-7.898,29.1866],[-7.9102,29.1801],[-7.9323,29.1645],[-7.9563,29.1416],[-7.9591,29.1298],[-7.9995,29.1055],[-8.0308,29.0909],[-8.0547,29.0777],[-8.065,29.0692],[-8.0783,29.0657],[-8.1052,29.0455],[-8.1232,29.0355],[-8.1341,29.0275],[-8.1462,29.0211],[-8.1508,29.0164],[-8.1642,29.0128],[-8.1777,29.0157],[-8.1999,29.0001],[-8.2232,28.986],[-8.2478,28.9636],[-8.2714,28.95],[-8.3071,28.926],[-8.3539,28.89],[-8.4026,28.8458],[-8.4328,28.8153],[-8.4627,28.7952],[-8.5034,28.7812],[-8.583,28.7468],[-8.5891,28.7431],[-8.6509,28.7184],[-8.6677,28.7135],[-8.6669,28.4602],[-8.6674,28.3191],[-8.7179,28.3255],[-8.9357,28.5646],[-8.9392,28.6574],[-9.0642,28.6788],[-9.0713,28.7538],[-9.1391,28.7538],[-9.1534,28.793],[-9.1427,28.8501],[-9.1141,28.9108],[-9.2034,28.9108],[-9.1891,28.9715],[-9.2176,28.9857],[-9.2426,29],[-9.2569,29.0572],[-9.2176,29.0821],[-9.1534,29.0786],[-9.1248,29.0928],[-9.1177,29.1535],[-9.082,29.1678],[-9.0784,29.2356],[-9.1403,29.2743],[-9.1393,29.2769],[-9.1605,29.3034],[-9.1784,29.3998],[-9.2462,29.4997],[-9.3961,29.514],[-9.4104,29.4497],[-9.4318,29.4283],[-9.4675,29.4391],[-9.4996,29.4105],[-9.5139,29.4605],[-9.5603,29.4854],[-9.6424,29.4176],[-9.6995,29.4747],[-9.7637,29.4462],[-9.8137,29.3962],[-9.8779,29.4426],[-9.8994,29.5711],[-9.9922,29.514],[-10.0304,29.6072],[-10.0251,29.6118],[-10.0107,29.6304],[-10.0099,29.6371],[-10.004,29.644],[-9.9935,29.6504],[-9.991,29.6576],[-9.986,29.661],[-9.9829,29.676],[-9.9685,29.6871],[-9.9662,29.6935],[-9.951,29.7057],[-9.9343,29.721],[-9.9182,29.734],[-9.9132,29.7365],[-9.8865,29.7571],[-9.8699,29.7715],[-9.8632,29.779],[-9.8499,29.7901],[-9.839,29.8032],[-9.8321,29.8057],[-9.8274,29.8193],[-9.8154,29.8351],[-9.8007,29.8493],[-9.7893,29.8651],[-9.7876,29.8718],[-9.7913,29.8751],[-9.7743,29.8982],[-9.7676,29.9051],[-9.7618,29.9154],[-9.7629,29.9213],[-9.7576,29.9346],[-9.7432,29.9535],[-9.7379,29.9668],[-9.7349,29.9699],[-9.7321,29.9807],[-9.7224,29.9932],[-9.7163,30.0079],[-9.7124,30.0121],[-9.7082,30.0238],[-9.7032,30.0304],[-9.6949,30.051],[-9.6699,30.0782],[-9.6679,30.0921],[-9.6637,30.1051],[-9.6543,30.1226],[-9.6535,30.141],[-9.6487,30.1488],[-9.6426,30.1685],[-9.6387,30.1868],[-9.6387,30.1982],[-9.6413,30.2085],[-9.6351,30.2213],[-9.629,30.2468],[-9.629,30.2579],[-9.6221,30.2857],[-9.6199,30.304],[-9.6146,30.3257],[-9.611,30.336],[-9.6076,30.3568],[-9.6043,30.3621],[-9.6051,30.3693],[-9.6026,30.3829],[-9.5993,30.386],[-9.5985,30.4001],[-9.601,30.4026],[-9.6051,30.4168],[-9.614,30.424],[-9.6187,30.4207],[-9.6337,30.4215],[-9.6482,30.4293],[-9.6465,30.4354],[-9.6501,30.4396],[-9.6601,30.4443],[-9.6685,30.464],[-9.6707,30.4762],[-9.6749,30.4813],[-9.6754,30.4904],[-9.6804,30.5032],[-9.6851,30.5035],[-9.6885,30.5154],[-9.6951,30.5304],[-9.7035,30.5424],[-9.7168,30.5465],[-9.7268,30.5454],[-9.7399,30.5504],[-9.7463,30.5732],[-9.7513,30.5746],[-9.7579,30.5826],[-9.7635,30.5929],[-9.7735,30.5957],[-9.7832,30.6093],[-9.8051,30.6154],[-9.8179,30.6243],[-9.8404,30.6282],[-9.8593,30.6235],[-9.8818,30.6246],[-9.8893,30.6299],[-9.8868,30.6599],[-9.8776,30.691],[-9.8729,30.701],[-9.8596,30.7093],[-9.8499,30.7212],[-9.8518,30.7332],[-9.8393,30.7474],[-9.8296,30.7649],[-9.8301,30.7751],[-9.8165,30.7882],[-9.8149,30.7987],[-9.8057,30.8146],[-9.8068,30.834],[-9.8104,30.839],[-9.8174,30.8407],[-9.8271,30.8471],[-9.8215,30.8565],[-9.8163,30.8715],[-9.8129,30.8743],[-9.8121,30.886],[-9.8079,30.8926],[-9.8204,30.9107],[-9.8174,30.9271],[-9.819,30.9307],[-9.8204,30.9508],[-9.8058,30.9402],[-9.7754,30.9152],[-9.7453,30.8853],[-9.7394,30.8725],[-9.7462,30.7768],[-9.7212,30.759],[-9.6748,30.759],[-9.6392,30.7733],[-9.6142,30.8089],[-9.6132,30.8203],[-9.5981,30.8152],[-9.5842,30.8177],[-9.5694,30.8265],[-9.5417,30.8635],[-9.5328,30.8718],[-9.5253,30.8719],[-9.5225,30.8655],[-9.5295,30.8421],[-9.5251,30.8362],[-9.5149,30.8317],[-9.4918,30.8297],[-9.4757,30.8239],[-9.4573,30.8135],[-9.4434,30.8141],[-9.4301,30.8169],[-9.4121,30.8277],[-9.3912,30.8269],[-9.3464,30.8338],[-9.3231,30.8157],[-9.3065,30.8117],[-9.2871,30.8092],[-9.2685,30.8107],[-9.2535,30.8164],[-9.2516,30.8191],[-9.2323,30.784],[-9.193,30.7697],[-9.168,30.8018],[-9.1701,30.837],[-9.1479,30.8455],[-9.1351,30.848],[-9.1099,30.8469],[-9.0836,30.8439],[-9.0445,30.8361],[-9.0395,30.8304],[-8.9789,30.7983],[-8.9706,30.8921],[-8.9529,30.9004],[-8.9213,30.9057],[-8.8866,30.9222],[-8.8583,30.939],[-8.836,30.959],[-8.819,30.9789],[-8.7981,30.9805],[-8.7808,30.977],[-8.7743,30.9692],[-8.7704,30.955],[-8.7655,30.9539],[-8.7576,30.9053],[-8.7683,30.8554],[-8.7576,30.8232],[-8.729,30.8339],[-8.7005,30.8625],[-8.6949,30.8692],[-8.6855,30.8481],[-8.6726,30.8469],[-8.6501,30.8517],[-8.6362,30.8661],[-8.6154,30.88],[-8.5859,30.8858],[-8.5505,30.8889],[-8.5161,30.8859],[-8.4854,30.8816],[-8.4478,30.8805],[-8.4359,30.8815],[-8.4328,30.8768],[-8.3757,30.8446],[-8.3328,30.8411],[-8.2864,30.8661],[-8.2079,30.9232],[-8.1819,30.9297],[-8.1567,30.94],[-8.1255,30.9503],[-8.0982,30.9639],[-8.0831,30.9529],[-8.0782,30.9465],[-8.0664,30.9411],[-8.0669,30.9328],[-8.0716,30.918],[-8.07,30.9089],[-8.0616,30.9053],[-8.0259,30.8732],[-7.983,30.8875],[-7.9581,30.9303],[-7.9515,30.9717],[-7.9364,30.9828],[-7.9052,31.0032],[-7.8993,31.0152],[-7.8978,31.0299],[-7.9069,31.0427],[-7.9026,31.0492],[-7.879,31.0585],[-7.8559,31.0687],[-7.8317,31.0822],[-7.8011,31.109],[-7.7769,31.1316],[-7.7495,31.1488],[-7.7301,31.159],[-7.7133,31.1651],[-7.7225,31.1302],[-7.7582,31.0945],[-7.7618,31.0374],[-7.6761,31.0445],[-7.7189,31.0017],[-7.7225,30.9696],[-7.7296,30.8554],[-7.6154,30.8482],[-7.6583,30.8161],[-7.7011,30.7768],[-7.7225,30.7304],[-7.5904,30.7233],[-7.594,30.6412],[-7.5548,30.6091],[-7.5298,30.5984],[-7.4798,30.527],[-7.5654,30.527],[-7.594,30.4734],[-7.6547,30.4627],[-7.7047,30.4627],[-7.6797,30.4163],[-7.6725,30.3664],[-7.644,30.3735],[-7.6226,30.3806],[-7.5976,30.3557],[-7.5762,30.3128],[-7.5668,30.269],[-7.5928,30.2544],[-7.6318,30.2248],[-7.6401,30.2118],[-7.4511,30.209],[-7.446,30.1998],[-7.446,30.1791],[-7.4413,30.1601],[-7.4179,30.1623],[-7.4031,30.1742],[-7.3822,30.1891],[-7.3525,30.1683],[-7.3481,30.1686],[-7.3151,30.137],[-7.2951,30.1113],[-7.2694,30.1042],[-7.2637,30.1299],[-7.3109,30.1872],[-7.3109,30.2397],[-7.2573,30.2754],[-7.2365,30.317],[-7.2187,30.3557],[-7.2038,30.3973],[-7.1681,30.4062],[-7.1324,30.3854],[-7.0967,30.3586],[-7.0551,30.3378],[-7.051,30.3315],[-7.0383,30.3306],[-7.0169,30.3265],[-6.9906,30.318],[-6.9867,30.3408],[-6.948,30.3527],[-6.8974,30.3616],[-6.8677,30.3378],[-6.8617,30.4657],[-6.8082,30.433],[-6.7814,30.433],[-6.7576,30.4449],[-6.7279,30.4746],[-6.6892,30.5014],[-6.6714,30.4984],[-6.6595,30.4836],[-6.6625,30.4389],[-6.6671,30.4124],[-6.6334,30.3967],[-6.5494,30.4151],[-6.5256,30.3884],[-6.4989,30.3527],[-6.4899,30.3319],[-6.5048,30.3051],[-6.5349,30.2969],[-6.5946,30.2436],[-6.5982,30.1936],[-6.5554,30.1722],[-6.509,30.1437],[-6.5233,30.1008],[-6.5554,30.0723],[-6.5554,30.0366],[-6.5233,30.0259],[-6.4769,30.0402],[-6.4483,30.058],[-6.4126,30.0473],[-6.3783,30.0473],[-6.3756,30.0304],[-6.3763,30.0089],[-6.3912,29.9973],[-6.4483,29.9581],[-6.4947,29.9188],[-6.4733,29.8688],[-6.4519,29.8367],[-6.4697,29.8082],[-6.5018,29.7653],[-6.5018,29.7368],[-6.4769,29.7368],[-6.4376,29.7153],[-6.4412,29.6261],[-6.459,29.5868],[-6.4568,29.5621]]]},properties:{name:"Souss-Massa",id:"MA-09",TYPE:"Region",CNTRY:"Morooco"},id:"MA-09"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-3.9981,32.6029],[-3.9861,32.5908],[-3.9783,32.5777],[-3.9455,32.5699],[-3.9098,32.5371],[-3.9247,32.4866],[-3.9399,32.489],[-3.9514,32.4806],[-3.9603,32.4658],[-3.9336,32.4479],[-3.8949,32.4366],[-3.8931,32.4331],[-3.8741,32.4331],[-3.8235,32.4182],[-3.7938,32.3765],[-3.7857,32.2949],[-3.7819,32.2338],[-3.764,32.1951],[-3.6956,32.1832],[-3.6848,32.1851],[-3.6685,32.1768],[-3.6481,32.1751],[-3.6599,32.1445],[-3.6748,32.1089],[-3.6302,32.1207],[-3.5826,32.1564],[-3.5545,32.1845],[-3.541,32.1837],[-3.4988,32.1785],[-3.4836,32.1778],[-3.4666,32.1505],[-3.425,32.1356],[-3.3595,32.1237],[-3.303,32.1326],[-3.2713,32.1489],[-3.2701,32.1486],[-3.1811,32.1951],[-3.2197,32.1326],[-3.2525,32.0494],[-3.2525,32.0166],[-3.2197,31.9215],[-3.1959,31.856],[-3.1156,31.8174],[-3.184,31.7787],[-3.2197,31.7638],[-3.2698,31.7388],[-3.2626,31.7097],[-3.2502,31.6956],[-3.1117,31.6971],[-3.1102,31.6343],[-3.3558,31.6357],[-3.3801,31.6257],[-3.4015,31.6085],[-3.42,31.5857],[-3.4372,31.56],[-3.4657,31.5415],[-3.4828,31.5286],[-3.5043,31.5143],[-3.5414,31.5072],[-3.5757,31.4886],[-3.6014,31.4758],[-3.6228,31.4744],[-3.6485,31.4815],[-3.6784,31.5131],[-3.7106,31.5039],[-3.722,31.4867],[-3.7277,31.4658],[-3.722,31.4487],[-3.7182,31.4296],[-3.7106,31.4068],[-3.7106,31.3916],[-3.7297,31.3763],[-3.7658,31.3744],[-3.7887,31.363],[-3.8039,31.3459],[-3.7982,31.3173],[-3.7906,31.2907],[-3.7906,31.245],[-3.8039,31.1955],[-3.8267,31.1803],[-3.8325,31.1536],[-3.8058,31.1384],[-3.7906,31.1384],[-3.7677,31.1498],[-3.7258,31.1384],[-3.7235,31.1115],[-3.7049,31.1022],[-3.6745,31.1232],[-3.669,31.1193],[-3.6752,31.1086],[-3.673,31.0968],[-3.6785,31.0861],[-3.6615,31.082],[-3.644,31.0815],[-3.6361,31.0553],[-3.6064,31.0316],[-3.5737,31.0197],[-3.5677,30.9869],[-3.5915,30.9602],[-3.6332,30.9066],[-3.6897,30.8709],[-3.7284,30.8293],[-3.764,30.7847],[-3.8354,30.7163],[-3.8592,30.6717],[-3.8643,30.6226],[-3.9062,30.6132],[-3.9683,30.598],[-3.9948,30.5924],[-4.0514,30.5894],[-4.1455,30.5848],[-4.1683,30.577],[-4.2565,30.549],[-4.278,30.5414],[-4.3202,30.5284],[-4.4567,30.4109],[-4.5344,30.4099],[-4.6474,30.3118],[-4.7604,30.2523],[-4.8943,30.1809],[-4.9214,30.146],[-4.9355,30.14],[-4.9716,30.1144],[-5.1176,30.0061],[-5.1229,30.0025],[-5.1366,30.0008],[-5.1762,30.0034],[-5.2047,29.9806],[-5.2218,29.9549],[-5.2228,29.9437],[-5.2397,29.9334],[-5.2517,29.9153],[-5.2736,29.9054],[-5.285,29.8971],[-5.302,29.8741],[-5.3218,29.8707],[-5.3389,29.8364],[-5.3489,29.805],[-5.3732,29.7864],[-5.4289,29.7479],[-5.496,29.6908],[-5.5388,29.6066],[-5.5616,29.5594],[-5.5788,29.518],[-5.5775,29.4891],[-5.5816,29.4709],[-5.5902,29.4409],[-5.6159,29.4252],[-5.6559,29.4267],[-5.6744,29.4467],[-5.6787,29.4866],[-5.7101,29.4966],[-5.7372,29.4923],[-5.7644,29.4938],[-5.7901,29.5594],[-5.8129,29.5609],[-5.8372,29.548],[-5.8586,29.5209],[-5.8843,29.5052],[-5.9371,29.5038],[-6.0228,29.4823],[-6.087,29.4709],[-6.1641,29.4695],[-6.2212,29.4695],[-6.2584,29.4895],[-6.2912,29.5137],[-6.3426,29.5209],[-6.3854,29.5337],[-6.4183,29.5252],[-6.4554,29.5437],[-6.4568,29.5621],[-6.459,29.5868],[-6.4412,29.6261],[-6.4376,29.7153],[-6.4769,29.7368],[-6.5018,29.7368],[-6.5018,29.7653],[-6.4697,29.8082],[-6.4519,29.8367],[-6.4733,29.8688],[-6.4947,29.9188],[-6.4483,29.9581],[-6.3912,29.9973],[-6.3763,30.0089],[-6.3756,30.0304],[-6.3783,30.0473],[-6.4126,30.0473],[-6.4483,30.058],[-6.4769,30.0402],[-6.5233,30.0259],[-6.5554,30.0366],[-6.5554,30.0723],[-6.5233,30.1008],[-6.509,30.1437],[-6.5554,30.1722],[-6.5982,30.1936],[-6.5946,30.2436],[-6.5349,30.2969],[-6.5048,30.3051],[-6.4899,30.3319],[-6.4989,30.3527],[-6.5256,30.3884],[-6.5494,30.4151],[-6.6334,30.3967],[-6.6671,30.4124],[-6.6625,30.4389],[-6.6595,30.4836],[-6.6714,30.4984],[-6.6892,30.5014],[-6.7279,30.4746],[-6.7576,30.4449],[-6.7814,30.433],[-6.8082,30.433],[-6.8617,30.4657],[-6.8677,30.3378],[-6.8974,30.3616],[-6.948,30.3527],[-6.9867,30.3408],[-6.9906,30.318],[-7.0169,30.3265],[-7.0383,30.3306],[-7.051,30.3315],[-7.0551,30.3378],[-7.0967,30.3586],[-7.1324,30.3854],[-7.1681,30.4062],[-7.2038,30.3973],[-7.2187,30.3557],[-7.2365,30.317],[-7.2573,30.2754],[-7.3109,30.2397],[-7.3109,30.1872],[-7.2637,30.1299],[-7.2694,30.1042],[-7.2951,30.1113],[-7.3151,30.137],[-7.3481,30.1686],[-7.3525,30.1683],[-7.3822,30.1891],[-7.4031,30.1742],[-7.4179,30.1623],[-7.4413,30.1601],[-7.446,30.1791],[-7.446,30.1998],[-7.4511,30.209],[-7.6401,30.2118],[-7.6318,30.2248],[-7.5928,30.2544],[-7.5668,30.269],[-7.5762,30.3128],[-7.5976,30.3557],[-7.6226,30.3806],[-7.644,30.3735],[-7.6725,30.3664],[-7.6797,30.4163],[-7.7047,30.4627],[-7.6547,30.4627],[-7.594,30.4734],[-7.5654,30.527],[-7.4798,30.527],[-7.5298,30.5984],[-7.5548,30.6091],[-7.594,30.6412],[-7.5904,30.7233],[-7.7225,30.7304],[-7.7011,30.7768],[-7.6583,30.8161],[-7.6154,30.8482],[-7.7296,30.8554],[-7.7225,30.9696],[-7.7189,31.0017],[-7.6761,31.0445],[-7.7618,31.0374],[-7.7582,31.0945],[-7.7225,31.1302],[-7.7133,31.1651],[-7.6929,31.1725],[-7.6599,31.1738],[-7.6245,31.1915],[-7.5731,31.2315],[-7.5219,31.2376],[-7.4877,31.2697],[-7.4597,31.2809],[-7.4387,31.2901],[-7.3466,31.2945],[-7.3105,31.3001],[-7.2803,31.3071],[-7.2679,31.3172],[-7.2279,31.3691],[-7.2021,31.3839],[-7.1962,31.3858],[-7.1962,31.4066],[-7.1828,31.4199],[-7.1542,31.4302],[-7.1531,31.4249],[-7.1428,31.3991],[-7.1383,31.3994],[-7.12,31.3628],[-7.0781,31.3609],[-7.0496,31.3723],[-7.0353,31.3886],[-7.0029,31.3822],[-7.0001,31.3609],[-6.9696,31.3305],[-6.9106,31.3305],[-6.8592,31.3381],[-6.7526,31.3457],[-6.7241,31.3723],[-6.7227,31.5111],[-6.7028,31.5119],[-6.6769,31.5169],[-6.6713,31.5191],[-6.6457,31.5035],[-6.5962,31.494],[-6.5486,31.5035],[-6.5219,31.5244],[-6.4838,31.5397],[-6.4153,31.5435],[-6.3792,31.5701],[-6.3411,31.6101],[-6.292,31.6482],[-6.2634,31.6581],[-6.2381,31.6661],[-6.2002,31.6577],[-6.1659,31.6729],[-6.1165,31.671],[-6.0708,31.6958],[-6.0099,31.7281],[-5.9832,31.7795],[-5.9489,31.8233],[-5.9204,31.829],[-5.8614,31.8252],[-5.8276,31.8448],[-5.8166,31.8621],[-5.8009,31.9021],[-5.7994,31.9392],[-5.8194,31.9649],[-5.8466,31.9806],[-5.8737,31.9977],[-5.8708,32.0348],[-5.8537,32.0748],[-5.8409,32.0977],[-5.8187,32.1112],[-5.8173,32.1069],[-5.7659,32.1084],[-5.6945,32.1098],[-5.6731,32.1369],[-5.656,32.2154],[-5.616,32.2326],[-5.5532,32.2297],[-5.5203,32.2269],[-5.5018,32.2226],[-5.4604,32.2054],[-5.4361,32.2026],[-5.4447,32.2183],[-5.4718,32.2411],[-5.4804,32.2711],[-5.4704,32.2925],[-5.4661,32.3225],[-5.4789,32.3368],[-5.4875,32.3496],[-5.5318,32.3568],[-5.542,32.367],[-5.544,32.3767],[-5.5262,32.3993],[-5.5232,32.4125],[-5.523,32.423],[-5.5063,32.442],[-5.5007,32.4506],[-5.4299,32.4452],[-5.3971,32.4424],[-5.3971,32.5223],[-5.3243,32.5223],[-5.31,32.5594],[-5.2886,32.6265],[-5.2929,32.8293],[-5.2543,32.8635],[-5.2347,32.8819],[-5.2326,32.8818],[-5.1869,32.9347],[-5.1683,32.9447],[-5.1384,32.9432],[-5.1127,32.9347],[-5.0813,32.9332],[-5.0627,32.9461],[-5.0513,32.9675],[-5.0413,33.006],[-5.0242,33.0546],[-5.0027,33.076],[-4.9456,33.0646],[-4.9199,33.0689],[-4.9014,33.086],[-4.8814,33.0974],[-4.8528,33.0931],[-4.8388,33.0889],[-4.8247,33.068],[-4.8001,33.0543],[-4.7505,33.0073],[-4.7439,32.9957],[-4.7472,32.9776],[-4.7598,32.961],[-4.7628,32.9374],[-4.7532,32.9176],[-4.7139,32.8917],[-4.6687,32.8761],[-4.6462,32.8824],[-4.612,32.8799],[-4.579,32.89],[-4.548,32.8916],[-4.5148,32.8917],[-4.4812,32.8868],[-4.4663,32.8787],[-4.4501,32.8633],[-4.435,32.8338],[-4.4253,32.8181],[-4.3849,32.7961],[-4.3555,32.7713],[-4.3208,32.7444],[-4.2932,32.7182],[-4.2883,32.6799],[-4.2905,32.6413],[-4.2399,32.5818],[-4.1983,32.5699],[-4.1269,32.5818],[-4.1031,32.6026],[-4.0905,32.6252],[-4.0541,32.6376],[-4.0194,32.6246],[-3.9981,32.6029]]]},properties:{name:"Drâa-Tafilalet",id:"MA-08",TYPE:"Region",CNTRY:"Morooco"},id:"MA-08"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-7.0942,32.3046],[-7.0948,32.2936],[-7.1047,32.262],[-7.1026,32.2487],[-7.094,32.2267],[-7.0876,32.2047],[-7.0845,32.1832],[-7.0949,32.1474],[-7.1004,32.0736],[-7.0897,32.0201],[-7.0612,31.9963],[-7.0303,31.982],[-7.0241,31.9556],[-7.0314,31.9472],[-7.0342,31.9321],[-7.0224,31.9201],[-7.0262,31.9027],[-7.0198,31.8903],[-7.0069,31.8853],[-6.9757,31.85],[-6.9772,31.8481],[-6.9616,31.829],[-6.9712,31.81],[-6.9807,31.7776],[-7.0035,31.7453],[-7.1044,31.7395],[-7.1482,31.73],[-7.1748,31.73],[-7.192,31.751],[-7.2129,31.7643],[-7.251,31.7567],[-7.27,31.7395],[-7.2967,31.7129],[-7.3127,31.711],[-7.3199,31.6922],[-7.3089,31.664],[-7.3005,31.6634],[-7.2529,31.6634],[-7.23,31.6444],[-7.2224,31.6253],[-7.2074,31.5798],[-7.1543,31.5703],[-7.1438,31.5675],[-7.1082,31.5682],[-7.0987,31.5587],[-7.0949,31.5378],[-7.1101,31.4978],[-7.1531,31.4249],[-7.1542,31.4302],[-7.1828,31.4199],[-7.1962,31.4066],[-7.1962,31.3858],[-7.2021,31.3839],[-7.2279,31.3691],[-7.2679,31.3172],[-7.2803,31.3071],[-7.3105,31.3001],[-7.3466,31.2945],[-7.4387,31.2901],[-7.4597,31.2809],[-7.4877,31.2697],[-7.5219,31.2376],[-7.5731,31.2315],[-7.6245,31.1915],[-7.6599,31.1738],[-7.6929,31.1725],[-7.7301,31.159],[-7.7495,31.1488],[-7.7769,31.1316],[-7.8011,31.109],[-7.8317,31.0822],[-7.8559,31.0687],[-7.879,31.0585],[-7.9026,31.0492],[-7.9069,31.0427],[-7.8978,31.0299],[-7.8993,31.0152],[-7.9052,31.0032],[-7.9364,30.9828],[-7.9515,30.9717],[-7.9581,30.9303],[-7.983,30.8875],[-8.0259,30.8732],[-8.0616,30.9053],[-8.07,30.9089],[-8.0716,30.918],[-8.0669,30.9328],[-8.0664,30.9411],[-8.0782,30.9465],[-8.0831,30.9529],[-8.0982,30.9639],[-8.1255,30.9503],[-8.1567,30.94],[-8.1819,30.9297],[-8.2079,30.9232],[-8.2864,30.8661],[-8.3328,30.8411],[-8.3757,30.8446],[-8.4328,30.8768],[-8.4359,30.8815],[-8.4478,30.8805],[-8.4854,30.8816],[-8.5161,30.8859],[-8.5505,30.8889],[-8.5859,30.8858],[-8.6154,30.88],[-8.6362,30.8661],[-8.6501,30.8517],[-8.6726,30.8469],[-8.6855,30.8481],[-8.6949,30.8692],[-8.7005,30.8625],[-8.729,30.8339],[-8.7576,30.8232],[-8.7683,30.8554],[-8.7576,30.9053],[-8.7655,30.9539],[-8.7704,30.955],[-8.7743,30.9692],[-8.7808,30.977],[-8.7981,30.9805],[-8.819,30.9789],[-8.836,30.959],[-8.8583,30.939],[-8.8866,30.9222],[-8.9213,30.9057],[-8.9529,30.9004],[-8.9706,30.8921],[-8.9789,30.7983],[-9.0395,30.8304],[-9.0445,30.8361],[-9.0836,30.8439],[-9.1099,30.8469],[-9.1351,30.848],[-9.1479,30.8455],[-9.1701,30.837],[-9.168,30.8018],[-9.193,30.7697],[-9.2323,30.784],[-9.2516,30.8191],[-9.2535,30.8164],[-9.2685,30.8107],[-9.2871,30.8092],[-9.3065,30.8117],[-9.3231,30.8157],[-9.3464,30.8338],[-9.3912,30.8269],[-9.4121,30.8277],[-9.4301,30.8169],[-9.4434,30.8141],[-9.4573,30.8135],[-9.4757,30.8239],[-9.4918,30.8297],[-9.5149,30.8317],[-9.5251,30.8362],[-9.5295,30.8421],[-9.5225,30.8655],[-9.5253,30.8719],[-9.5328,30.8718],[-9.5417,30.8635],[-9.5694,30.8265],[-9.5842,30.8177],[-9.5981,30.8152],[-9.6132,30.8203],[-9.6142,30.8089],[-9.6392,30.7733],[-9.6748,30.759],[-9.7212,30.759],[-9.7462,30.7768],[-9.7394,30.8725],[-9.7453,30.8853],[-9.7754,30.9152],[-9.8058,30.9402],[-9.8204,30.9508],[-9.8257,30.964],[-9.8243,30.9771],[-9.8213,30.984],[-9.8135,30.9918],[-9.8101,30.9996],[-9.8093,31.0115],[-9.8176,31.0257],[-9.8163,31.0354],[-9.8185,31.054],[-9.8246,31.0574],[-9.8168,31.0751],[-9.8168,31.0918],[-9.8201,31.0952],[-9.8335,31.1004],[-9.8401,31.0999],[-9.8424,31.1049],[-9.8404,31.1165],[-9.834,31.1227],[-9.8393,31.1376],[-9.8371,31.1493],[-9.8315,31.1568],[-9.8318,31.1671],[-9.8249,31.1699],[-9.8199,31.1782],[-9.8151,31.1918],[-9.816,31.1974],[-9.8226,31.1993],[-9.8229,31.2099],[-9.8193,31.216],[-9.8179,31.2287],[-9.8204,31.2329],[-9.8182,31.2443],[-9.8137,31.2488],[-9.7999,31.2746],[-9.796,31.2879],[-9.7999,31.2932],[-9.794,31.3146],[-9.794,31.3274],[-9.7982,31.331],[-9.7965,31.339],[-9.7974,31.3535],[-9.8013,31.3554],[-9.804,31.3685],[-9.8113,31.3801],[-9.8168,31.3846],[-9.8343,31.3854],[-9.8413,31.3879],[-9.8337,31.4138],[-9.8218,31.4221],[-9.8096,31.4329],[-9.7899,31.4562],[-9.786,31.4649],[-9.7774,31.4763],[-9.774,31.4871],[-9.7632,31.499],[-9.7651,31.5068],[-9.7807,31.5087],[-9.7721,31.5171],[-9.766,31.5171],[-9.7574,31.5268],[-9.7387,31.5387],[-9.7185,31.5615],[-9.7057,31.5793],[-9.6874,31.6018],[-9.6851,31.6143],[-9.6815,31.6162],[-9.6746,31.6362],[-9.6776,31.6471],[-9.6776,31.6637],[-9.6751,31.6896],[-9.6788,31.6999],[-9.6599,31.7112],[-9.6496,31.719],[-9.6249,31.7429],[-9.6176,31.7543],[-9.6074,31.7626],[-9.6057,31.7707],[-9.5962,31.7782],[-9.5865,31.791],[-9.5865,31.794],[-9.5726,31.806],[-9.569,31.8112],[-9.5582,31.8154],[-9.5468,31.8304],[-9.5304,31.8443],[-9.5254,31.8507],[-9.5257,31.8563],[-9.5151,31.8657],[-9.5035,31.8737],[-9.4932,31.8865],[-9.4715,31.9074],[-9.4715,31.9118],[-9.4604,31.9232],[-9.4535,31.9276],[-9.4418,31.939],[-9.4274,31.9507],[-9.4251,31.9563],[-9.399,31.9801],[-9.3943,31.9871],[-9.3568,32.0224],[-9.3457,32.0304],[-9.3401,32.0473],[-9.3399,32.0557],[-9.3299,32.0657],[-9.3301,32.0849],[-9.3243,32.0924],[-9.3246,32.0982],[-9.3199,32.1046],[-9.3229,32.1126],[-9.294,32.1421],[-9.2782,32.1574],[-9.2696,32.1693],[-9.2621,32.1751],[-9.2626,32.1826],[-9.2537,32.201],[-9.2546,32.2074],[-9.2513,32.2176],[-9.2546,32.231],[-9.2585,32.2337],[-9.261,32.2424],[-9.266,32.2451],[-9.2665,32.2521],[-9.2607,32.2582],[-9.256,32.2699],[-9.2529,32.2721],[-9.2449,32.2962],[-9.2465,32.3065],[-9.2513,32.3187],[-9.2615,32.3204],[-9.2815,32.3293],[-9.2821,32.3471],[-9.291,32.3593],[-9.2901,32.3693],[-9.2863,32.3771],[-9.2779,32.386],[-9.2615,32.3987],[-9.2501,32.4199],[-9.2468,32.4296],[-9.239,32.4429],[-9.2346,32.4549],[-9.2318,32.476],[-9.2513,32.4974],[-9.2596,32.5004],[-9.2651,32.5118],[-9.2718,32.5157],[-9.2718,32.5262],[-9.281,32.5351],[-9.2863,32.5429],[-9.2607,32.5604],[-9.2524,32.564],[-9.2335,32.5771],[-9.2199,32.5901],[-9.2001,32.6018],[-9.189,32.6113],[-9.1793,32.6165],[-9.1635,32.6304],[-9.146,32.6426],[-9.1351,32.6532],[-9.1204,32.6626],[-9.1115,32.6726],[-9.101,32.6804],[-9.0815,32.6996],[-9.0746,32.7051],[-9.0579,32.7243],[-9.0276,32.7178],[-8.9895,32.7236],[-8.961,32.7064],[-8.9476,32.676],[-8.9476,32.6531],[-8.9591,32.6322],[-8.9838,32.6169],[-8.9876,32.5922],[-8.9838,32.5675],[-8.9667,32.5541],[-8.9229,32.5256],[-8.8848,32.4913],[-8.8429,32.4875],[-8.803,32.5027],[-8.763,32.5085],[-8.7249,32.5161],[-8.6716,32.5199],[-8.6183,32.5161],[-8.584,32.4913],[-8.565,32.438],[-8.5764,32.4133],[-8.5726,32.3733],[-8.5365,32.3409],[-8.5212,32.3029],[-8.4965,32.3029],[-8.4737,32.3105],[-8.4422,32.3105],[-8.4228,32.3139],[-8.3764,32.3264],[-8.3461,32.3478],[-8.3373,32.4042],[-8.3095,32.4144],[-8.2736,32.4142],[-8.2658,32.4085],[-8.2265,32.4245],[-8.1926,32.4495],[-8.1894,32.4672],[-8.1821,32.4687],[-8.1685,32.4825],[-8.1522,32.49],[-8.1386,32.4942],[-8.1239,32.5126],[-8.0983,32.5283],[-8.0804,32.5563],[-8.063,32.5711],[-8.0515,32.5666],[-8.0455,32.5712],[-8.0386,32.5996],[-8.0442,32.6244],[-8.0612,32.6445],[-8.0723,32.6609],[-8.0658,32.6775],[-8.0724,32.688],[-8.0675,32.6921],[-8.0359,32.712],[-8.0337,32.7211],[-8.036,32.728],[-8.0273,32.7372],[-8.0295,32.7445],[-8.0394,32.7615],[-8.0329,32.7775],[-8.0335,32.7867],[-8.0095,32.8097],[-7.9865,32.8157],[-7.9673,32.8144],[-7.9602,32.803],[-7.9579,32.7915],[-7.9513,32.776],[-7.9392,32.7595],[-7.9227,32.7463],[-7.9078,32.7234],[-7.9017,32.707],[-7.9028,32.6983],[-7.8839,32.6637],[-7.8678,32.6512],[-7.7822,32.6512],[-7.7495,32.6502],[-7.7342,32.6415],[-7.72,32.6269],[-7.709,32.599],[-7.6992,32.5853],[-7.6937,32.5693],[-7.6833,32.5551],[-7.6555,32.546],[-7.6418,32.5273],[-7.6309,32.5099],[-7.6151,32.4701],[-7.5981,32.4454],[-7.5867,32.4303],[-7.5769,32.4304],[-7.5687,32.4409],[-7.5616,32.4409],[-7.5475,32.4286],[-7.5142,32.431],[-7.4585,32.4365],[-7.4109,32.4603],[-7.3586,32.4555],[-7.3277,32.4389],[-7.3146,32.3972],[-7.2789,32.3711],[-7.2254,32.3532],[-7.1849,32.3449],[-7.1456,32.3282],[-7.1087,32.3247],[-7.0942,32.3046]]]},properties:{name:"Marrakech-Safi",id:"MA-07",TYPE:"Region",CNTRY:"Morooco"},id:"MA-07"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-7.1268,33.8296],[-7.1234,33.8196],[-7.1134,33.8094],[-7.1018,33.8081],[-7.0817,33.8083],[-7.0689,33.8066],[-7.0612,33.7884],[-7.0459,33.7736],[-7.0372,33.7471],[-7.0362,33.7289],[-7.0336,33.7102],[-7.0365,33.7034],[-7.0255,33.6921],[-7.0229,33.6839],[-7.0125,33.6739],[-7.0055,33.6593],[-7.0155,33.6411],[-7.0145,33.6347],[-7,33.6341],[-6.999,33.6429],[-6.9818,33.6422],[-6.9882,33.5614],[-6.9273,33.5633],[-6.912,33.5823],[-6.9028,33.5884],[-6.8974,33.5805],[-6.888,33.5791],[-6.8726,33.5823],[-6.8621,33.5838],[-6.8568,33.5557],[-6.8454,33.5386],[-6.8112,33.5366],[-6.8019,33.5419],[-6.7179,33.5366],[-6.7655,33.4891],[-6.7959,33.4662],[-6.7959,33.4453],[-6.7616,33.4186],[-6.7521,33.3958],[-6.775,33.3672],[-6.7845,33.3292],[-6.7959,33.293],[-6.7997,33.2321],[-6.8224,33.2215],[-6.8267,33.223],[-6.8414,33.2163],[-6.861,33.2092],[-6.8842,33.1896],[-6.8913,33.1182],[-6.8985,33.0522],[-6.911,33.0093],[-6.9181,32.9879],[-6.9538,32.9736],[-6.9788,32.9594],[-6.9859,32.9076],[-7.0091,32.8362],[-7.0163,32.7952],[-7.0216,32.7595],[-7.0359,32.7381],[-7.0413,32.7059],[-7.0341,32.6827],[-7.0198,32.6542],[-7.0002,32.6256],[-6.9753,32.6228],[-6.9866,32.5963],[-6.9852,32.5684],[-6.9891,32.5537],[-6.9903,32.5391],[-6.9898,32.5221],[-6.9932,32.5061],[-7.0064,32.48],[-7.0251,32.4383],[-7.0323,32.4109],[-7.04,32.3985],[-7.0482,32.3884],[-7.0705,32.3706],[-7.0798,32.366],[-7.0963,32.3493],[-7.0935,32.3403],[-7.0936,32.3147],[-7.0942,32.3046],[-7.1087,32.3247],[-7.1456,32.3282],[-7.1849,32.3449],[-7.2254,32.3532],[-7.2789,32.3711],[-7.3146,32.3972],[-7.3277,32.4389],[-7.3586,32.4555],[-7.4109,32.4603],[-7.4585,32.4365],[-7.5142,32.431],[-7.5475,32.4286],[-7.5616,32.4409],[-7.5687,32.4409],[-7.5769,32.4304],[-7.5867,32.4303],[-7.5981,32.4454],[-7.6151,32.4701],[-7.6309,32.5099],[-7.6418,32.5273],[-7.6555,32.546],[-7.6833,32.5551],[-7.6937,32.5693],[-7.6992,32.5853],[-7.709,32.599],[-7.72,32.6269],[-7.7342,32.6415],[-7.7495,32.6502],[-7.7822,32.6512],[-7.8678,32.6512],[-7.8839,32.6637],[-7.9028,32.6983],[-7.9017,32.707],[-7.9078,32.7234],[-7.9227,32.7463],[-7.9392,32.7595],[-7.9513,32.776],[-7.9579,32.7915],[-7.9602,32.803],[-7.9673,32.8144],[-7.9865,32.8157],[-8.0095,32.8097],[-8.0335,32.7867],[-8.0329,32.7775],[-8.0394,32.7615],[-8.0295,32.7445],[-8.0273,32.7372],[-8.036,32.728],[-8.0337,32.7211],[-8.0359,32.712],[-8.0675,32.6921],[-8.0724,32.688],[-8.0658,32.6775],[-8.0723,32.6609],[-8.0612,32.6445],[-8.0442,32.6244],[-8.0386,32.5996],[-8.0455,32.5712],[-8.0515,32.5666],[-8.063,32.5711],[-8.0804,32.5563],[-8.0983,32.5283],[-8.1239,32.5126],[-8.1386,32.4942],[-8.1522,32.49],[-8.1685,32.4825],[-8.1821,32.4687],[-8.1894,32.4672],[-8.1926,32.4495],[-8.2265,32.4245],[-8.2658,32.4085],[-8.2736,32.4142],[-8.3095,32.4144],[-8.3373,32.4042],[-8.3461,32.3478],[-8.3764,32.3264],[-8.4228,32.3139],[-8.4422,32.3105],[-8.4737,32.3105],[-8.4965,32.3029],[-8.5212,32.3029],[-8.5365,32.3409],[-8.5726,32.3733],[-8.5764,32.4133],[-8.565,32.438],[-8.584,32.4913],[-8.6183,32.5161],[-8.6716,32.5199],[-8.7249,32.5161],[-8.763,32.5085],[-8.803,32.5027],[-8.8429,32.4875],[-8.8848,32.4913],[-8.9229,32.5256],[-8.9667,32.5541],[-8.9838,32.5675],[-8.9876,32.5922],[-8.9838,32.6169],[-8.9591,32.6322],[-8.9476,32.6531],[-8.9476,32.676],[-8.961,32.7064],[-8.9895,32.7236],[-9.0276,32.7178],[-9.0579,32.7243],[-9.0524,32.7315],[-9.0438,32.7374],[-9.039,32.734],[-9.0315,32.7396],[-9.0399,32.7424],[-9.0171,32.7601],[-8.9749,32.7885],[-8.9501,32.8082],[-8.9332,32.8196],[-8.926,32.8212],[-8.8993,32.8424],[-8.8979,32.8474],[-8.8671,32.8749],[-8.8521,32.8899],[-8.8229,32.9138],[-8.8087,32.9262],[-8.7987,32.9368],[-8.7857,32.9479],[-8.7807,32.9593],[-8.7752,32.9604],[-8.7612,32.9743],[-8.7485,32.9746],[-8.7463,32.9804],[-8.754,32.9815],[-8.7471,32.9901],[-8.744,32.999],[-8.729,33.0054],[-8.709,33.026],[-8.7049,33.0396],[-8.6901,33.0479],[-8.689,33.0562],[-8.6729,33.0707],[-8.666,33.0787],[-8.6543,33.0874],[-8.6499,33.0965],[-8.6329,33.1112],[-8.6263,33.1249],[-8.6265,33.1312],[-8.6132,33.1401],[-8.614,33.1437],[-8.6296,33.1604],[-8.6212,33.1751],[-8.6112,33.1829],[-8.591,33.2012],[-8.579,33.2146],[-8.5718,33.2182],[-8.5615,33.2185],[-8.554,33.2268],[-8.5574,33.2349],[-8.5504,33.2365],[-8.5479,33.2449],[-8.5401,33.2468],[-8.5326,33.2543],[-8.5182,33.2607],[-8.5107,33.2674],[-8.5002,33.2635],[-8.4973,33.2557],[-8.5007,33.2521],[-8.4893,33.2443],[-8.4607,33.2457],[-8.426,33.2601],[-8.3963,33.276],[-8.381,33.2868],[-8.3743,33.294],[-8.3601,33.3035],[-8.3524,33.311],[-8.3421,33.3171],[-8.336,33.3171],[-8.3318,33.3282],[-8.3226,33.339],[-8.3113,33.3571],[-8.2971,33.3671],[-8.2757,33.3679],[-8.2657,33.3737],[-8.2524,33.3749],[-8.2421,33.3796],[-8.2254,33.3804],[-8.2063,33.3865],[-8.1893,33.3954],[-8.1818,33.4029],[-8.169,33.4026],[-8.1646,33.4063],[-8.1521,33.4065],[-8.1493,33.4087],[-8.1254,33.4135],[-8.1104,33.4218],[-8.0996,33.4243],[-8.0926,33.4293],[-8.0668,33.4374],[-8.0615,33.4412],[-8.0268,33.4521],[-8.0185,33.4532],[-7.9846,33.4699],[-7.9579,33.4799],[-7.9402,33.4799],[-7.9326,33.4818],[-7.9107,33.4924],[-7.8976,33.4943],[-7.8882,33.5032],[-7.8774,33.506],[-7.869,33.5146],[-7.8543,33.516],[-7.8485,33.5229],[-7.8315,33.529],[-7.8315,33.5329],[-7.8196,33.5357],[-7.8174,33.5279],[-7.8012,33.5282],[-7.7937,33.5349],[-7.7799,33.539],[-7.7551,33.549],[-7.7349,33.5626],[-7.7276,33.5638],[-7.7104,33.5718],[-7.7076,33.581],[-7.7038,33.584],[-7.6946,33.5832],[-7.6807,33.5915],[-7.6804,33.5965],[-7.6685,33.5979],[-7.6612,33.6021],[-7.6554,33.611],[-7.6482,33.6057],[-7.636,33.6046],[-7.6349,33.6087],[-7.6199,33.6062],[-7.6079,33.6074],[-7.5988,33.6021],[-7.571,33.609],[-7.561,33.6132],[-7.5538,33.6196],[-7.5451,33.6215],[-7.5362,33.6201],[-7.5299,33.624],[-7.5218,33.6249],[-7.5051,33.6387],[-7.4865,33.6474],[-7.481,33.6538],[-7.4668,33.6624],[-7.4429,33.679],[-7.4321,33.6907],[-7.416,33.6979],[-7.4132,33.704],[-7.4024,33.7137],[-7.3996,33.7218],[-7.3932,33.7287],[-7.3957,33.7093],[-7.3871,33.7063],[-7.3613,33.7101],[-7.3485,33.7179],[-7.3413,33.719],[-7.346,33.726],[-7.3426,33.7307],[-7.3321,33.7324],[-7.3304,33.7368],[-7.3146,33.7476],[-7.3004,33.7549],[-7.2943,33.7626],[-7.274,33.7743],[-7.2663,33.7821],[-7.2476,33.7874],[-7.2388,33.7968],[-7.2326,33.7957],[-7.2288,33.804],[-7.2174,33.8021],[-7.1935,33.8054],[-7.1785,33.8107],[-7.1751,33.8168],[-7.1632,33.816],[-7.1529,33.819],[-7.1485,33.8235],[-7.1385,33.8246],[-7.1268,33.8296]]]},properties:{name:"Casablanca-Settat",id:"MA-06",TYPE:"Region",CNTRY:"Morooco"},id:"MA-06"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-5.2315,32.885],[-5.2543,32.8635],[-5.2929,32.8293],[-5.2886,32.6265],[-5.31,32.5594],[-5.3243,32.5223],[-5.3971,32.5223],[-5.3971,32.4424],[-5.4299,32.4452],[-5.5007,32.4506],[-5.5063,32.442],[-5.523,32.423],[-5.5232,32.4125],[-5.5262,32.3993],[-5.544,32.3767],[-5.542,32.367],[-5.5318,32.3568],[-5.4875,32.3496],[-5.4789,32.3368],[-5.4661,32.3225],[-5.4704,32.2925],[-5.4804,32.2711],[-5.4718,32.2411],[-5.4447,32.2183],[-5.4361,32.2026],[-5.4604,32.2054],[-5.5018,32.2226],[-5.5203,32.2269],[-5.5532,32.2297],[-5.616,32.2326],[-5.656,32.2154],[-5.6731,32.1369],[-5.6945,32.1098],[-5.7659,32.1084],[-5.8173,32.1069],[-5.8187,32.1112],[-5.8409,32.0977],[-5.8537,32.0748],[-5.8708,32.0348],[-5.8737,31.9977],[-5.8466,31.9806],[-5.8194,31.9649],[-5.7994,31.9392],[-5.8009,31.9021],[-5.8166,31.8621],[-5.8276,31.8448],[-5.8614,31.8252],[-5.9204,31.829],[-5.9489,31.8233],[-5.9832,31.7795],[-6.0099,31.7281],[-6.0708,31.6958],[-6.1165,31.671],[-6.1659,31.6729],[-6.2002,31.6577],[-6.2381,31.6661],[-6.2634,31.6581],[-6.292,31.6482],[-6.3411,31.6101],[-6.3792,31.5701],[-6.4153,31.5435],[-6.4838,31.5397],[-6.5219,31.5244],[-6.5486,31.5035],[-6.5962,31.494],[-6.6457,31.5035],[-6.6713,31.5191],[-6.6769,31.5169],[-6.7028,31.5119],[-6.7227,31.5111],[-6.7241,31.3723],[-6.7526,31.3457],[-6.8592,31.3381],[-6.9106,31.3305],[-6.9696,31.3305],[-7.0001,31.3609],[-7.0029,31.3822],[-7.0353,31.3886],[-7.0496,31.3723],[-7.0781,31.3609],[-7.12,31.3628],[-7.1383,31.3994],[-7.1428,31.3991],[-7.1531,31.4249],[-7.1101,31.4978],[-7.0949,31.5378],[-7.0987,31.5587],[-7.1082,31.5682],[-7.1438,31.5675],[-7.1543,31.5703],[-7.2074,31.5798],[-7.2224,31.6253],[-7.23,31.6444],[-7.2529,31.6634],[-7.3005,31.6634],[-7.3089,31.664],[-7.3199,31.6922],[-7.3127,31.711],[-7.2967,31.7129],[-7.27,31.7395],[-7.251,31.7567],[-7.2129,31.7643],[-7.192,31.751],[-7.1748,31.73],[-7.1482,31.73],[-7.1044,31.7395],[-7.0035,31.7453],[-6.9807,31.7776],[-6.9712,31.81],[-6.9616,31.829],[-6.9772,31.8481],[-6.9757,31.85],[-7.0069,31.8853],[-7.0198,31.8903],[-7.0262,31.9027],[-7.0224,31.9201],[-7.0342,31.9321],[-7.0314,31.9472],[-7.0241,31.9556],[-7.0303,31.982],[-7.0612,31.9963],[-7.0897,32.0201],[-7.1004,32.0736],[-7.0949,32.1474],[-7.0845,32.1832],[-7.0876,32.2047],[-7.094,32.2267],[-7.1026,32.2487],[-7.1047,32.262],[-7.0948,32.2936],[-7.0936,32.3147],[-7.0935,32.3403],[-7.0963,32.3493],[-7.0798,32.366],[-7.0705,32.3706],[-7.0482,32.3884],[-7.04,32.3985],[-7.0323,32.4109],[-7.0251,32.4383],[-7.0064,32.48],[-6.9932,32.5061],[-6.9898,32.5221],[-6.9903,32.5391],[-6.9891,32.5537],[-6.9852,32.5684],[-6.9866,32.5963],[-6.9753,32.6228],[-7.0002,32.6256],[-7.0198,32.6542],[-7.0341,32.6827],[-7.0413,32.7059],[-7.0359,32.7381],[-7.0216,32.7595],[-7.0163,32.7952],[-7.0091,32.8362],[-6.9859,32.9076],[-6.9788,32.9594],[-6.9538,32.9736],[-6.9181,32.9879],[-6.911,33.0093],[-6.8985,33.0522],[-6.8913,33.1182],[-6.8842,33.1896],[-6.861,33.2092],[-6.8414,33.2163],[-6.8267,33.223],[-6.8224,33.2215],[-6.8002,33.2319],[-6.7978,33.2302],[-6.7653,33.2188],[-6.7531,33.2221],[-6.7252,33.2133],[-6.7051,33.2036],[-6.6831,33.2104],[-6.6436,33.213],[-6.6266,33.2166],[-6.6048,33.2156],[-6.5651,33.1921],[-6.5542,33.1802],[-6.5435,33.1659],[-6.5327,33.1554],[-6.5225,33.1421],[-6.518,33.1236],[-6.478,33.1407],[-6.4476,33.1597],[-6.4209,33.1845],[-6.3467,33.2092],[-6.3257,33.2378],[-6.384,33.2549],[-6.4171,33.2892],[-6.4057,33.3215],[-6.3735,33.346],[-6.3645,33.3746],[-6.3497,33.3849],[-6.3486,33.4148],[-6.3353,33.451],[-6.3124,33.4586],[-6.2382,33.4548],[-6.2115,33.4453],[-6.1754,33.4148],[-6.1869,33.3906],[-6.1848,33.3868],[-6.1982,33.3768],[-6.2077,33.3463],[-6.202,33.3253],[-6.1658,33.3311],[-6.122,33.3311],[-6.0821,33.3292],[-6.0726,33.3025],[-6.0707,33.2816],[-5.9895,33.2828],[-5.9762,33.2991],[-5.9382,33.3092],[-5.9186,33.3053],[-5.8631,33.2888],[-5.8135,33.2786],[-5.7904,33.2856],[-5.7717,33.3155],[-5.77,33.3438],[-5.7806,33.3677],[-5.8042,33.3863],[-5.8156,33.4472],[-5.8121,33.4663],[-5.8099,33.4643],[-5.7851,33.4281],[-5.7781,33.431],[-5.7611,33.4286],[-5.7098,33.3972],[-5.6598,33.3787],[-5.5955,33.3687],[-5.5484,33.3529],[-5.4999,33.3201],[-5.5142,33.2402],[-5.4756,33.2002],[-5.4556,33.1788],[-5.4114,33.116],[-5.2914,33.1188],[-5.3114,33.0774],[-5.32,33.002],[-5.2715,32.9463],[-5.2443,32.9206],[-5.2315,32.885]]]},properties:{name:"Béni-Mellal-Khénifra",id:"MA-05",TYPE:"Region",CNTRY:"Morooco"},id:"MA-05"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-5.3212,34.452],[-5.3375,34.4029],[-5.3618,34.3858],[-5.4103,34.3815],[-5.4317,34.373],[-5.4703,34.3658],[-5.4883,34.3803],[-5.5052,34.3715],[-5.5167,34.3694],[-5.5188,34.353],[-5.5117,34.3308],[-5.4895,34.308],[-5.4503,34.2694],[-5.4239,34.248],[-5.4139,34.2303],[-5.4139,34.208],[-5.4196,34.1781],[-5.4296,34.1395],[-5.4539,34.1181],[-5.4853,34.1024],[-5.5253,34.0938],[-5.561,34.0738],[-5.6281,34.0681],[-5.6738,34.081],[-5.6923,34.0881],[-5.6809,34.1409],[-5.6895,34.1538],[-5.7017,34.1668],[-5.713,34.1635],[-5.7355,34.1693],[-5.7418,34.1845],[-5.8037,34.2023],[-5.8365,34.188],[-5.8537,34.1638],[-5.8752,34.1374],[-5.906,34.0966],[-5.8951,34.0716],[-5.8694,34.0387],[-5.8394,34.0102],[-5.7794,33.9887],[-5.7395,33.9759],[-5.7273,33.9803],[-5.7195,33.9759],[-5.6852,33.9459],[-5.7052,33.9131],[-5.7423,33.8731],[-5.7666,33.8417],[-5.7566,33.8203],[-5.7252,33.8031],[-5.698,33.776],[-5.6938,33.7589],[-5.718,33.7103],[-5.7366,33.6761],[-5.7547,33.6622],[-5.7593,33.6235],[-5.7653,33.6041],[-5.7494,33.5776],[-5.7395,33.5433],[-5.7494,33.5048],[-5.768,33.4848],[-5.7869,33.4831],[-5.8118,33.4681],[-5.8156,33.4472],[-5.8042,33.3863],[-5.7806,33.3677],[-5.77,33.3438],[-5.7717,33.3155],[-5.7904,33.2856],[-5.8135,33.2786],[-5.8631,33.2888],[-5.9186,33.3053],[-5.9382,33.3092],[-5.9762,33.2991],[-5.9895,33.2828],[-6.0707,33.2816],[-6.0726,33.3025],[-6.0821,33.3292],[-6.122,33.3311],[-6.1658,33.3311],[-6.202,33.3253],[-6.2077,33.3463],[-6.1982,33.3768],[-6.1848,33.3868],[-6.1869,33.3906],[-6.1754,33.4148],[-6.2115,33.4453],[-6.2382,33.4548],[-6.3124,33.4586],[-6.3353,33.451],[-6.3486,33.4148],[-6.3497,33.3849],[-6.3645,33.3746],[-6.3735,33.346],[-6.4057,33.3215],[-6.4171,33.2892],[-6.384,33.2549],[-6.3257,33.2378],[-6.3467,33.2092],[-6.4209,33.1845],[-6.4476,33.1597],[-6.478,33.1407],[-6.518,33.1236],[-6.5225,33.1421],[-6.5327,33.1554],[-6.5435,33.1659],[-6.5542,33.1802],[-6.5651,33.1921],[-6.6048,33.2156],[-6.6266,33.2166],[-6.6436,33.213],[-6.6831,33.2104],[-6.7051,33.2036],[-6.7252,33.2133],[-6.7531,33.2221],[-6.7653,33.2188],[-6.7978,33.2302],[-6.8002,33.2319],[-6.7997,33.2321],[-6.7959,33.293],[-6.7845,33.3292],[-6.775,33.3672],[-6.7521,33.3958],[-6.7616,33.4186],[-6.7959,33.4453],[-6.7959,33.4662],[-6.7655,33.4891],[-6.7179,33.5366],[-6.8019,33.5419],[-6.8112,33.5366],[-6.8454,33.5386],[-6.8568,33.5557],[-6.8621,33.5838],[-6.8726,33.5823],[-6.888,33.5791],[-6.8974,33.5805],[-6.9028,33.5884],[-6.912,33.5823],[-6.9273,33.5633],[-6.9882,33.5614],[-6.9818,33.6422],[-6.999,33.6429],[-7,33.6341],[-7.0145,33.6347],[-7.0155,33.6411],[-7.0055,33.6593],[-7.0125,33.6739],[-7.0229,33.6839],[-7.0255,33.6921],[-7.0365,33.7034],[-7.0336,33.7102],[-7.0362,33.7289],[-7.0372,33.7471],[-7.0459,33.7736],[-7.0612,33.7884],[-7.0689,33.8066],[-7.0817,33.8083],[-7.1018,33.8081],[-7.1134,33.8094],[-7.1234,33.8196],[-7.1268,33.8296],[-7.1101,33.8393],[-7.1024,33.8479],[-7.0921,33.8557],[-7.0751,33.8626],[-7.0663,33.8712],[-7.0621,33.8693],[-7.0485,33.871],[-7.046,33.874],[-7.0243,33.8846],[-7.0135,33.8932],[-7.0024,33.8965],[-7.0032,33.9021],[-6.9915,33.9079],[-6.981,33.909],[-6.9707,33.9218],[-6.9643,33.9249],[-6.9443,33.9421],[-6.9152,33.9646],[-6.9099,33.9715],[-6.8946,33.986],[-6.8837,33.9946],[-6.8588,34.0207],[-6.8446,34.0329],[-6.8346,34.0335],[-6.8304,34.0376],[-6.8343,34.0432],[-6.8173,34.0612],[-6.8104,34.0654],[-6.8076,34.0721],[-6.8026,34.0726],[-6.7862,34.089],[-6.7768,34.1047],[-6.7685,34.1129],[-6.7576,34.1271],[-6.7535,34.1299],[-6.743,34.1441],[-6.7329,34.1549],[-6.7021,34.2032],[-6.6954,34.2168],[-6.6757,34.2657],[-6.6499,34.304],[-6.6174,34.3462],[-6.6057,34.3626],[-6.5901,34.381],[-6.5807,34.3946],[-6.5612,34.4193],[-6.5512,34.4346],[-6.5401,34.4476],[-6.524,34.4713],[-6.5146,34.4899],[-6.5007,34.5093],[-6.4882,34.5321],[-6.4732,34.5554],[-6.4651,34.5713],[-6.4274,34.6337],[-6.3963,34.6888],[-6.3901,34.6976],[-6.3868,34.7071],[-6.3729,34.7302],[-6.3493,34.7779],[-6.3482,34.784],[-6.3235,34.8301],[-6.3124,34.8493],[-6.3029,34.8693],[-6.2924,34.8712],[-6.286,34.8676],[-6.2876,34.8565],[-6.2951,34.8382],[-6.2779,34.8299],[-6.2679,34.8232],[-6.259,34.8271],[-6.2565,34.8368],[-6.2502,34.8368],[-6.2462,34.8504],[-6.251,34.8515],[-6.2496,34.8596],[-6.2715,34.8651],[-6.2746,34.8693],[-6.2829,34.8685],[-6.2896,34.8754],[-6.2977,34.8737],[-6.2965,34.8843],[-6.2896,34.8965],[-6.2843,34.9132],[-6.2743,34.9324],[-6.2705,34.9438],[-6.2502,34.987],[-6.2214,34.9871],[-6.1859,34.9821],[-6.1547,34.9794],[-6.1234,34.979],[-6.0881,34.9826],[-6.0608,34.9758],[-6.0101,34.9686],[-5.9689,34.9642],[-5.954,34.94],[-5.9183,34.9221],[-5.8594,34.915],[-5.8164,34.9248],[-5.8118,34.9175],[-5.794,34.914],[-5.7771,34.9156],[-5.7671,34.9122],[-5.7506,34.8971],[-5.7488,34.8579],[-5.7506,34.7936],[-5.747,34.7419],[-5.7363,34.7133],[-5.722,34.6883],[-5.706,34.6758],[-5.6738,34.6687],[-5.656,34.6919],[-5.6453,34.7187],[-5.6257,34.7205],[-5.5953,34.7062],[-5.5775,34.6866],[-5.5525,34.6794],[-5.5097,34.658],[-5.4865,34.6384],[-5.4561,34.6187],[-5.4311,34.608],[-5.4044,34.5795],[-5.4044,34.5384],[-5.399,34.5081],[-5.3723,34.4956],[-5.3455,34.476],[-5.3249,34.4674],[-5.3212,34.452]]]},properties:{name:"Rabat-Salé-Kénitra",id:"MA-04",TYPE:"Region",CNTRY:"Morooco"},id:"MA-04"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-3.9981,32.6029],[-4.0194,32.6246],[-4.0541,32.6376],[-4.0905,32.6252],[-4.1031,32.6026],[-4.1269,32.5818],[-4.1983,32.5699],[-4.2399,32.5818],[-4.2905,32.6413],[-4.2883,32.6799],[-4.2932,32.7182],[-4.3208,32.7444],[-4.3555,32.7713],[-4.3849,32.7961],[-4.4253,32.8181],[-4.435,32.8338],[-4.4501,32.8633],[-4.4663,32.8787],[-4.4812,32.8868],[-4.5148,32.8917],[-4.548,32.8916],[-4.579,32.89],[-4.612,32.8799],[-4.6462,32.8824],[-4.6687,32.8761],[-4.7139,32.8917],[-4.7532,32.9176],[-4.7628,32.9374],[-4.7598,32.961],[-4.7472,32.9776],[-4.7439,32.9957],[-4.7505,33.0073],[-4.8001,33.0543],[-4.8247,33.068],[-4.8388,33.0889],[-4.8528,33.0931],[-4.8814,33.0974],[-4.9014,33.086],[-4.9199,33.0689],[-4.9456,33.0646],[-5.0027,33.076],[-5.0242,33.0546],[-5.0413,33.006],[-5.0513,32.9675],[-5.0627,32.9461],[-5.0813,32.9332],[-5.1127,32.9347],[-5.1384,32.9432],[-5.1683,32.9447],[-5.1869,32.9347],[-5.2326,32.8818],[-5.2347,32.8819],[-5.2315,32.885],[-5.2443,32.9206],[-5.2715,32.9463],[-5.32,33.002],[-5.3114,33.0774],[-5.2914,33.1188],[-5.4114,33.116],[-5.4556,33.1788],[-5.4756,33.2002],[-5.5142,33.2402],[-5.4999,33.3201],[-5.5484,33.3529],[-5.5955,33.3687],[-5.6598,33.3787],[-5.7098,33.3972],[-5.7611,33.4286],[-5.7781,33.431],[-5.7851,33.4281],[-5.8099,33.4643],[-5.8121,33.4663],[-5.8118,33.4681],[-5.7869,33.4831],[-5.768,33.4848],[-5.7494,33.5048],[-5.7395,33.5433],[-5.7494,33.5776],[-5.7653,33.6041],[-5.7593,33.6235],[-5.7547,33.6622],[-5.7366,33.6761],[-5.718,33.7103],[-5.6938,33.7589],[-5.698,33.776],[-5.7252,33.8031],[-5.7566,33.8203],[-5.7666,33.8417],[-5.7423,33.8731],[-5.7052,33.9131],[-5.6852,33.9459],[-5.7195,33.9759],[-5.7273,33.9803],[-5.7395,33.9759],[-5.7794,33.9887],[-5.8394,34.0102],[-5.8694,34.0387],[-5.8951,34.0716],[-5.906,34.0966],[-5.8752,34.1374],[-5.8537,34.1638],[-5.8365,34.188],[-5.8037,34.2023],[-5.7418,34.1845],[-5.7355,34.1693],[-5.713,34.1635],[-5.7017,34.1668],[-5.6895,34.1538],[-5.6809,34.1409],[-5.6923,34.0881],[-5.6738,34.081],[-5.6281,34.0681],[-5.561,34.0738],[-5.5253,34.0938],[-5.4853,34.1024],[-5.4539,34.1181],[-5.4296,34.1395],[-5.4196,34.1781],[-5.4139,34.208],[-5.4139,34.2303],[-5.4239,34.248],[-5.4503,34.2694],[-5.4895,34.308],[-5.5117,34.3308],[-5.5188,34.353],[-5.5167,34.3694],[-5.5052,34.3715],[-5.4883,34.3803],[-5.4703,34.3658],[-5.4317,34.373],[-5.4103,34.3815],[-5.3618,34.3858],[-5.3375,34.4029],[-5.3212,34.452],[-5.3189,34.4586],[-5.2989,34.4758],[-5.2761,34.4872],[-5.2376,34.4886],[-5.2076,34.5072],[-5.1662,34.5129],[-5.1533,34.5371],[-5.1569,34.5882],[-5.1723,34.5944],[-5.1735,34.6058],[-5.1653,34.6321],[-5.1586,34.6616],[-5.1584,34.6975],[-5.1467,34.7299],[-5.1198,34.7555],[-5.0128,34.7528],[-4.9386,34.7585],[-4.8872,34.7833],[-4.88,34.8009],[-4.8691,34.8036],[-4.8416,34.8175],[-4.8239,34.8197],[-4.8072,34.8137],[-4.7806,34.8004],[-4.7711,34.7757],[-4.7596,34.7509],[-4.752,34.7148],[-4.7197,34.6938],[-4.6721,34.6862],[-4.6302,34.6824],[-4.5921,34.6672],[-4.5674,34.6557],[-4.4817,34.6481],[-4.4475,34.6348],[-4.3904,34.6481],[-4.337,34.671],[-4.3009,34.7071],[-4.2838,34.7433],[-4.2533,34.77],[-4.2324,34.7623],[-4.2209,34.7395],[-4.2038,34.7224],[-4.1524,34.7109],[-4.1143,34.7243],[-4.0858,34.749],[-4.0706,34.7814],[-4.0458,34.808],[-4.0039,34.808],[-3.943,34.8099],[-3.8802,34.8232],[-3.8612,34.8309],[-3.8421,34.8461],[-3.8117,34.8575],[-3.7793,34.8632],[-3.7768,34.8669],[-3.7705,34.8647],[-3.7548,34.8692],[-3.7338,34.8708],[-3.7261,34.8693],[-3.7229,34.8634],[-3.7383,34.8525],[-3.7299,34.8425],[-3.7214,34.8434],[-3.7142,34.8475],[-3.7014,34.8433],[-3.6904,34.8441],[-3.6852,34.8483],[-3.6767,34.8479],[-3.6525,34.8364],[-3.6361,34.8265],[-3.6201,34.827],[-3.6094,34.831],[-3.593,34.8311],[-3.5847,34.8275],[-3.5816,34.8205],[-3.5929,34.8062],[-3.5924,34.7985],[-3.5811,34.7872],[-3.5849,34.7572],[-3.5993,34.7398],[-3.6086,34.7236],[-3.6063,34.7158],[-3.5993,34.7105],[-3.5823,34.7053],[-3.5743,34.6999],[-3.5727,34.6882],[-3.5792,34.6835],[-3.5882,34.6821],[-3.6171,34.6838],[-3.6256,34.6824],[-3.6321,34.6768],[-3.6321,34.6661],[-3.6368,34.6245],[-3.6856,34.6162],[-3.7225,34.609],[-3.7415,34.5817],[-3.7368,34.4675],[-3.7534,34.4508],[-3.7891,34.4461],[-3.8296,34.4353],[-3.8379,34.4032],[-3.826,34.3556],[-3.8213,34.3069],[-3.8688,34.3045],[-3.9033,34.2961],[-3.9152,34.2783],[-3.9081,34.245],[-3.8736,34.2164],[-3.8343,34.2022],[-3.8034,34.1677],[-3.801,34.0832],[-3.8165,34.0144],[-3.8593,33.9228],[-3.8807,33.8788],[-3.9117,33.8395],[-3.9366,33.8145],[-3.9557,33.8038],[-3.97,33.7908],[-3.9509,33.7658],[-3.9533,33.7348],[-3.9664,33.711],[-3.9938,33.7063],[-4.0199,33.6956],[-4.0497,33.6861],[-4.081,33.6707],[-4.083,33.6574],[-4.0932,33.6413],[-4.1141,33.621],[-4.1184,33.6125],[-4.1122,33.6032],[-4.0937,33.5893],[-4.0825,33.5475],[-4.0575,33.538],[-4.0159,33.5332],[-3.9945,33.5142],[-3.9707,33.4975],[-3.9385,33.4987],[-3.9207,33.5213],[-3.8981,33.5439],[-3.8779,33.5475],[-3.8553,33.5225],[-3.8398,33.4832],[-3.8232,33.4666],[-3.8005,33.4892],[-3.7708,33.5249],[-3.7422,33.5534],[-3.7363,33.5665],[-3.772,33.5701],[-3.8005,33.5784],[-3.816,33.5951],[-3.8101,33.6189],[-3.7886,33.6557],[-3.7458,33.6772],[-3.6994,33.7081],[-3.6471,33.7509],[-3.5971,33.8128],[-3.5388,33.8711],[-3.5067,33.8961],[-3.4969,33.9057],[-3.4781,33.9092],[-3.4567,33.8913],[-3.4329,33.8854],[-3.3901,33.8711],[-3.3687,33.8413],[-3.3601,33.8178],[-3.3437,33.7997],[-3.3128,33.7878],[-3.2438,33.783],[-3.2404,33.7857],[-3.1533,33.7747],[-3.1181,33.7736],[-3.0855,33.7676],[-3.0332,33.764],[-3.0201,33.7426],[-3.0248,33.72],[-3.0689,33.6831],[-3.0962,33.6546],[-3.195,33.582],[-3.2354,33.5594],[-3.255,33.5437],[-3.2573,33.5381],[-3.2577,33.5176],[-3.2548,33.5045],[-3.247,33.4934],[-3.2382,33.4846],[-3.2308,33.481],[-3.1631,33.4801],[-3.1193,33.4687],[-3.0736,33.4383],[-3.0337,33.4002],[-2.9803,33.3431],[-2.9194,33.265],[-2.8642,33.2117],[-2.8414,33.1737],[-2.9328,33.1718],[-2.9765,33.1622],[-3.0356,33.1089],[-3.1136,33.1108],[-3.1695,33.1104],[-3.189,33.1048],[-3.2203,33.0944],[-3.2487,33.0876],[-3.2797,33.0835],[-3.3194,33.0812],[-3.3519,33.0808],[-3.3851,33.0859],[-3.4114,33.0879],[-3.4468,33.0935],[-3.4825,33.0923],[-3.5499,33.0946],[-3.5802,33.0917],[-3.5965,33.0924],[-3.6142,33.0728],[-3.6466,33.0442],[-3.6771,33.0271],[-3.698,32.9681],[-3.7456,32.93],[-3.7799,32.9129],[-3.8065,32.8786],[-3.8465,32.8405],[-3.8693,32.8063],[-3.8845,32.7549],[-3.8998,32.7149],[-3.934,32.6864],[-3.9626,32.6692],[-3.9778,32.6369],[-3.9911,32.6064],[-3.9981,32.6029]]]},properties:{name:"Fès- Meknès",id:"MA-03",TYPE:"Region",CNTRY:"Morooco"},id:"MA-03"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-3.1117,31.6971],[-3.2502,31.6956],[-3.2626,31.7097],[-3.2698,31.7388],[-3.2197,31.7638],[-3.184,31.7787],[-3.1156,31.8174],[-3.1959,31.856],[-3.2197,31.9215],[-3.2525,32.0166],[-3.2525,32.0494],[-3.2197,32.1326],[-3.1811,32.1951],[-3.2701,32.1486],[-3.2713,32.1489],[-3.303,32.1326],[-3.3595,32.1237],[-3.425,32.1356],[-3.4666,32.1505],[-3.4836,32.1778],[-3.4988,32.1785],[-3.541,32.1837],[-3.5545,32.1845],[-3.5826,32.1564],[-3.6302,32.1207],[-3.6748,32.1089],[-3.6599,32.1445],[-3.6481,32.1751],[-3.6685,32.1768],[-3.6848,32.1851],[-3.6956,32.1832],[-3.764,32.1951],[-3.7819,32.2338],[-3.7857,32.2949],[-3.7938,32.3765],[-3.8235,32.4182],[-3.8741,32.4331],[-3.8931,32.4331],[-3.8949,32.4366],[-3.9336,32.4479],[-3.9603,32.4658],[-3.9514,32.4806],[-3.9399,32.489],[-3.9247,32.4866],[-3.9098,32.5371],[-3.9455,32.5699],[-3.9783,32.5777],[-3.9861,32.5908],[-3.9981,32.6029],[-3.9911,32.6064],[-3.9778,32.6369],[-3.9626,32.6692],[-3.934,32.6864],[-3.8998,32.7149],[-3.8845,32.7549],[-3.8693,32.8063],[-3.8465,32.8405],[-3.8065,32.8786],[-3.7799,32.9129],[-3.7456,32.93],[-3.698,32.9681],[-3.6771,33.0271],[-3.6466,33.0442],[-3.6142,33.0728],[-3.5965,33.0924],[-3.5802,33.0917],[-3.5499,33.0946],[-3.4825,33.0923],[-3.4468,33.0935],[-3.4114,33.0879],[-3.3851,33.0859],[-3.3519,33.0808],[-3.3194,33.0812],[-3.2797,33.0835],[-3.2487,33.0876],[-3.2203,33.0944],[-3.189,33.1048],[-3.1695,33.1104],[-3.1136,33.1108],[-3.0356,33.1089],[-2.9765,33.1622],[-2.9328,33.1718],[-2.8414,33.1737],[-2.8642,33.2117],[-2.9194,33.265],[-2.9803,33.3431],[-3.0337,33.4002],[-3.0736,33.4383],[-3.1193,33.4687],[-3.1631,33.4801],[-3.2308,33.481],[-3.2382,33.4846],[-3.247,33.4934],[-3.2548,33.5045],[-3.2577,33.5176],[-3.2573,33.5381],[-3.255,33.5437],[-3.2354,33.5594],[-3.195,33.582],[-3.0962,33.6546],[-3.0689,33.6831],[-3.0248,33.72],[-3.0201,33.7426],[-3.0332,33.764],[-3.0855,33.7676],[-3.1181,33.7736],[-3.1533,33.7747],[-3.2404,33.7857],[-3.2438,33.783],[-3.3128,33.7878],[-3.3437,33.7997],[-3.3601,33.8178],[-3.3687,33.8413],[-3.3901,33.8711],[-3.4329,33.8854],[-3.4567,33.8913],[-3.4781,33.9092],[-3.4969,33.9057],[-3.5067,33.8961],[-3.5388,33.8711],[-3.5971,33.8128],[-3.6471,33.7509],[-3.6994,33.7081],[-3.7458,33.6772],[-3.7886,33.6557],[-3.8101,33.6189],[-3.816,33.5951],[-3.8005,33.5784],[-3.772,33.5701],[-3.7363,33.5665],[-3.7422,33.5534],[-3.7708,33.5249],[-3.8005,33.4892],[-3.8232,33.4666],[-3.8398,33.4832],[-3.8553,33.5225],[-3.8779,33.5475],[-3.8981,33.5439],[-3.9207,33.5213],[-3.9385,33.4987],[-3.9707,33.4975],[-3.9945,33.5142],[-4.0159,33.5332],[-4.0575,33.538],[-4.0825,33.5475],[-4.0937,33.5893],[-4.1122,33.6032],[-4.1184,33.6125],[-4.1141,33.621],[-4.0932,33.6413],[-4.083,33.6574],[-4.081,33.6707],[-4.0497,33.6861],[-4.0199,33.6956],[-3.9938,33.7063],[-3.9664,33.711],[-3.9533,33.7348],[-3.9509,33.7658],[-3.97,33.7908],[-3.9557,33.8038],[-3.9366,33.8145],[-3.9117,33.8395],[-3.8807,33.8788],[-3.8593,33.9228],[-3.8165,34.0144],[-3.801,34.0832],[-3.8034,34.1677],[-3.8343,34.2022],[-3.8736,34.2164],[-3.9081,34.245],[-3.9152,34.2783],[-3.9033,34.2961],[-3.8688,34.3045],[-3.8213,34.3069],[-3.826,34.3556],[-3.8379,34.4032],[-3.8296,34.4353],[-3.7891,34.4461],[-3.7534,34.4508],[-3.7368,34.4675],[-3.7415,34.5817],[-3.7225,34.609],[-3.6856,34.6162],[-3.6368,34.6245],[-3.6321,34.6661],[-3.6321,34.6768],[-3.6256,34.6824],[-3.6171,34.6838],[-3.5882,34.6821],[-3.5792,34.6835],[-3.5727,34.6882],[-3.5743,34.6999],[-3.5823,34.7053],[-3.5993,34.7105],[-3.6063,34.7158],[-3.6086,34.7236],[-3.5993,34.7398],[-3.5849,34.7572],[-3.5811,34.7872],[-3.5924,34.7985],[-3.5929,34.8062],[-3.5816,34.8205],[-3.5847,34.8275],[-3.593,34.8311],[-3.6094,34.831],[-3.6201,34.827],[-3.6361,34.8265],[-3.6525,34.8364],[-3.6767,34.8479],[-3.6852,34.8483],[-3.6904,34.8441],[-3.7014,34.8433],[-3.7142,34.8475],[-3.7214,34.8434],[-3.7299,34.8425],[-3.7383,34.8525],[-3.7229,34.8634],[-3.7261,34.8693],[-3.7338,34.8708],[-3.7548,34.8692],[-3.7705,34.8647],[-3.7808,34.8683],[-3.7828,34.8869],[-3.797,34.8934],[-3.7991,34.9059],[-3.796,34.9363],[-3.7996,34.9478],[-3.799,34.9591],[-3.7926,34.9995],[-3.7932,35.0142],[-3.8012,35.0235],[-3.7991,35.037],[-3.8014,35.0755],[-3.8036,35.088],[-3.811,35.1109],[-3.8105,35.1221],[-3.8025,35.1466],[-3.7986,35.1633],[-3.7976,35.1746],[-3.8058,35.2029],[-3.8015,35.2037],[-3.7801,35.2143],[-3.7718,35.2221],[-3.7654,35.2313],[-3.7621,35.2446],[-3.7607,35.2576],[-3.756,35.2685],[-3.7504,35.2749],[-3.739,35.2754],[-3.7351,35.2812],[-3.7196,35.286],[-3.7154,35.2835],[-3.7085,35.2885],[-3.6849,35.2843],[-3.6782,35.2863],[-3.6746,35.2774],[-3.6657,35.2685],[-3.6513,35.2615],[-3.6493,35.2585],[-3.6368,35.2543],[-3.6301,35.2482],[-3.6229,35.2474],[-3.616,35.2404],[-3.5907,35.2268],[-3.5699,35.2201],[-3.559,35.2213],[-3.5363,35.2174],[-3.5204,35.2093],[-3.4907,35.199],[-3.4735,35.1985],[-3.4518,35.2063],[-3.446,35.1985],[-3.4282,35.1926],[-3.4026,35.1924],[-3.389,35.1896],[-3.3574,35.189],[-3.349,35.186],[-3.3382,35.1857],[-3.3248,35.1896],[-3.3124,35.1974],[-3.3049,35.2049],[-3.2773,35.2113],[-3.259,35.2129],[-3.251,35.2176],[-3.2362,35.2221],[-3.2276,35.2215],[-3.2187,35.2276],[-3.2093,35.2276],[-3.2012,35.2232],[-3.1832,35.2318],[-3.1699,35.2404],[-3.1574,35.2524],[-3.1421,35.2704],[-3.1429,35.274],[-3.1346,35.2799],[-3.1346,35.2851],[-3.124,35.2835],[-3.121,35.2779],[-3.106,35.2718],[-3.0829,35.2807],[-3.0665,35.2965],[-3.0398,35.3329],[-3.0293,35.3535],[-3.0099,35.3837],[-3.0118,35.3932],[-3.0035,35.3982],[-3.0101,35.4013],[-3.006,35.4101],[-2.996,35.4174],[-2.9943,35.4351],[-2.9832,35.434],[-2.9768,35.4396],[-2.971,35.436],[-2.9537,35.4349],[-2.9496,35.4243],[-2.9604,35.419],[-2.9643,35.4093],[-2.959,35.4043],[-2.9582,35.3976],[-2.9637,35.3901],[-2.9588,35.3843],[-2.9651,35.3787],[-2.9651,35.3729],[-2.9707,35.3671],[-2.971,35.3615],[-2.9629,35.3574],[-2.9612,35.3504],[-2.956,35.3468],[-2.961,35.3296],[-2.954,35.324],[-2.9604,35.3112],[-2.9626,35.3],[-2.9603,35.2909],[-2.9517,35.2828],[-2.9368,35.2804],[-2.9215,35.2629],[-2.8915,35.2343],[-2.8693,35.2151],[-2.876,35.2115],[-2.8793,35.2213],[-2.8932,35.2332],[-2.9004,35.2337],[-2.9046,35.2438],[-2.9151,35.2457],[-2.9149,35.2512],[-2.9229,35.2554],[-2.9293,35.2507],[-2.9313,35.2388],[-2.9251,35.2318],[-2.924,35.2243],[-2.9193,35.2187],[-2.9057,35.2179],[-2.899,35.2096],[-2.9035,35.2049],[-2.9101,35.206],[-2.9251,35.1979],[-2.9271,35.1913],[-2.924,35.1829],[-2.9118,35.166],[-2.9035,35.1604],[-2.9029,35.1485],[-2.8876,35.1357],[-2.866,35.1246],[-2.8593,35.124],[-2.8293,35.1079],[-2.8118,35.1026],[-2.7876,35.1032],[-2.7635,35.0985],[-2.751,35.1004],[-2.746,35.1115],[-2.7562,35.1232],[-2.7682,35.1274],[-2.7754,35.1368],[-2.784,35.1387],[-2.7893,35.1518],[-2.7993,35.1557],[-2.8129,35.1646],[-2.8163,35.1699],[-2.8246,35.1751],[-2.8196,35.1782],[-2.8088,35.1685],[-2.7893,35.1554],[-2.7837,35.149],[-2.7677,35.1363],[-2.7399,35.121],[-2.7221,35.1179],[-2.7174,35.1132],[-2.7026,35.1082],[-2.6982,35.1046],[-2.6818,35.0987],[-2.6682,35.0985],[-2.664,35.0951],[-2.6468,35.0901],[-2.6246,35.0865],[-2.606,35.0857],[-2.5976,35.0874],[-2.5926,35.0849],[-2.5807,35.0843],[-2.566,35.0812],[-2.556,35.0838],[-2.5437,35.084],[-2.5204,35.089],[-2.5065,35.0943],[-2.5007,35.0996],[-2.4946,35.0996],[-2.4815,35.1043],[-2.4685,35.1151],[-2.4526,35.1246],[-2.4401,35.1363],[-2.4257,35.1476],[-2.4199,35.1407],[-2.4063,35.136],[-2.3546,35.1246],[-2.3388,35.1232],[-2.3157,35.1168],[-2.2949,35.1096],[-2.274,35.1007],[-2.2371,35.0896],[-2.2119,35.0843],[-2.2111,35.062],[-2.2153,35.0473],[-2.1864,35.0318],[-2.1813,35.0203],[-2.1692,35.0104],[-2.1573,35.0086],[-2.1452,35.0003],[-2.1293,34.998],[-2.123,34.9946],[-2.1203,34.9827],[-2.1087,34.976],[-2.1083,34.9726],[-2.0961,34.9645],[-2.0889,34.9553],[-2.0379,34.9254],[-2.017,34.9286],[-2.0138,34.9316],[-2.0006,34.9296],[-1.9719,34.9338],[-1.9718,34.9163],[-1.9697,34.9076],[-1.9718,34.9036],[-1.972,34.8883],[-1.9673,34.8769],[-1.9487,34.871],[-1.9385,34.8626],[-1.9212,34.857],[-1.8918,34.8422],[-1.8879,34.8283],[-1.8865,34.808],[-1.8569,34.8032],[-1.8377,34.7883],[-1.8191,34.7824],[-1.7966,34.7725],[-1.7874,34.7664],[-1.7807,34.7648],[-1.7623,34.7561],[-1.751,34.7528],[-1.7426,34.7421],[-1.7593,34.7326],[-1.7702,34.7249],[-1.77,34.7137],[-1.7739,34.6994],[-1.7877,34.6885],[-1.8022,34.6686],[-1.8111,34.6614],[-1.8317,34.6343],[-1.8333,34.6302],[-1.8502,34.6172],[-1.8365,34.6187],[-1.8319,34.614],[-1.8217,34.6116],[-1.8137,34.6059],[-1.809,34.5954],[-1.7976,34.5864],[-1.7948,34.5785],[-1.7874,34.5723],[-1.7859,34.5651],[-1.7759,34.5514],[-1.769,34.5484],[-1.7619,34.5401],[-1.7626,34.5322],[-1.7532,34.53],[-1.7507,34.52],[-1.7461,34.5148],[-1.733,34.5073],[-1.7223,34.5081],[-1.7072,34.5],[-1.6932,34.4973],[-1.6888,34.4905],[-1.7091,34.4691],[-1.7764,34.3972],[-1.7812,34.3915],[-1.7673,34.3724],[-1.7517,34.3624],[-1.7308,34.3442],[-1.7214,34.3303],[-1.7041,34.3093],[-1.7041,34.3044],[-1.7098,34.2904],[-1.7066,34.2731],[-1.7132,34.2534],[-1.7118,34.2388],[-1.7048,34.2222],[-1.6747,34.1627],[-1.6476,34.1067],[-1.6511,34.0934],[-1.6691,34.0002],[-1.699,33.8703],[-1.6855,33.8272],[-1.6703,33.7728],[-1.7285,33.7353],[-1.7371,33.7003],[-1.7104,33.688],[-1.7063,33.6783],[-1.687,33.6764],[-1.6653,33.6828],[-1.6528,33.6824],[-1.6449,33.6716],[-1.6429,33.6602],[-1.6356,33.6413],[-1.6303,33.6311],[-1.624,33.6247],[-1.6072,33.6194],[-1.5985,33.6151],[-1.5951,33.6052],[-1.6,33.5931],[-1.5969,33.5869],[-1.6019,33.5761],[-1.5937,33.5742],[-1.5974,33.5599],[-1.6035,33.5573],[-1.5979,33.5413],[-1.5882,33.5303],[-1.5963,33.5208],[-1.601,33.5094],[-1.6053,33.5042],[-1.6207,33.4918],[-1.6224,33.4782],[-1.6187,33.4763],[-1.6242,33.4646],[-1.6233,33.4537],[-1.6323,33.4318],[-1.6453,33.4241],[-1.6492,33.4087],[-1.6634,33.38],[-1.6643,33.3546],[-1.6598,33.3372],[-1.6626,33.3304],[-1.6631,33.3179],[-1.6609,33.3033],[-1.6707,33.2846],[-1.6678,33.2754],[-1.658,33.2578],[-1.6453,33.2494],[-1.6371,33.2344],[-1.6266,33.2209],[-1.6091,33.2138],[-1.6013,33.2047],[-1.6009,33.1982],[-1.59,33.1843],[-1.5798,33.1669],[-1.5756,33.157],[-1.575,33.1485],[-1.5658,33.1422],[-1.55,33.1266],[-1.5381,33.1173],[-1.5336,33.1072],[-1.5136,33.0936],[-1.4984,33.0904],[-1.4744,33.0762],[-1.4673,33.0621],[-1.4607,33.0418],[-1.4757,33.0213],[-1.4761,33.0137],[-1.4712,33.0033],[-1.4849,32.975],[-1.4954,32.9667],[-1.5095,32.9691],[-1.5365,32.9582],[-1.5427,32.9574],[-1.4972,32.8984],[-1.3812,32.7393],[-1.2701,32.6955],[-1.0439,32.547],[-1.0139,32.5264],[-.9992,32.5192],[-.9974,32.5127],[-1.0008,32.5056],[-1.0204,32.4966],[-1.046,32.4765],[-1.0499,32.468],[-1.0585,32.463],[-1.0671,32.4498],[-1.0785,32.4425],[-1.0879,32.4396],[-1.1028,32.4317],[-1.1101,32.422],[-1.116,32.4224],[-1.1214,32.4144],[-1.1381,32.4151],[-1.1509,32.4179],[-1.1767,32.4124],[-1.1988,32.4036],[-1.209,32.3918],[-1.2063,32.387],[-1.2111,32.3701],[-1.2171,32.3603],[-1.2214,32.3471],[-1.2334,32.3357],[-1.2496,32.327],[-1.2474,32.3191],[-1.2357,32.31],[-1.2372,32.3048],[-1.2357,32.2923],[-1.2413,32.2749],[-1.2432,32.2589],[-1.2464,32.2537],[-1.2475,32.2407],[-1.2432,32.2252],[-1.2423,32.2054],[-1.2633,32.1944],[-1.2739,32.1869],[-1.2807,32.1798],[-1.2973,32.1715],[-1.2977,32.1625],[-1.288,32.1589],[-1.2753,32.1634],[-1.2639,32.1616],[-1.2551,32.1665],[-1.249,32.1651],[-1.2361,32.1686],[-1.2318,32.1736],[-1.2162,32.1754],[-1.1909,32.1684],[-1.1821,32.1632],[-1.1789,32.1584],[-1.1713,32.1356],[-1.165,32.1304],[-1.1552,32.1281],[-1.1574,32.1207],[-1.1558,32.1105],[-1.1672,32.1103],[-1.1734,32.105],[-1.1862,32.1024],[-1.1969,32.0956],[-1.2051,32.0848],[-1.2332,32.0798],[-1.241,32.0769],[-1.2546,32.0762],[-1.2631,32.0789],[-1.2716,32.0864],[-1.3143,32.0826],[-1.3372,32.0828],[-1.3512,32.0899],[-1.3645,32.0911],[-1.3813,32.086],[-1.4223,32.0878],[-1.4488,32.0929],[-1.4855,32.0956],[-1.4971,32.1026],[-1.5078,32.1033],[-1.5333,32.0981],[-1.5646,32.093],[-1.5793,32.0918],[-1.6167,32.101],[-1.6751,32.0968],[-1.7608,32.0968],[-1.8312,32.1063],[-1.9073,32.1235],[-1.9492,32.1311],[-1.993,32.1501],[-2.0292,32.152],[-2.0539,32.1368],[-2.0882,32.112],[-2.0977,32.0759],[-2.1167,32.0568],[-2.1567,32.0587],[-2.2005,32.0645],[-2.2405,32.0587],[-2.2557,32.034],[-2.2671,32.0035],[-2.2881,32.0169],[-2.3052,32.034],[-2.3261,32.0625],[-2.3547,32.093],[-2.3851,32.112],[-2.4213,32.1235],[-2.4651,32.1254],[-2.5146,32.1082],[-2.5355,32.0854],[-2.5755,32.0664],[-2.6136,32.0568],[-2.6516,32.0683],[-2.6973,32.0797],[-2.7659,32.0721],[-2.802,32.0568],[-2.8344,32.0378],[-2.8686,32.0093],[-2.8686,31.9921],[-2.8572,31.9788],[-2.8249,31.9693],[-2.8134,31.9426],[-2.8211,31.9217],[-2.8363,31.9141],[-2.8439,31.9026],[-2.8249,31.8608],[-2.8192,31.8265],[-2.8172,31.7904],[-2.8344,31.7713],[-2.8724,31.7542],[-2.8991,31.7256],[-2.941,31.7085],[-2.9905,31.7066],[-3.0304,31.7142],[-3.0799,31.7066],[-3.0982,31.709],[-3.1117,31.6971]]]},properties:{name:"L'Oriental",id:"MA-02",TYPE:"Region",CNTRY:"Morooco"},id:"MA-02"},{type:"Feature",geometry:{type:"Polygon",coordinates:[[[-3.8058,35.2029],[-3.7976,35.1746],[-3.7986,35.1633],[-3.8025,35.1466],[-3.8105,35.1221],[-3.811,35.1109],[-3.8036,35.088],[-3.8014,35.0755],[-3.7991,35.037],[-3.8012,35.0235],[-3.7932,35.0142],[-3.7926,34.9995],[-3.799,34.9591],[-3.7996,34.9478],[-3.796,34.9363],[-3.7991,34.9059],[-3.797,34.8934],[-3.7828,34.8869],[-3.7808,34.8683],[-3.7768,34.8669],[-3.7793,34.8632],[-3.8117,34.8575],[-3.8421,34.8461],[-3.8612,34.8309],[-3.8802,34.8232],[-3.943,34.8099],[-4.0039,34.808],[-4.0458,34.808],[-4.0706,34.7814],[-4.0858,34.749],[-4.1143,34.7243],[-4.1524,34.7109],[-4.2038,34.7224],[-4.2209,34.7395],[-4.2324,34.7623],[-4.2533,34.77],[-4.2838,34.7433],[-4.3009,34.7071],[-4.337,34.671],[-4.3904,34.6481],[-4.4475,34.6348],[-4.4817,34.6481],[-4.5674,34.6557],[-4.5921,34.6672],[-4.6302,34.6824],[-4.6721,34.6862],[-4.7197,34.6938],[-4.752,34.7148],[-4.7596,34.7509],[-4.7711,34.7757],[-4.7806,34.8004],[-4.8072,34.8137],[-4.8239,34.8197],[-4.8416,34.8175],[-4.8691,34.8036],[-4.88,34.8009],[-4.8872,34.7833],[-4.9386,34.7585],[-5.0128,34.7528],[-5.1198,34.7555],[-5.1467,34.7299],[-5.1584,34.6975],[-5.1586,34.6616],[-5.1653,34.6321],[-5.1735,34.6058],[-5.1723,34.5944],[-5.1569,34.5882],[-5.1533,34.5371],[-5.1662,34.5129],[-5.2076,34.5072],[-5.2376,34.4886],[-5.2761,34.4872],[-5.2989,34.4758],[-5.3189,34.4586],[-5.3212,34.452],[-5.3249,34.4674],[-5.3455,34.476],[-5.3723,34.4956],[-5.399,34.5081],[-5.4044,34.5384],[-5.4044,34.5795],[-5.4311,34.608],[-5.4561,34.6187],[-5.4865,34.6384],[-5.5097,34.658],[-5.5525,34.6794],[-5.5775,34.6866],[-5.5953,34.7062],[-5.6257,34.7205],[-5.6453,34.7187],[-5.656,34.6919],[-5.6738,34.6687],[-5.706,34.6758],[-5.722,34.6883],[-5.7363,34.7133],[-5.747,34.7419],[-5.7506,34.7936],[-5.7488,34.8579],[-5.7506,34.8971],[-5.7671,34.9122],[-5.7771,34.9156],[-5.794,34.914],[-5.8118,34.9175],[-5.8164,34.9248],[-5.8594,34.915],[-5.9183,34.9221],[-5.954,34.94],[-5.9689,34.9642],[-6.0101,34.9686],[-6.0608,34.9758],[-6.0881,34.9826],[-6.1234,34.979],[-6.1547,34.9794],[-6.1859,34.9821],[-6.2214,34.9871],[-6.2502,34.987],[-6.2443,34.9988],[-6.2332,35.0265],[-6.229,35.0413],[-6.2232,35.0529],[-6.2232,35.0582],[-6.2126,35.0926],[-6.2085,35.099],[-6.2038,35.1129],[-6.1915,35.1363],[-6.1785,35.1674],[-6.1771,35.1749],[-6.1699,35.1937],[-6.1579,35.1971],[-6.1501,35.2035],[-6.1415,35.2243],[-6.1421,35.2282],[-6.1343,35.2418],[-6.1304,35.2559],[-6.1268,35.2613],[-6.121,35.2804],[-6.114,35.2935],[-6.1074,35.3124],[-6.1057,35.3224],[-6.0921,35.3588],[-6.0818,35.3885],[-6.0815,35.3957],[-6.0679,35.4118],[-6.061,35.4262],[-6.059,35.4371],[-6.0515,35.4551],[-6.0474,35.461],[-6.0287,35.4726],[-6.0265,35.4821],[-6.0198,35.4943],[-6.0132,35.5118],[-6.014,35.5168],[-6.0082,35.526],[-6.0079,35.5343],[-6.004,35.5529],[-5.999,35.5649],[-5.9912,35.5715],[-5.996,35.5771],[-5.9846,35.6138],[-5.9832,35.6249],[-5.9768,35.639],[-5.9743,35.6526],[-5.969,35.6707],[-5.9604,35.6949],[-5.9554,35.7046],[-5.9546,35.7115],[-5.9349,35.7687],[-5.9346,35.7757],[-5.9301,35.7885],[-5.9071,35.8012],[-5.8829,35.7996],[-5.8782,35.7979],[-5.8412,35.7982],[-5.8207,35.7921],[-5.8071,35.7903],[-5.7903,35.7684],[-5.7475,35.7523],[-5.6975,35.763],[-5.6707,35.788],[-5.6547,35.8076],[-5.6011,35.8041],[-5.569,35.8005],[-5.5333,35.8059],[-5.5066,35.8308],[-5.4655,35.8772],[-5.4298,35.8897],[-5.3804,35.8985],[-5.3352,35.8969],[-5.321,35.8808],[-5.296,35.8772],[-5.2674,35.8772],[-5.2496,35.8665],[-5.2781,35.8522],[-5.2835,35.8183],[-5.3085,35.7898],[-5.2983,35.6856],[-5.2896,35.6879],[-5.2738,35.686],[-5.2796,35.6757],[-5.2843,35.6629],[-5.2796,35.6449],[-5.2699,35.6179],[-5.2674,35.6063],[-5.2596,35.5871],[-5.2526,35.5796],[-5.2526,35.5749],[-5.2465,35.5593],[-5.2387,35.5485],[-5.2335,35.5468],[-5.2252,35.5507],[-5.2204,35.5418],[-5.2096,35.5376],[-5.2001,35.5418],[-5.1946,35.5363],[-5.1846,35.5368],[-5.1732,35.5318],[-5.1696,35.5235],[-5.1585,35.5146],[-5.1554,35.5074],[-5.1421,35.4965],[-5.1313,35.4935],[-5.121,35.4868],[-5.111,35.4771],[-5.1057,35.4771],[-5.0957,35.4601],[-5.0943,35.4549],[-5.0863,35.4446],[-5.0799,35.4299],[-5.074,35.4246],[-5.0643,35.409],[-5.0582,35.4054],[-5.0412,35.4035],[-5.0301,35.3993],[-5.0165,35.4035],[-5.0124,35.396],[-5.0012,35.3882],[-4.9879,35.374],[-4.9713,35.3649],[-4.9613,35.3524],[-4.9571,35.3504],[-4.9413,35.3351],[-4.939,35.3285],[-4.9279,35.3185],[-4.8974,35.3051],[-4.8899,35.3046],[-4.8787,35.3001],[-4.8674,35.3018],[-4.8537,35.289],[-4.8463,35.279],[-4.8407,35.2768],[-4.8249,35.2626],[-4.8124,35.2565],[-4.7949,35.2504],[-4.7826,35.2379],[-4.7654,35.2346],[-4.7476,35.2237],[-4.7343,35.2243],[-4.7251,35.2179],[-4.7096,35.2143],[-4.6985,35.2093],[-4.6824,35.2046],[-4.669,35.2071],[-4.6649,35.2121],[-4.6507,35.2135],[-4.631,35.1951],[-4.6137,35.1893],[-4.5999,35.1879],[-4.5924,35.1918],[-4.564,35.1868],[-4.5601,35.1846],[-4.5376,35.1799],[-4.5207,35.1749],[-4.5076,35.1774],[-4.4907,35.1762],[-4.476,35.1704],[-4.4668,35.1646],[-4.4268,35.154],[-4.4046,35.1585],[-4.3915,35.154],[-4.3824,35.1529],[-4.3757,35.149],[-4.359,35.1485],[-4.346,35.1515],[-4.3404,35.1571],[-4.3254,35.1582],[-4.3201,35.1643],[-4.3063,35.169],[-4.2899,35.1724],[-4.2868,35.181],[-4.2779,35.179],[-4.2685,35.1835],[-4.2524,35.1882],[-4.2404,35.1849],[-4.2179,35.1849],[-4.214,35.1896],[-4.2013,35.1918],[-4.1907,35.1979],[-4.1768,35.1982],[-4.1651,35.2018],[-4.1565,35.1982],[-4.1346,35.2001],[-4.1221,35.206],[-4.114,35.2049],[-4.0963,35.2174],[-4.079,35.2232],[-4.0648,35.2246],[-4.0615,35.229],[-4.0521,35.2287],[-4.0399,35.2357],[-4.0329,35.234],[-4.0235,35.2388],[-4.0093,35.2324],[-3.996,35.236],[-3.9799,35.2365],[-3.9618,35.2468],[-3.9501,35.2518],[-3.9426,35.2593],[-3.9271,35.2621],[-3.9193,35.259],[-3.916,35.2526],[-3.9221,35.2499],[-3.924,35.2415],[-3.9215,35.2321],[-3.914,35.2257],[-3.9071,35.214],[-3.8988,35.2099],[-3.8793,35.2035],[-3.8493,35.1968],[-3.8329,35.1974],[-3.8058,35.2029]]]},properties:{name:"Tanger-Tétouan-Al Hoceïma",id:"MA-01",TYPE:"Region",CNTRY:"Morooco"},id:"MA-01"}]}}},["VN5A"]);
//# sourceMappingURL=moroccoLow.js.map
|
import L from "leaflet";
import layerModel from "../layers";
import "leaflet-rotatedmarker";
import { arrayBinaryIndexSearch } from "../../../utils/helper";
export function calculateDateTimeIndex(prevRealDateTime, orderedDateTimes) {
//First Date Time
if (prevRealDateTime <= orderedDateTimes[0]) {
return [0, orderedDateTimes[0]];
}
//Last Date Time
const lastRealDateTime = orderedDateTimes[orderedDateTimes.length - 1];
if (prevRealDateTime >= lastRealDateTime) {
return [orderedDateTimes.length - 1, lastRealDateTime];
}
let dateTimeIndex = orderedDateTimes.indexOf(prevRealDateTime);
// Not real date time
if (dateTimeIndex === -1) {
dateTimeIndex = arrayBinaryIndexSearch(orderedDateTimes, prevRealDateTime) - 1;
}
return [dateTimeIndex, orderedDateTimes[dateTimeIndex]];
}
export function createMapMarker(latLng) {
const newMapMarker = L.marker(latLng, {
icon: L.divIcon({
className: "car-icon",
iconSize: [18, 18],
iconAnchor: [9, 9]
}),
autoPan: false,
riseOnHover: true,
rotationOrigin: "center center"
});
const element = newMapMarker.getElement();
if (element) {
element.style[L.DomUtil.TRANSITION] = "";
}
layerModel.addToMovingLayer(newMapMarker);
return newMapMarker;
};
|
/*!
* OpenUI5
* (c) Copyright 2009-2020 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
// Provides default renderer for control sap.ui.commons.TextField
sap.ui.define(['sap/ui/core/Renderer', 'sap/ui/core/ValueStateSupport', 'sap/ui/core/library', 'sap/ui/Device'],
function(Renderer, ValueStateSupport, coreLibrary, Device) {
"use strict";
// shortcut for sap.ui.core.ValueState
var ValueState = coreLibrary.ValueState;
// shortcut for sap.ui.core.Design
var Design = coreLibrary.Design;
// shortcut for sap.ui.core.ImeMode
var ImeMode = coreLibrary.ImeMode;
/**
* TextField Renderer
* @namespace
* @author SAP
* @version 1.74.0
* @since 0.9.0
*/
var TextFieldRenderer = {};
/**
* Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}.
*
* @param {sap.ui.core.RenderManager} rm The RenderManager that can be used for writing to the render output buffer.
* @param {sap.ui.commons.TextField}
* oTextField The TextField control that should be rendered.
*/
TextFieldRenderer.render = function(rm, oTextField) {
var sWidth = oTextField.getWidth();
var tooltip = ValueStateSupport.enrichTooltip(oTextField, oTextField.getTooltip_AsString());
var bRenderOuter = oTextField._getRenderOuter();
// In case of Combobox, F4-help, DatePicker: Render outer element.
// The details of the outer element are rendered in the hook implemented in the corresponding control.
if (bRenderOuter) {
rm.write("<div");
rm.writeControlData(oTextField);
rm.addClass("sapUiTfBack");
this.renderStyles(rm, oTextField);
if (tooltip) {
rm.writeAttributeEscaped('title', tooltip);
}
var sSpanStyle;
if (sWidth && sWidth != '') {
sSpanStyle = 'width: ' + sWidth + ';';
}
if (this.renderOuterAttributes) {
this.renderOuterAttributes(rm, oTextField);
}
if (sSpanStyle) {
rm.writeAttribute('style', sSpanStyle);
}
rm.writeStyles();
rm.writeClasses();
rm.write(">");
// Outer hook
if (this.renderOuterContentBefore) {
this.renderOuterContentBefore(rm, oTextField);
}
}
// Inner tag / pure TextField
if (this.getInnerTagName) {
rm.write('<' + this.getInnerTagName());
} else {
rm.write("<input");
}
rm.addClass("sapUiTf");
if (!bRenderOuter) {
// Stand-alone TextField
rm.writeControlData(oTextField);
rm.addClass("sapUiTfBack");
this.renderStyles(rm, oTextField);
if (sWidth && sWidth != '') {
rm.addStyle("width", sWidth);
}
} else {
rm.writeAttribute('id', oTextField.getId() + '-input');
rm.addClass("sapUiTfInner");
rm.addStyle("width", '100%');
}
if (tooltip) {
// render title always on INPUT tag (even it's in outer DIV too)
// because screenreader ignores it on outer DIV
rm.writeAttributeEscaped('title', tooltip);
}
if (oTextField.getName()) {
rm.writeAttributeEscaped('name', oTextField.getName());
}
if (!oTextField.getEditable() && oTextField.getEnabled()) {
rm.writeAttribute('readonly', 'readonly');
}
if (this.renderTextFieldEnabled) {
this.renderTextFieldEnabled(rm, oTextField);
} else if (!oTextField.getEnabled()) {
rm.writeAttribute('disabled', 'disabled');
rm.writeAttribute('tabindex', '-1');
} else if (!oTextField.getEditable()) {
rm.writeAttribute('tabindex', '0');
} else {
rm.writeAttribute('tabindex', '0');
}
// Appearance
var sTextDir = oTextField.getTextDirection();
if (sTextDir) {
rm.addStyle("direction", sTextDir.toLowerCase());
}
var sTextAlign = TextFieldRenderer.getTextAlign(oTextField.getTextAlign(), sTextDir);
if (sTextAlign) {
rm.addStyle("text-align", sTextAlign);
}
switch (oTextField.getImeMode()) {
case ImeMode.Inactive:
rm.addStyle('ime-mode','inactive');
break;
case ImeMode.Active:
rm.addStyle('ime-mode','active');
break;
case ImeMode.Disabled:
rm.addStyle('ime-mode','disabled');
break;
// no default
}
if (oTextField.getDesign() == Design.Monospace) {
rm.addClass('sapUiTfMono');
}
if (oTextField.getMaxLength()) {
rm.writeAttribute("maxlength", oTextField.getMaxLength());
}
// Add additional attributes, styles and so on (TextArea)
if (this.renderInnerAttributes) {
this.renderInnerAttributes(rm, oTextField);
}
// ARIA
if (this.renderARIAInfo) {
this.renderARIAInfo(rm, oTextField);
}
var sPlaceholder = oTextField.getPlaceholder();
if (sPlaceholder) {
if (this.convertPlaceholder) {
sPlaceholder = this.convertPlaceholder(oTextField);
}
if (Device.support.input.placeholder) {
rm.writeAttributeEscaped('placeholder', sPlaceholder);
}
}
rm.writeStyles();
rm.writeClasses();
if (this.getInnerTagName) {
rm.write(">");
} else {
rm.write(" value=\"");
if (!Device.support.input.placeholder && sPlaceholder && !oTextField.getValue()) {
rm.writeEscaped(sPlaceholder);
} else {
rm.writeEscaped(oTextField.getValue());
}
rm.write("\"");
rm.write("/>");
}
if (this.getInnerTagName) {
// Inner hook
if (this.renderInnerContent) {
this.renderInnerContent(rm, oTextField);
}
rm.write('</' + this.getInnerTagName() + '>');
}
if (bRenderOuter) {
// Outer hook
if (this.renderOuterContent) {
this.renderOuterContent(rm, oTextField);
}
rm.write("</div>");
}
};
TextFieldRenderer.renderStyles = function(rm, oTextField) {
rm.addClass('sapUiTfBrd');
if (oTextField.getEnabled()) {
if (!oTextField.getEditable()) {
rm.addClass("sapUiTfRo");
} else {
rm.addClass("sapUiTfStd");
}
} else {
rm.addClass("sapUiTfDsbl");
}
switch (oTextField.getValueState()) {
case (ValueState.Error) :
rm.addClass('sapUiTfErr');
break;
case (ValueState.Success) :
rm.addClass('sapUiTfSucc');
break;
case (ValueState.Warning) :
rm.addClass('sapUiTfWarn');
break;
// no default
}
if (oTextField.getRequired()) {
rm.addClass('sapUiTfReq');
}
if (oTextField.getPlaceholder() && !Device.support.input.placeholder) {
rm.addClass('sapUiTfPlace');
}
};
TextFieldRenderer.onfocus = function(oTextField) {
var oTfRef = oTextField.$();
var oTfRefInput;
oTfRef.addClass("sapUiTfFoc");
if (!Device.support.input.placeholder && !oTextField.getValue() && oTextField.getPlaceholder()) {
if (oTextField._getRenderOuter()) {
oTfRefInput = oTextField.$("input");
} else {
oTfRefInput = oTfRef;
}
oTfRef.removeClass("sapUiTfPlace");
oTfRefInput.val("");
}
};
TextFieldRenderer.onblur = function(oTextField) {
var oTfRef = oTextField.$();
var oTfRefInput;
oTfRef.removeClass("sapUiTfFoc");
var sPlaceholder = oTextField.getPlaceholder();
if (!Device.support.input.placeholder) {
if (oTextField._getRenderOuter()) {
oTfRefInput = oTextField.$("input");
} else {
oTfRefInput = oTfRef;
}
if (!oTfRefInput.val() && sPlaceholder) {
oTfRef.addClass("sapUiTfPlace");
if (this.convertPlaceholder) {
sPlaceholder = this.convertPlaceholder(oTextField);
}
oTfRefInput.val(sPlaceholder);
}
}
};
TextFieldRenderer.setValueState = function(oTextField, oldValueState, newValueState) {
var oTfRef = oTextField.$();
var oTfRefInput;
var bRenderOuter = oTextField._getRenderOuter();
if (bRenderOuter) {
// aria attribute must be on inner tag
oTfRefInput = oTextField.$("input");
} else {
oTfRefInput = oTfRef;
}
// Remove old value state
switch (oldValueState) {
case (ValueState.Error) :
oTfRef.removeClass('sapUiTfErr');
oTfRefInput.removeAttr('aria-invalid');
break;
case (ValueState.Success) :
oTfRef.removeClass('sapUiTfSucc');
break;
case (ValueState.Warning) :
oTfRef.removeClass('sapUiTfWarn');
break;
// no default
}
// Set new value state
switch (newValueState) {
case (ValueState.Error) :
oTfRef.addClass('sapUiTfErr');
oTfRefInput.attr('aria-invalid',true);
break;
case (ValueState.Success) :
oTfRef.addClass('sapUiTfSucc');
break;
case (ValueState.Warning) :
oTfRef.addClass('sapUiTfWarn');
break;
// no default
}
var tooltip = ValueStateSupport.enrichTooltip(oTextField, oTextField.getTooltip_AsString());
if (tooltip) {
oTfRef.attr('title', tooltip);
if (bRenderOuter) {
oTextField.$("input").attr('title', tooltip);
}
} else {
oTfRef.removeAttr('title');
if (bRenderOuter) {
oTextField.$("input").removeAttr('title');
}
}
};
TextFieldRenderer.setEditable = function(oTextField, bEditable) {
if (!oTextField.getEnabled()) {
// if disabled -> nothing to do
return;
}
var oTfRef = oTextField.$();
var oTfRefInput;
if (oTextField._getRenderOuter()) {
// Readonly attribute must be on inner tag
oTfRefInput = oTextField.$("input");
} else {
oTfRefInput = oTfRef;
}
if (bEditable) {
oTfRef.removeClass('sapUiTfRo').addClass('sapUiTfStd');
oTfRefInput.removeAttr('readonly');
oTfRefInput.removeAttr('aria-readonly');
} else {
oTfRef.removeClass('sapUiTfStd').addClass('sapUiTfRo');
oTfRefInput.attr('readonly', 'readonly');
oTfRefInput.attr('aria-readonly', true);
}
};
TextFieldRenderer.setEnabled = function(oTextField, bEnabled) {
var oTfRef = oTextField.$();
var oTfRefInput;
if (oTextField._getRenderOuter()) {
// Disabled attribute must be on inner tag
oTfRefInput = oTextField.$("input");
} else {
oTfRefInput = oTfRef;
}
if (bEnabled) {
if (oTextField.getEditable()) {
oTfRef.removeClass('sapUiTfDsbl').addClass('sapUiTfStd').removeAttr('aria-disabled');
oTfRefInput.removeAttr('disabled').removeAttr('aria-disabled').attr( 'tabindex', '0');
} else {
oTfRef.removeClass('sapUiTfDsbl').addClass('sapUiTfRo').removeAttr('aria-disabled');
oTfRefInput.removeAttr('disabled').removeAttr('aria-disabled').attr( 'tabindex', '0').attr( 'readonly', 'readonly').attr('aria-readonly', true);
}
} else {
if (oTextField.getEditable()) {
oTfRef.removeClass('sapUiTfStd').addClass('sapUiTfDsbl').attr('aria-disabled', 'true');
oTfRefInput.attr( 'disabled', 'disabled').attr('aria-disabled', 'true').attr( 'tabindex', '-1');
} else {
oTfRef.removeClass('sapUiTfRo').addClass('sapUiTfDsbl').attr('aria-disabled', 'true');
oTfRefInput.removeAttr('readonly').removeAttr('aria-readonly').attr( 'disabled', 'disabled').attr('aria-disabled', 'true').attr( 'tabindex', '-1');
}
}
};
TextFieldRenderer.removeValidVisualization = function(oTextField) {
var oTfRef = oTextField.$();
if (oTfRef) {
oTfRef.removeClass("sapUiTfSucc");
} else {
setTimeout(function() {
TextFieldRenderer.removeValidVisualization(oTextField);
}, 1000);
}
};
TextFieldRenderer.setDesign = function(oTextField, sDesign) {
oTextField.$().toggleClass('sapUiTfMono', (sDesign == Design.Monospace));
};
TextFieldRenderer.setRequired = function(oTextField, bRequired) {
var oTfRefInput;
if (oTextField._getRenderOuter()) {
// aria attribute must be on inner tag
oTfRefInput = oTextField.$("input");
} else {
oTfRefInput = oTextField.$();
}
oTextField.$().toggleClass('sapUiTfReq', bRequired);
if (bRequired) {
oTfRefInput.attr("aria-required", true);
} else {
oTfRefInput.removeAttr("aria-required");
}
};
TextFieldRenderer.renderARIAInfo = function(rm, oTextField) {
var mProps = {
role: oTextField.getAccessibleRole().toLowerCase(),
multiline: false,
autocomplete: 'none'};
if (oTextField.getValueState() == ValueState.Error) {
mProps["invalid"] = true;
}
rm.writeAccessibilityState(oTextField, mProps);
};
/**
* Dummy inheritance of static methods/functions.
* @see sap.ui.core.Renderer.getTextAlign
* @private
*/
TextFieldRenderer.getTextAlign = Renderer.getTextAlign;
return TextFieldRenderer;
}, /* bExport= */ true);
|
// run command:
// $ node math-tree.js --seneca.print.tree
require('seneca')()
.use('math')
|
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["pages/index/index"],{
/***/ 40:
/*!**********************************************************************************!*\
!*** /Users/anoi/HBuilderProjects/yeti/main.js?{"page":"pages%2Findex%2Findex"} ***!
\**********************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(createPage) {__webpack_require__(/*! uni-pages */ 4);
var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
var _index = _interopRequireDefault(__webpack_require__(/*! ./pages/index/index.vue */ 41));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
createPage(_index.default);
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["createPage"]))
/***/ }),
/***/ 41:
/*!***************************************************************!*\
!*** /Users/anoi/HBuilderProjects/yeti/pages/index/index.vue ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.vue?vue&type=template&id=57280228&scoped=true& */ 42);
/* harmony import */ var _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index.vue?vue&type=script&lang=js& */ 44);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony import */ var _index_vue_vue_type_style_index_0_id_57280228_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index.vue?vue&type=style&index=0&id=57280228&lang=scss&scoped=true& */ 46);
/* harmony import */ var _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 10);
var renderjs
/* normalize component */
var component = Object(_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
_index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
_index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
false,
null,
"57280228",
null,
false,
_index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"],
renderjs
)
component.options.__file = "pages/index/index.vue"
/* harmony default export */ __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ 42:
/*!**********************************************************************************************************!*\
!*** /Users/anoi/HBuilderProjects/yeti/pages/index/index.vue?vue&type=template&id=57280228&scoped=true& ***!
\**********************************************************************************************************/
/*! exports provided: render, staticRenderFns, recyclableRender, components */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=template&id=57280228&scoped=true& */ 43);
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_template_id_57280228_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; });
/***/ }),
/***/ 43:
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!/Users/anoi/HBuilderProjects/yeti/pages/index/index.vue?vue&type=template&id=57280228&scoped=true& ***!
\**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! exports provided: render, staticRenderFns, recyclableRender, components */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
var components
try {
components = {
uButton: function() {
return __webpack_require__.e(/*! import() | uview-ui/components/u-button/u-button */ "uview-ui/components/u-button/u-button").then(__webpack_require__.bind(null, /*! @/uview-ui/components/u-button/u-button.vue */ 56))
},
uLink: function() {
return __webpack_require__.e(/*! import() | uview-ui/components/u-link/u-link */ "uview-ui/components/u-link/u-link").then(__webpack_require__.bind(null, /*! @/uview-ui/components/u-link/u-link.vue */ 63))
}
}
} catch (e) {
if (
e.message.indexOf("Cannot find module") !== -1 &&
e.message.indexOf(".vue") !== -1
) {
console.error(e.message)
console.error("1. 排查组件名称拼写是否正确")
console.error(
"2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"
)
console.error(
"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件"
)
} else {
throw e
}
}
var render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
}
var recyclableRender = false
var staticRenderFns = []
render._withStripped = true
/***/ }),
/***/ 44:
/*!****************************************************************************************!*\
!*** /Users/anoi/HBuilderProjects/yeti/pages/index/index.vue?vue&type=script&lang=js& ***!
\****************************************************************************************/
/*! no static exports found */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=script&lang=js& */ 45);
/* harmony import */ var _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony default export */ __webpack_exports__["default"] = (_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
/***/ }),
/***/ 45:
/*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!/Users/anoi/HBuilderProjects/yeti/pages/index/index.vue?vue&type=script&lang=js& ***!
\***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var _default =
{
data: function data() {
return {
title: 'Hello' };
},
onLoad: function onLoad() {
},
methods: {} };exports.default = _default;
/***/ }),
/***/ 46:
/*!*************************************************************************************************************************!*\
!*** /Users/anoi/HBuilderProjects/yeti/pages/index/index.vue?vue&type=style&index=0&id=57280228&lang=scss&scoped=true& ***!
\*************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_57280228_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src??ref--8-oneOf-1-3!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./index.vue?vue&type=style&index=0&id=57280228&lang=scss&scoped=true& */ 47);
/* harmony import */ var _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_57280228_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_57280228_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_57280228_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_57280228_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony default export */ __webpack_exports__["default"] = (_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_Applications_HBuilderX_app_Contents_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_index_vue_vue_type_style_index_0_id_57280228_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
/***/ }),
/***/ 47:
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!/Users/anoi/HBuilderProjects/yeti/pages/index/index.vue?vue&type=style&index=0&id=57280228&lang=scss&scoped=true& ***!
\***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
if(false) { var cssReload; }
/***/ })
},[[40,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/index/index.js.map
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[299],{3144:function(t,e,n){"use strict";n.r(e),n.d(e,"icon",(function(){return c}));n(12),n(2),n(4),n(9),n(3),n(10);var r=n(0),a=n.n(r);function l(){return(l=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function i(t,e){if(null==t)return{};var n,r,a=function(t,e){if(null==t)return{};var n,r,a={},l=Object.keys(t);for(r=0;r<l.length;r++)n=l[r],e.indexOf(n)>=0||(a[n]=t[n]);return a}(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(r=0;r<l.length;r++)n=l[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}var o=function(t){var e=t.title,n=t.titleId,r=i(t,["title","titleId"]);return a.a.createElement("svg",l({width:16,height:16,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":n},r),e?a.a.createElement("title",{id:n},e):null,a.a.createElement("path",{fillRule:"evenodd",d:"M8 14v-4h1v4h5V5h1v9a1 1 0 01-1 1H2a1 1 0 01-1-1v-2h1v2h6zm4.853-10.146l-2.999 3a1.5 1.5 0 01-2.538 1.568l-2.714.904L4 9.527a1.5 1.5 0 11-.316-.948L7 7.473a1.5 1.5 0 012.146-1.327l3-3a1.5 1.5 0 11.707.707z"}))},c=o;o.__docgenInfo={description:"",methods:[],displayName:"EuiIconStats"}}}]);
//# sourceMappingURL=icon.stats-js.min.js.map
|
import '../css/epicraft.scss';
import React from "react"
const ComingSoon = () => (
<div className='coming-soon'>
<div className='container'>
<p>A whole new server experience.</p>
<h3>Coming Soon</h3>
</div>
</div>
)
export default ComingSoon;
|
(function($){
var $content_md = $('#div_id_content_md');
var $content_ck = $('#div_id_content_ck');
var $is_markdown = $('input[name=is_markdown]');
var switch_editor = function(is_markdown) {
if (is_markdown) {
$content_md.show();
$content_ck.hide();
} else {
$content_md.hide();
$content_ck.show();
}
}
$is_markdown.on('click', function() {
switch_editor($(this).is(':checked'));
});
switch_editor($is_markdown.is(':checked'));
})(jQuery);
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
var StyledIconBase_1 = require("../../StyledIconBase");
exports.VolumeUp = React.forwardRef(function (props, ref) {
var attrs = {
"fill": "currentColor",
"xmlns": "http://www.w3.org/2000/svg",
};
return (React.createElement(StyledIconBase_1.StyledIconBase, tslib_1.__assign({ iconAttrs: attrs, iconVerticalAlign: "middle", iconViewBox: "0 0 24 24" }, props, { ref: ref }),
React.createElement("path", { d: "M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0014 7.97v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z", key: "k0" }),
React.createElement("path", { fill: "none", d: "M0 0h24v24H0z", key: "k1" })));
});
exports.VolumeUp.displayName = 'VolumeUp';
exports.VolumeUpDimensions = { height: 24, width: 24 };
|
// Dependencies.
import { expect } from 'chai';
// Relative imports.
import {
FETCH_FORMS,
FETCH_FORMS_SUCCESS,
INITIAL_SORT_STATE,
} from '../../constants';
import findVAFormsReducer from '../../reducers/findVAFormsReducer';
describe('Find VA Forms reducer: findVAFormsReducer', () => {
it('returns the default state', () => {
const emptyAction = {};
const result = findVAFormsReducer(undefined, emptyAction);
expect(result).to.be.deep.equal({
error: '',
fetching: false,
page: 1,
query: '',
results: null,
sortByPropertyName: INITIAL_SORT_STATE,
hasOnlyRetiredForms: false,
startIndex: 0,
});
});
it('fetches forms', () => {
const action = { type: FETCH_FORMS, query: 'testing' };
const state = findVAFormsReducer(undefined, action);
expect(state).to.be.deep.equal({
error: '',
fetching: true,
page: 1,
query: 'testing',
results: null,
sortByPropertyName: INITIAL_SORT_STATE,
hasOnlyRetiredForms: false,
startIndex: 0,
});
});
it('receives forms', () => {
const initialState = {
fetching: true,
results: null,
};
const action = {
type: FETCH_FORMS_SUCCESS,
results: [],
hasOnlyRetiredForms: false,
};
const state = findVAFormsReducer(initialState, action);
expect(state.fetching).to.be.false;
expect(state.results).to.be.instanceOf(Array);
});
});
|
module.exports = {
up: (queryInterface, Sequelize) => queryInterface.createTable('Transactions', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER,
},
referenceNo: {
type: Sequelize.STRING,
},
type: {
type: Sequelize.STRING,
},
amount: {
type: Sequelize.DECIMAL,
},
accountNumber: {
type: Sequelize.BIGINT,
allowNull: false,
references: {
model: 'FinAccounts',
key: 'accountNumber',
as: 'accountNumber',
},
},
description: {
type: Sequelize.TEXT,
},
customerId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'Customers',
key: 'id',
as: 'customerId',
},
},
staffId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'Staffs',
key: 'id',
as: 'staffId',
},
},
createdAt: {
allowNull: false,
type: Sequelize.DATE,
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE,
},
}),
down: queryInterface => queryInterface.dropTable('Transactions'),
};
|
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var moment = require('moment');
var _ = require('lodash');
var TransactionSchema = new Schema({
//fileUrl: String
name: {type: String, required: true},
memo: String,
transactionDate: {type: Date, required: true },
amount: {type: Number, required: true, min: 0.00}
});
var BudgetCategorySchema = new Schema({
name: {type: String, required: true },
description: String,
expense: {type: Boolean, required: true, default: true },
amount: {type: Number, required: true, min: 0.00 },
transactionSummary: {type: Number, default: 0.00},
transactions: [TransactionSchema]
});
BudgetCategorySchema.pre('save', function(next) {
this.transactionSummary = this.transactions.map(function(trans) {
return trans.amount
}).reduce(function(previousValue, currentValue) {
return previousValue + currentValue
},0);
next();
});
var BudgetSchema = new Schema({
name: {type: String, required: true },
budgetDate: {type: Date, required: true},
budgetEndDate: {type: Date },
description: String,
cashFlow: {type: Number, default: 0.00},
budgetCategories: [BudgetCategorySchema]
});
var BudgetCategory = mongoose.model('BudgetCategory', BudgetCategorySchema);
var Transaction = mongoose.model('Transaction', TransactionSchema);
function expense(budgetCategory) {
if(budgetCategory.expense) {
return budgetCategory
}
}
function income(budgetCategory) {
if(!budgetCategory.expense) {
return budgetCategory
}
}
BudgetSchema.statics.findByDate = function(date, cb) {
this.findOne({ "budgetDate": {'$lte': date}, "budgetEndDate": {'$gt': date}}, function(err, doc) {
cb(err, doc);
});
};
BudgetSchema.statics.uniqueBudgetCategories = function(cb) {
this.find({}, function(err, budgets) {
var list = _.uniq(_.flatten(_.map(budgets, function(o) { return _.map(o.budgetCategories, function(bc) { return {name: bc.name, expense: bc.expense}}) })), 'name');
cb(err, list);
});
};
BudgetSchema.statics.allTransactions = function(cb) {
this.find({}, function(err, budgets) {
transactions = _.flattenDeep(_.map(budgets, function(budget) {return _.map(budget.budgetCategories, function(cat) {return cat.transactions})}));
cb(err, transactions);
});
};
BudgetSchema.statics.addTransactionToBudget = function(attr, cb) {
var _this = this;
_this.findByDate(attr.budgetDate, function(error, budget) {
// TODO add in logic to handle no budget found
if (error) {
cb(error);
}
bc = _.find(budget.budgetCategories, {name: attr.categoryName});
if(bc == undefined) {
_this.uniqueBudgetCategories(function(err, bcs) {
if (err)
cb(err);
matchBcs = _.find(bcs, {name: attr.categoryName});
if(matchBcs == undefined) {
budget.budgetCategories.push({name: attr.categoryName, expense: true, amount: 0, transactions: [attr.transaction]});
budget.save(cb);
} else if (Array.isArray(matchBcs)) {
var bc = new BudgetCategory ({name: matchBcs[0].name, expense: matchBcs[0].expense, amount: 0});
var trans = new Transaction(attr.transaction);
bc.transactions.push(trans);
budget.budgetCategories.push(bc);
budget.save(cb);
} else if (typeof matchBcs == 'object') {
var bc = new BudgetCategory ({name: matchBcs.name, expense: matchBcs.expense, amount: 0});
var trans = new Transaction(attr.transaction);
bc.transactions.push(trans);
budget.budgetCategories.push(bc);
budget.save(cb);
} else {
console.log('Well Farts');
}
});
} else if (Array.isArray(bc)) {
bc[0].transactions.push(new Transaction(attr.transaction));
budget.save(cb);
} else if (typeof bc == 'object') {
bc.transactions.push(new Transaction(attr.transaction));
budget.save(cb);
} else {
console.log('Well farts, this sux');
}
});
}
BudgetSchema.pre('save', function(next) {
var self = this;
this.budgetDate = moment(self.budgetDate).startOf('month').toDate();
this.budgetEndDate = moment(self.budgetDate).endOf('month').toDate();
expenseAmount = this.budgetCategories.filter(expense).map(function(budgetCategory) {
return budgetCategory.transactionSummary
}).reduce(function(prev, curr) {
return prev + curr;
},0);
incomeAmount = this.budgetCategories.filter(income).map(function(budgetCategory) {
return budgetCategory.transactionSummary
}).reduce(function(prev, curr) {
return prev + curr;
},0);
this.cashFlow = (incomeAmount - expenseAmount).toFixed(2);
next();
});
module.exports = mongoose.model('Budget', BudgetSchema);
|
import React from "react"
import {
View,
Image,
ImageBackground,
TouchableOpacity,
Text,
Button,
Switch,
TextInput,
StyleSheet,
ScrollView
} from "react-native"
import Icon from "react-native-vector-icons/FontAwesome"
import { CheckBox } from "react-native-elements"
import { connect } from "react-redux"
import {
widthPercentageToDP as wp,
heightPercentageToDP as hp
} from "react-native-responsive-screen"
import { getNavigationScreen } from "@screens"
export class Blank extends React.Component {
constructor(props) {
super(props)
this.state = {}
}
render = () => (
<ScrollView
contentContainerStyle={{ flexGrow: 1 }}
style={styles.ScrollView_1}
>
<View style={styles.View_2} />
<View style={styles.View_397_2105}>
<View style={styles.View_397_2106}>
<View style={styles.View_397_2107} />
</View>
</View>
<View style={styles.View_397_2108}>
<Text style={styles.Text_397_2108}>or</Text>
</View>
<View style={styles.View_397_2109}>
<Text style={styles.Text_397_2109}>Maktoub</Text>
</View>
<View style={styles.View_397_2110}>
<View style={styles.View_397_2111} />
<View style={styles.View_397_2112}>
<Text style={styles.Text_397_2112}>Sign Up</Text>
</View>
<View style={styles.View_397_2113} />
<View style={styles.View_397_2114}>
<Text style={styles.Text_397_2114}>Sign In</Text>
</View>
<View style={styles.View_397_2115} />
</View>
<View style={styles.View_397_2116}>
<View style={styles.View_397_2117} />
<View style={styles.View_397_2118}>
<Text style={styles.Text_397_2118}>Sign Up with Google</Text>
</View>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/8bc4/41a8/395ef30ad9f3a4177a17720addec5d96"
}}
style={styles.ImageBackground_397_2119}
/>
</View>
<View style={styles.View_397_2120}>
<View style={styles.View_397_2121} />
<View style={styles.View_397_2122}>
<Text style={styles.Text_397_2122}>Sign Up with Facebook</Text>
</View>
</View>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/c000/e58d/e065ab69997d57cf01714a28299bc5fa"
}}
style={styles.ImageBackground_397_2123}
/>
<View style={styles.View_397_2125}>
<View style={styles.View_397_2127}>
<View style={styles.View_I397_2127_218_131}>
<View
source={{ uri: "null" }}
style={styles.View_I397_2127_218_132}
/>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/9b4d/439a/ae38e1e86f18911cce04b454b9fea35c"
}}
style={styles.ImageBackground_I397_2127_218_133}
/>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/f1ff/0c22/0b97200050a886088dbee23e6cec4be9"
}}
style={styles.ImageBackground_I397_2127_218_137}
/>
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/b4f8/f1fa/20424ab85cff51d754ab43e303ea9c6d"
}}
style={styles.ImageBackground_I397_2127_218_141}
/>
<View style={styles.View_I397_2127_218_146}>
<View style={styles.View_I397_2127_218_146_218_148}>
<Text style={styles.Text_I397_2127_218_146_218_148}>9:41</Text>
</View>
</View>
</View>
</View>
</View>
<View style={styles.View_397_2128}>
<View style={styles.View_397_2129} />
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/0910/6585/a65cfe0872d472b5c181063b1010fc91"
}}
style={styles.ImageBackground_397_2130}
/>
<View style={styles.View_397_2132}>
<Text style={styles.Text_397_2132}>Username</Text>
</View>
</View>
<View style={styles.View_397_2133}>
<View style={styles.View_397_2134} />
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/e949/3469/c9bb014357e63c24abf23150ab561f25"
}}
style={styles.ImageBackground_397_2135}
/>
<View style={styles.View_397_2137}>
<Text style={styles.Text_397_2137}>Email Adress</Text>
</View>
</View>
<View style={styles.View_397_2138}>
<View style={styles.View_397_2139} />
<ImageBackground
source={{
uri:
"https://s3-us-west-2.amazonaws.com/figma-alpha-api/img/ac23/8762/04aa7af3b5ca20400dcd4a3c424b5e84"
}}
style={styles.ImageBackground_397_2140}
/>
<View style={styles.View_397_2142}>
<Text style={styles.Text_397_2142}>Password</Text>
</View>
</View>
<View style={styles.View_397_2143}>
<View style={styles.View_397_2144} />
<View style={styles.View_397_2145}>
<Text style={styles.Text_397_2145}>Sign Up</Text>
</View>
</View>
</ScrollView>
)
}
const styles = StyleSheet.create({
ScrollView_1: { backgroundColor: "rgba(0, 0, 0, 1)" },
View_2: { height: hp("110.92896174863387%") },
View_397_2105: {
width: wp("100%"),
minWidth: wp("100%"),
height: hp("4.644808743169399%"),
minHeight: hp("4.644808743169399%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("106.28415300546447%")
},
View_397_2106: {
width: wp("100%"),
minWidth: wp("100%"),
height: hp("4.644808743169399%"),
minHeight: hp("4.644808743169399%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("0%"),
backgroundColor: "rgba(0, 0, 0, 0)"
},
View_397_2107: {
width: wp("35.733333333333334%"),
height: hp("0.6830601092896175%"),
minHeight: hp("0.6830601092896175%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("32.266666666666666%"),
top: hp("2.8688524590164093%"),
backgroundColor: "rgba(34, 36, 47, 1)"
},
View_397_2108: {
width: wp("4.533333333333333%"),
minWidth: wp("4.533333333333333%"),
minHeight: hp("3.278688524590164%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("45.33333333333333%"),
top: hp("52.86885245901639%"),
justifyContent: "flex-start"
},
Text_397_2108: {
color: "rgba(124, 130, 161, 1)",
fontSize: 13,
fontWeight: "400",
textAlign: "left",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
View_397_2109: {
width: wp("40.266666666666666%"),
minWidth: wp("40.266666666666666%"),
minHeight: hp("4.371584699453552%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("29.86666666666667%"),
top: hp("10.51912568306011%"),
justifyContent: "flex-start"
},
Text_397_2109: {
color: "rgba(255, 255, 255, 1)",
fontSize: 29,
fontWeight: "400",
textAlign: "left",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
View_397_2110: {
width: wp("91.46666666666667%"),
minWidth: wp("91.46666666666667%"),
height: hp("6.967213114754098%"),
minHeight: hp("6.967213114754098%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("3.4666666666666663%"),
top: hp("19.398907103825135%"),
backgroundColor: "rgba(0, 0, 0, 0)",
overflow: "hidden"
},
View_397_2111: {
width: wp("45.6%"),
height: hp("0.1366120218579235%"),
top: hp("6.284153005464482%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
backgroundColor: "rgba(146, 144, 144, 1)",
borderColor: "rgba(229, 229, 229, 1)",
borderWidth: 7
},
View_397_2112: {
width: wp("30.666666666666664%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("1.3333333333333335%"),
top: hp("0%"),
justifyContent: "flex-start"
},
Text_397_2112: {
color: "rgba(255, 255, 255, 1)",
fontSize: 22,
fontWeight: "700",
textAlign: "left",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
View_397_2113: {
width: wp("0.5333333333333333%"),
height: hp("4.644808743169399%"),
top: hp("0%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
backgroundColor: "rgba(0, 0, 0, 1)"
},
View_397_2114: {
width: wp("26.13333333333333%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("53.33333333333333%"),
top: hp("0%"),
justifyContent: "flex-start"
},
Text_397_2114: {
color: "rgba(255, 255, 255, 1)",
fontSize: 22,
fontWeight: "400",
textAlign: "left",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
View_397_2115: {
width: wp("45.6%"),
height: hp("0.1366120218579235%"),
top: hp("6.284153005464482%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("48.266666666666666%"),
backgroundColor: "rgba(146, 144, 144, 1)",
borderColor: "rgba(146, 144, 144, 1)",
borderWidth: 7
},
View_397_2116: {
width: wp("89.60000000000001%"),
height: hp("7.650273224043716%"),
top: hp("40.7103825136612%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("5.333333333333334%")
},
View_397_2117: {
width: wp("89.60000000000001%"),
height: hp("7.650273224043716%"),
top: hp("0%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
borderColor: "rgba(243, 244, 246, 1)",
borderWidth: 1,
borderTopLeftRadius: 12,
borderTopRightRadius: 12,
borderBottomLeftRadius: 12,
borderBottomRightRadius: 12
},
View_397_2118: {
width: wp("45.33333333333333%"),
top: hp("2.185792349726775%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("22.133333333333333%"),
justifyContent: "flex-start"
},
Text_397_2118: {
color: "rgba(102, 108, 142, 1)",
fontSize: 13,
fontWeight: "600",
textAlign: "center",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
ImageBackground_397_2119: {
width: wp("6.4%"),
height: hp("3.278688524590164%"),
top: hp("2.185792349726775%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("4.266666666666666%"),
resizeMode: "cover"
},
View_397_2120: {
width: wp("89.60000000000001%"),
height: hp("7.650273224043716%"),
top: hp("30.87431693989071%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("5.333333333333334%")
},
View_397_2121: {
width: wp("89.60000000000001%"),
height: hp("7.650273224043716%"),
top: hp("0%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
borderColor: "rgba(243, 244, 246, 1)",
borderWidth: 1,
borderTopLeftRadius: 12,
borderTopRightRadius: 12,
borderBottomLeftRadius: 12,
borderBottomRightRadius: 12
},
View_397_2122: {
width: wp("51.2%"),
top: hp("2.185792349726775%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("20.799999999999997%"),
justifyContent: "flex-start"
},
Text_397_2122: {
color: "rgba(102, 108, 142, 1)",
fontSize: 13,
fontWeight: "600",
textAlign: "center",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
ImageBackground_397_2123: {
width: wp("6.4%"),
height: hp("3.278688524590164%"),
top: hp("33.060109289617486%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("9.6%")
},
View_397_2125: {
width: wp("100%"),
height: hp("6.0109289617486334%"),
top: hp("0%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0.26666666666666666%")
},
View_397_2127: {
width: wp("100%"),
height: hp("6.0109289617486334%"),
top: hp("0%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
backgroundColor: "rgba(0, 0, 0, 0)"
},
View_I397_2127_218_131: {
flexGrow: 1,
width: wp("100%"),
height: hp("6.0109289617486334%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("0%")
},
View_I397_2127_218_132: {
width: wp("100%"),
height: hp("6.0109289617486334%"),
top: hp("0%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%")
},
ImageBackground_I397_2127_218_133: {
width: wp("6.487476603190104%"),
height: hp("1.5482695376286741%"),
top: hp("2.367943101893357%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("89.6%")
},
ImageBackground_I397_2127_218_137: {
width: wp("4.072633616129558%"),
height: hp("1.49802888026003%"),
top: hp("2.3675803929730193%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("84.18502604166667%")
},
ImageBackground_I397_2127_218_141: {
width: wp("4.533333333333333%"),
height: hp("1.4571949432456428%"),
top: hp("2.413477663133965%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("78.31110026041667%")
},
View_I397_2127_218_146: {
width: wp("14.399999999999999%"),
minWidth: wp("14.399999999999999%"),
height: hp("2.8688524590163933%"),
top: hp("1.7759562841530054%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("5.6%"),
backgroundColor: "rgba(0, 0, 0, 0)"
},
View_I397_2127_218_146_218_148: {
flexGrow: 1,
width: wp("14.399999999999999%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("0.4098360655737707%"),
justifyContent: "flex-start"
},
Text_I397_2127_218_146_218_148: {
color: "rgba(255, 255, 255, 1)",
fontSize: 11,
fontWeight: "400",
textAlign: "center",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
View_397_2128: {
width: wp("89.60000000000001%"),
minWidth: wp("89.60000000000001%"),
height: hp("7.650273224043716%"),
minHeight: hp("7.650273224043716%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("5.333333333333334%"),
top: hp("58.333333333333336%")
},
View_397_2129: {
width: wp("89.60000000000001%"),
minWidth: wp("89.60000000000001%"),
height: hp("7.650273224043716%"),
minHeight: hp("7.650273224043716%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("0%"),
backgroundColor: "rgba(0, 0, 0, 1)",
borderColor: "rgba(255, 255, 255, 1)",
borderWidth: 1,
borderTopLeftRadius: 12,
borderTopRightRadius: 12,
borderBottomLeftRadius: 12,
borderBottomRightRadius: 12
},
ImageBackground_397_2130: {
width: wp("6.4%"),
height: hp("3.278688524590164%"),
top: hp("2.1857923497267677%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("4.266666666666666%")
},
View_397_2132: {
width: wp("22.400000000000002%"),
minWidth: wp("22.400000000000002%"),
minHeight: hp("3.278688524590164%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("17.06666666666667%"),
top: hp("2.1857923497267677%"),
justifyContent: "flex-start"
},
Text_397_2132: {
color: "rgba(124, 130, 161, 1)",
fontSize: 13,
fontWeight: "400",
textAlign: "left",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
View_397_2133: {
width: wp("89.60000000000001%"),
minWidth: wp("89.60000000000001%"),
height: hp("7.650273224043716%"),
minHeight: hp("7.650273224043716%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("5.333333333333334%"),
top: hp("67.4863387978142%")
},
View_397_2134: {
width: wp("89.60000000000001%"),
minWidth: wp("89.60000000000001%"),
height: hp("7.650273224043716%"),
minHeight: hp("7.650273224043716%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("0%"),
backgroundColor: "rgba(0, 0, 0, 1)",
borderColor: "rgba(255, 255, 255, 1)",
borderWidth: 1,
borderTopLeftRadius: 12,
borderTopRightRadius: 12,
borderBottomLeftRadius: 12,
borderBottomRightRadius: 12
},
ImageBackground_397_2135: {
width: wp("6.4%"),
height: hp("3.278688524590164%"),
top: hp("2.185792349726782%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("4.266666666666666%")
},
View_397_2137: {
width: wp("28.53333333333333%"),
minWidth: wp("28.53333333333333%"),
minHeight: hp("3.278688524590164%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("17.06666666666667%"),
top: hp("2.185792349726782%"),
justifyContent: "flex-start"
},
Text_397_2137: {
color: "rgba(124, 130, 161, 1)",
fontSize: 13,
fontWeight: "600",
textAlign: "left",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
View_397_2138: {
width: wp("89.60000000000001%"),
minWidth: wp("89.60000000000001%"),
height: hp("7.650273224043716%"),
minHeight: hp("7.650273224043716%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("5.333333333333334%"),
top: hp("77.45901639344262%")
},
View_397_2139: {
width: wp("89.60000000000001%"),
minWidth: wp("89.60000000000001%"),
height: hp("7.650273224043716%"),
minHeight: hp("7.650273224043716%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("0%"),
backgroundColor: "rgba(0, 0, 0, 1)",
borderColor: "rgba(255, 255, 255, 1)",
borderWidth: 1,
borderTopLeftRadius: 12,
borderTopRightRadius: 12,
borderBottomLeftRadius: 12,
borderBottomRightRadius: 12
},
ImageBackground_397_2140: {
width: wp("6.4%"),
height: hp("3.278688524590164%"),
top: hp("2.185792349726782%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("4.266666666666666%")
},
View_397_2142: {
width: wp("21.866666666666667%"),
minWidth: wp("21.866666666666667%"),
minHeight: hp("3.278688524590164%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("17.06666666666667%"),
top: hp("2.185792349726782%"),
justifyContent: "flex-start"
},
Text_397_2142: {
color: "rgba(124, 130, 161, 1)",
fontSize: 13,
fontWeight: "700",
textAlign: "left",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
},
View_397_2143: {
width: wp("89.60000000000001%"),
minWidth: wp("89.60000000000001%"),
height: hp("7.650273224043716%"),
minHeight: hp("7.650273224043716%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("5.333333333333334%"),
top: hp("87.43169398907104%")
},
View_397_2144: {
width: wp("89.60000000000001%"),
minWidth: wp("89.60000000000001%"),
height: hp("7.650273224043716%"),
minHeight: hp("7.650273224043716%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("0%"),
top: hp("0%"),
backgroundColor: "rgba(253, 194, 42, 1)",
borderTopLeftRadius: 12,
borderTopRightRadius: 12,
borderBottomLeftRadius: 12,
borderBottomRightRadius: 12
},
View_397_2145: {
width: wp("16.8%"),
minWidth: wp("16.8%"),
minHeight: hp("3.278688524590164%"),
marginLeft: 0,
marginTop: 0,
position: "absolute",
left: wp("36.53333333333333%"),
top: hp("2.185792349726782%"),
justifyContent: "flex-start"
},
Text_397_2145: {
color: "rgba(255, 255, 255, 1)",
fontSize: 13,
fontWeight: "400",
textAlign: "center",
fontStyle: "normal",
letterSpacing: 0,
textTransform: "none"
}
})
const mapStateToProps = state => {
return {}
}
const mapDispatchToProps = () => {
return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(Blank)
|
'use strict';
const os = require('os');
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const ci = require('ci-info');
const BbPromise = require('bluebird');
const fse = BbPromise.promisifyAll(require('fs-extra'));
const _ = require('lodash');
const fileExistsSync = require('../utils/fs/fileExistsSync');
const writeFileSync = require('../utils/fs/writeFileSync');
const copyDirContentsSync = require('../utils/fs/copyDirContentsSync');
const readFileSync = require('../utils/fs/readFileSync');
const walkDirSync = require('../utils/fs/walkDirSync');
const dirExistsSync = require('../utils/fs/dirExistsSync');
const isDockerContainer = require('is-docker');
const version = require('../../package.json').version;
const segment = require('../utils/segment');
const configUtils = require('../utils/config');
const awsArnRegExs = require('../plugins/aws/utils/arnRegularExpressions');
class Utils {
constructor(serverless) {
this.serverless = serverless;
}
getVersion() {
return version;
}
dirExistsSync(dirPath) {
return dirExistsSync(dirPath);
}
getTmpDirPath() {
const dirPath = path.join(os.tmpdir(),
'tmpdirs-serverless', crypto.randomBytes(8).toString('hex'));
fse.ensureDirSync(dirPath);
return dirPath;
}
fileExistsSync(filePath) {
return fileExistsSync(filePath);
}
writeFileDir(filePath) {
return fse.mkdirsSync(path.dirname(filePath));
}
writeFileSync(filePath, contents, cycles) {
return writeFileSync(filePath, contents, cycles);
}
writeFile(filePath, contents, cycles) {
const that = this;
return new BbPromise((resolve, reject) => {
try {
that.writeFileSync(filePath, contents, cycles);
} catch (e) {
reject(e);
}
resolve();
});
}
appendFileSync(filePath, conts) {
const contents = conts || '';
return new BbPromise((resolve, reject) => {
try {
fs.appendFileSync(filePath, contents);
} catch (e) {
reject(e);
}
resolve();
});
}
readFileSync(filePath) {
return readFileSync(filePath);
}
readFile(filePath) {
const that = this;
let contents;
return new BbPromise((resolve, reject) => {
try {
contents = that.readFileSync(filePath);
} catch (e) {
reject(e);
}
resolve(contents);
});
}
walkDirSync(dirPath) {
return walkDirSync(dirPath);
}
copyDirContentsSync(srcDir, destDir) {
return copyDirContentsSync(srcDir, destDir);
}
generateShortId(length) {
return Math.random().toString(36).substr(2, length);
}
findServicePath(customPath) {
let servicePath = null;
if (customPath) {
if (fileExistsSync(path.join(process.cwd(), customPath))) {
servicePath = process.cwd();
} else {
throw new Error(`Config file ${customPath} not found`);
}
} else if (fileExistsSync(path.join(process.cwd(), 'serverless.yml'))) {
servicePath = process.cwd();
} else if (fileExistsSync(path.join(process.cwd(), 'serverless.yaml'))) {
servicePath = process.cwd();
} else if (fileExistsSync(path.join(process.cwd(), 'serverless.json'))) {
servicePath = process.cwd();
} else if (fileExistsSync(path.join(process.cwd(), 'serverless.js'))) {
servicePath = process.cwd();
}
return servicePath;
}
logStat(serverless, context) {
// the context in which serverless was executed (e.g. "install", "usage", "uninstall", ...)
context = context || 'usage'; //eslint-disable-line
// Service values
const service = serverless.service;
const resources = service.resources;
const provider = service.provider;
const functions = service.functions;
// CLI inputs
const options = serverless.processedInput.options;
const commands = serverless.processedInput.commands;
return new BbPromise((resolve) => {
const config = configUtils.getConfig();
const userId = config.frameworkId;
const trackingDisabled = config.trackingDisabled;
const invocationId = serverless.invocationId;
if (trackingDisabled) {
return resolve();
}
let serviceName = '';
if (service && service.service && service.service.name) {
serviceName = service.service.name;
} else if (service && (typeof service.service === 'string')) {
serviceName = service.service;
}
// filter out the whitelisted options
const whitelistedOptionKeys = ['help', 'disable', 'enable'];
const optionKeys = Object.keys(options);
const filteredOptionKeys = optionKeys.filter((key) =>
whitelistedOptionKeys.indexOf(key) !== -1
);
const filteredOptions = {};
filteredOptionKeys.forEach((key) => {
filteredOptions[key] = options[key];
});
// function related information retrieval
const numberOfFunctions = _.size(functions);
const memorySizeAndTimeoutPerFunction = [];
if (numberOfFunctions) {
_.forEach(functions, (func) => {
const memorySize = Number(func.memorySize)
|| Number(this.serverless.service.provider.memorySize)
|| 1024;
const timeout = Number(func.timeout)
|| Number(this.serverless.service.provider.timeout)
|| 6;
const memorySizeAndTimeoutObject = {
memorySize,
timeout,
};
memorySizeAndTimeoutPerFunction.push(memorySizeAndTimeoutObject);
});
}
// event related information retrieval
const numberOfEventsPerType = [];
const eventNamesPerFunction = [];
let hasIAMAuthorizer = false;
let hasCustomAuthorizer = false;
let hasCognitoAuthorizer = false;
if (numberOfFunctions) {
_.forEach(functions, (func) => {
if (func.events) {
const funcEventsArray = [];
func.events.forEach((event) => {
const name = Object.keys(event)[0];
funcEventsArray.push(name);
const alreadyPresentEvent = _.find(numberOfEventsPerType, { name });
if (alreadyPresentEvent) {
alreadyPresentEvent.count++;
} else {
numberOfEventsPerType.push({
name,
count: 1,
});
}
// For HTTP events, see what authorizer types are enabled
if (_.has(event, 'http.authorizer')) {
if ((_.isString(event.http.authorizer)
&& _.toUpper(event.http.authorizer) === 'AWS_IAM')
|| (event.http.authorizer.type
&& _.toUpper(event.http.authorizer.type) === 'AWS_IAM')) {
hasIAMAuthorizer = true;
}
// There are three ways a user can specify a Custom authorizer:
// 1) By listing the name of a function in the same service OR a function ARN for
// the authorizer property.
// 2) By listing the name of a function in the same service for the name property
// in the authorizer object.
// 3) By listing a function's ARN in the arn property of the authorizer object.
if ((_.isString(event.http.authorizer)
&& _.toUpper(event.http.authorizer) !== 'AWS_IAM'
&& !awsArnRegExs.cognitoIdpArnExpr.test(event.http.authorizer))
|| event.http.authorizer.name
|| (event.http.authorizer.arn
&& awsArnRegExs.lambdaArnExpr.test(event.http.authorizer.arn))) {
hasCustomAuthorizer = true;
}
if ((_.isString(event.http.authorizer)
&& awsArnRegExs.cognitoIdpArnExpr.test(event.http.authorizer))
|| (event.http.authorizer.arn
&& awsArnRegExs.cognitoIdpArnExpr.test(event.http.authorizer.arn))) {
hasCognitoAuthorizer = true;
}
}
});
eventNamesPerFunction.push(funcEventsArray);
}
});
}
let hasCustomResourcesDefined = false;
// check if configuration in resources.Resources is defined
if ((resources && resources.Resources && Object.keys(resources.Resources).length)) {
hasCustomResourcesDefined = true;
}
// check if configuration in resources.Outputs is defined
if ((resources && resources.Outputs && Object.keys(resources.Outputs).length)) {
hasCustomResourcesDefined = true;
}
let hasCustomVariableSyntaxDefined = false;
const defaultVariableSyntax = '\\${([ ~:a-zA-Z0-9._@\'",\\-\\/\\(\\)]+?)}';
// check if the variableSyntax in the provider section is defined
if (provider && provider.variableSyntax
&& provider.variableSyntax !== defaultVariableSyntax) {
hasCustomVariableSyntaxDefined = true;
}
const data = {
userId,
event: 'framework_stat',
properties: {
version: 2,
command: {
name: commands.join(' '),
filteredOptions,
isRunInService: (!!serverless.config.servicePath),
},
service: {
numberOfCustomPlugins: _.size(service.plugins),
hasCustomResourcesDefined,
hasVariablesInCustomSectionDefined: (!!service.custom),
hasCustomVariableSyntaxDefined,
name: serviceName,
},
provider: {
name: provider.name,
runtime: provider.runtime,
stage: provider.stage,
region: provider.region,
},
functions: {
numberOfFunctions,
memorySizeAndTimeoutPerFunction,
},
events: {
numberOfEvents: numberOfEventsPerType.length,
numberOfEventsPerType,
eventNamesPerFunction,
},
general: {
userId,
context,
invocationId,
timestamp: (new Date()).getTime(),
timezone: (new Date()).toString().match(/([A-Z]+[+-][0-9]+)/)[1],
operatingSystem: process.platform,
userAgent: (process.env.SERVERLESS_DASHBOARD) ? 'dashboard' : 'cli',
serverlessVersion: serverless.version,
nodeJsVersion: process.version,
isDockerContainer: isDockerContainer(),
isCISystem: ci.isCI,
ciSystem: ci.name,
},
},
};
if (config.userId && data.properties && data.properties.general) {
// add platformId to segment call
data.properties.general.platformId = config.userId;
}
if (provider && provider.name && provider.name.toUpperCase() === 'AWS' && data.properties) {
data.properties.aws = {
hasIAMAuthorizer,
hasCustomAuthorizer,
hasCognitoAuthorizer,
};
}
return resolve(data);
}).then((data) => {
if (data) {
segment.track(data);
}
});
}
getLocalAccessKey() {
const userConfig = configUtils.getConfig();
const currentId = userConfig.userId;
const globalConfig = configUtils.getGlobalConfig();
const username = _.get(globalConfig, `users[${currentId}].dashboard.username`);
return _.get(globalConfig, `users[${currentId}].dashboard.accessKey`, false) ||
_.get(globalConfig, `users[${currentId}].dashboard.accessKeys[${username}]`, false);
}
isEventUsed(functions, eventName) {
return _.reduce(functions, (accum, func) => {
const events = func.events || [];
if (events.length) {
events.forEach(event => {
if (Object.keys(event)[0] === eventName) {
accum = true; // eslint-disable-line no-param-reassign
}
});
}
return accum;
}, false);
}
}
module.exports = Utils;
|
/*!
Buttons for DataTables 1.6.2
©2016-2020 SpryMedia Ltd - datatables.net/license
*/
(function(e){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(q){return e(q,window,document)}):"object"===typeof exports?module.exports=function(q,r){q||(q=window);if(!r||!r.fn.dataTable)r=require("datatables.net")(q,r).$;return e(r,q,q.document)}:e(jQuery,window,document)})(function(e,q,r,m){function t(a,b,c){e.fn.animate?a.stop().fadeIn(b,c):(a.css("display","block"),c&&c.call(a))}function u(a,b,c){e.fn.animate?a.stop().fadeOut(b,c):(a.css("display","none"),c&&
c.call(a))}function w(a,b){var c=new i.Api(a),d=b?b:c.init().buttons||i.defaults.buttons;return(new l(c,d)).container()}var i=e.fn.dataTable,z=0,A=0,o=i.ext.buttons,l=function(a,b){if(!(this instanceof l))return function(b){return(new l(b,a)).container()};"undefined"===typeof b&&(b={});!0===b&&(b={});e.isArray(b)&&(b={buttons:b});this.c=e.extend(!0,{},l.defaults,b);b.buttons&&(this.c.buttons=b.buttons);this.s={dt:new i.Api(a),buttons:[],listenKeys:"",namespace:"dtb"+z++};this.dom={container:e("<"+
this.c.dom.container.tag+"/>").addClass(this.c.dom.container.className)};this._constructor()};e.extend(l.prototype,{action:function(a,b){var c=this._nodeToButton(a);if(b===m)return c.conf.action;c.conf.action=b;return this},active:function(a,b){var c=this._nodeToButton(a),d=this.c.dom.button.active,c=e(c.node);if(b===m)return c.hasClass(d);c.toggleClass(d,b===m?!0:b);return this},add:function(a,b){var c=this.s.buttons;if("string"===typeof b){for(var d=b.split("-"),e=this.s,c=0,f=d.length-1;c<f;c++)e=
e.buttons[1*d[c]];c=e.buttons;b=1*d[d.length-1]}this._expandButton(c,a,e!==m,b);this._draw();return this},container:function(){return this.dom.container},disable:function(a){a=this._nodeToButton(a);e(a.node).addClass(this.c.dom.button.disabled).attr("disabled",!0);return this},destroy:function(){e("body").off("keyup."+this.s.namespace);var a=this.s.buttons.slice(),b,c;b=0;for(c=a.length;b<c;b++)this.remove(a[b].node);this.dom.container.remove();a=this.s.dt.settings()[0];b=0;for(c=a.length;b<c;b++)if(a.inst===
this){a.splice(b,1);break}return this},enable:function(a,b){if(!1===b)return this.disable(a);var c=this._nodeToButton(a);e(c.node).removeClass(this.c.dom.button.disabled).removeAttr("disabled");return this},name:function(){return this.c.name},node:function(a){if(!a)return this.dom.container;a=this._nodeToButton(a);return e(a.node)},processing:function(a,b){var c=this.s.dt,d=this._nodeToButton(a);if(b===m)return e(d.node).hasClass("processing");e(d.node).toggleClass("processing",b);e(c.table().node()).triggerHandler("buttons-processing.dt",
[b,c.button(a),c,e(a),d.conf]);return this},remove:function(a){var b=this._nodeToButton(a),c=this._nodeToHost(a),d=this.s.dt;if(b.buttons.length)for(var g=b.buttons.length-1;0<=g;g--)this.remove(b.buttons[g].node);b.conf.destroy&&b.conf.destroy.call(d.button(a),d,e(a),b.conf);this._removeKey(b.conf);e(b.node).remove();a=e.inArray(b,c);c.splice(a,1);return this},text:function(a,b){var c=this._nodeToButton(a),d=this.c.dom.collection.buttonLiner,d=c.inCollection&&d&&d.tag?d.tag:this.c.dom.buttonLiner.tag,
g=this.s.dt,f=e(c.node),h=function(a){return"function"===typeof a?a(g,f,c.conf):a};if(b===m)return h(c.conf.text);c.conf.text=b;d?f.children(d).html(h(b)):f.html(h(b));return this},_constructor:function(){var a=this,b=this.s.dt,c=b.settings()[0],d=this.c.buttons;c._buttons||(c._buttons=[]);c._buttons.push({inst:this,name:this.c.name});for(var g=0,f=d.length;g<f;g++)this.add(d[g]);b.on("destroy",function(b,d){d===c&&a.destroy()});e("body").on("keyup."+this.s.namespace,function(b){if(!r.activeElement||
r.activeElement===r.body){var c=String.fromCharCode(b.keyCode).toLowerCase();a.s.listenKeys.toLowerCase().indexOf(c)!==-1&&a._keypress(c,b)}})},_addKey:function(a){a.key&&(this.s.listenKeys+=e.isPlainObject(a.key)?a.key.key:a.key)},_draw:function(a,b){a||(a=this.dom.container,b=this.s.buttons);a.children().detach();for(var c=0,d=b.length;c<d;c++)a.append(b[c].inserter),a.append(" "),b[c].buttons&&b[c].buttons.length&&this._draw(b[c].collection,b[c].buttons)},_expandButton:function(a,b,c,d){for(var g=
this.s.dt,f=0,b=!e.isArray(b)?[b]:b,h=0,k=b.length;h<k;h++){var p=this._resolveExtends(b[h]);if(p)if(e.isArray(p))this._expandButton(a,p,c,d);else{var j=this._buildButton(p,c);j&&(d!==m&&null!==d?(a.splice(d,0,j),d++):a.push(j),j.conf.buttons&&(j.collection=e("<"+this.c.dom.collection.tag+"/>"),j.conf._collection=j.collection,this._expandButton(j.buttons,j.conf.buttons,!0,d)),p.init&&p.init.call(g.button(j.node),g,e(j.node),p),f++)}}},_buildButton:function(a,b){var c=this.c.dom.button,d=this.c.dom.buttonLiner,
g=this.c.dom.collection,f=this.s.dt,h=function(b){return"function"===typeof b?b(f,j,a):b};b&&g.button&&(c=g.button);b&&g.buttonLiner&&(d=g.buttonLiner);if(a.available&&!a.available(f,a))return!1;var k=function(a,b,c,d){d.action.call(b.button(c),a,b,c,d);e(b.table().node()).triggerHandler("buttons-action.dt",[b.button(c),b,c,d])},g=a.tag||c.tag,p=a.clickBlurs===m?!0:a.clickBlurs,j=e("<"+g+"/>").addClass(c.className).attr("tabindex",this.s.dt.settings()[0].iTabIndex).attr("aria-controls",this.s.dt.table().node().id).on("click.dtb",
function(b){b.preventDefault();!j.hasClass(c.disabled)&&a.action&&k(b,f,j,a);p&&j.trigger("blur")}).on("keyup.dtb",function(b){b.keyCode===13&&!j.hasClass(c.disabled)&&a.action&&k(b,f,j,a)});"a"===g.toLowerCase()&&j.attr("href","#");"button"===g.toLowerCase()&&j.attr("type","button");d.tag?(g=e("<"+d.tag+"/>").html(h(a.text)).addClass(d.className),"a"===d.tag.toLowerCase()&&g.attr("href","#"),j.append(g)):j.html(h(a.text));!1===a.enabled&&j.addClass(c.disabled);a.className&&j.addClass(a.className);
a.titleAttr&&j.attr("title",h(a.titleAttr));a.attr&&j.attr(a.attr);a.namespace||(a.namespace=".dt-button-"+A++);d=(d=this.c.dom.buttonContainer)&&d.tag?e("<"+d.tag+"/>").addClass(d.className).append(j):j;this._addKey(a);this.c.buttonCreated&&(d=this.c.buttonCreated(a,d));return{conf:a,node:j.get(0),inserter:d,buttons:[],inCollection:b,collection:null}},_nodeToButton:function(a,b){b||(b=this.s.buttons);for(var c=0,d=b.length;c<d;c++){if(b[c].node===a)return b[c];if(b[c].buttons.length){var e=this._nodeToButton(a,
b[c].buttons);if(e)return e}}},_nodeToHost:function(a,b){b||(b=this.s.buttons);for(var c=0,d=b.length;c<d;c++){if(b[c].node===a)return b;if(b[c].buttons.length){var e=this._nodeToHost(a,b[c].buttons);if(e)return e}}},_keypress:function(a,b){if(!b._buttonsHandled){var c=function(d){for(var g=0,f=d.length;g<f;g++){var h=d[g].conf,k=d[g].node;if(h.key)if(h.key===a)b._buttonsHandled=!0,e(k).click();else if(e.isPlainObject(h.key)&&h.key.key===a&&(!h.key.shiftKey||b.shiftKey))if(!h.key.altKey||b.altKey)if(!h.key.ctrlKey||
b.ctrlKey)if(!h.key.metaKey||b.metaKey)b._buttonsHandled=!0,e(k).click();d[g].buttons.length&&c(d[g].buttons)}};c(this.s.buttons)}},_removeKey:function(a){if(a.key){var b=e.isPlainObject(a.key)?a.key.key:a.key,a=this.s.listenKeys.split(""),b=e.inArray(b,a);a.splice(b,1);this.s.listenKeys=a.join("")}},_resolveExtends:function(a){for(var b=this.s.dt,c,d,g=function(c){for(var d=0;!e.isPlainObject(c)&&!e.isArray(c);){if(c===m)return;if("function"===typeof c){if(c=c(b,a),!c)return!1}else if("string"===
typeof c){if(!o[c])throw"Unknown button type: "+c;c=o[c]}d++;if(30<d)throw"Buttons: Too many iterations";}return e.isArray(c)?c:e.extend({},c)},a=g(a);a&&a.extend;){if(!o[a.extend])throw"Cannot extend unknown button type: "+a.extend;var f=g(o[a.extend]);if(e.isArray(f))return f;if(!f)return!1;c=f.className;a=e.extend({},f,a);c&&a.className!==c&&(a.className=c+" "+a.className);var h=a.postfixButtons;if(h){a.buttons||(a.buttons=[]);c=0;for(d=h.length;c<d;c++)a.buttons.push(h[c]);a.postfixButtons=null}if(h=
a.prefixButtons){a.buttons||(a.buttons=[]);c=0;for(d=h.length;c<d;c++)a.buttons.splice(c,0,h[c]);a.prefixButtons=null}a.extend=f.extend}return a},_popover:function(a,b,c){var d=this.c,g=e.extend({align:"button-left",autoClose:!1,background:!0,backgroundClassName:"dt-button-background",contentClassName:d.dom.collection.className,collectionLayout:"",collectionTitle:"",dropup:!1,fade:400,rightAlignClassName:"dt-button-right",tag:d.dom.collection.tag},c),f=b.node(),h=function(){u(e(".dt-button-collection"),
g.fade,function(){e(this).detach()});e(b.buttons('[aria-haspopup="true"][aria-expanded="true"]').nodes()).attr("aria-expanded","false");e("div.dt-button-background").off("click.dtb-collection");l.background(!1,g.backgroundClassName,g.fade,f);e("body").off(".dtb-collection");b.off("buttons-action.b-internal")};!1===a&&h();c=e(b.buttons('[aria-haspopup="true"][aria-expanded="true"]').nodes());c.length&&(f=c.eq(0),h());c=e("<div/>").addClass("dt-button-collection").addClass(g.collectionLayout).css("display",
"none");a=e(a).addClass(g.contentClassName).attr("role","menu").appendTo(c);f.attr("aria-expanded","true");f.parents("body")[0]!==r.body&&(f=r.body.lastChild);g.collectionTitle&&c.prepend('<div class="dt-button-collection-title">'+g.collectionTitle+"</div>");t(c.insertAfter(f));var k=e(b.table().container()),d=c.css("position");"dt-container"===g.align&&(f=f.parent(),c.css("width",k.width()));if("absolute"===d){d=f.position();c.css({top:d.top+f.outerHeight(),left:d.left});var p=c.outerHeight();c.outerWidth();
var j=k.offset().top+k.height(),j=d.top+f.outerHeight()+p-j,n=d.top-p,i=k.offset().top,d=d.top-p-5;(j>i-n||g.dropup)&&-d<i&&c.css("top",d);d=k.offset().left;k=k.width();k=d+k;p=c.offset().left;j=c.width();j=p+j;n=f.offset().left;i=f.outerWidth();i=n+i;n=0;c.hasClass(g.rightAlignClassName)||"button-right"===g.align?(n=i-j,d>p+n&&(d-=p+n,k-=j+n,n=d>k?n+k:n+d)):(n=d-p,k<j+n&&(d-=p+n,k-=j+n,n=d>k?n+k:n+d));c.css("left",c.position().left+n)}else d=c.height()/2,d>e(q).height()/2&&(d=e(q).height()/2),c.css("marginTop",
-1*d);g.background&&l.background(!0,g.backgroundClassName,g.fade,f);e("div.dt-button-background").on("click.dtb-collection",function(){});e("body").on("click.dtb-collection",function(b){var c=e.fn.addBack?"addBack":"andSelf";e(b.target).parents()[c]().filter(a).length||h()}).on("keyup.dtb-collection",function(a){a.keyCode===27&&h()});g.autoClose&&setTimeout(function(){b.on("buttons-action.b-internal",function(a,b,c,d){d[0]!==f[0]&&h()})},0);e(c).trigger("buttons-popover.dt")}});l.background=function(a,
b,c,d){c===m&&(c=400);d||(d=r.body);a?t(e("<div/>").addClass(b).css("display","none").insertAfter(d),c):u(e("div."+b),c,function(){e(this).removeClass(b).remove()})};l.instanceSelector=function(a,b){if(a===m||null===a)return e.map(b,function(a){return a.inst});var c=[],d=e.map(b,function(a){return a.name}),g=function(a){if(e.isArray(a))for(var h=0,k=a.length;h<k;h++)g(a[h]);else"string"===typeof a?-1!==a.indexOf(",")?g(a.split(",")):(a=e.inArray(e.trim(a),d),-1!==a&&c.push(b[a].inst)):"number"===
typeof a&&c.push(b[a].inst)};g(a);return c};l.buttonSelector=function(a,b){for(var c=[],d=function(a,b,c){for(var e,g,f=0,h=b.length;f<h;f++)if(e=b[f])g=c!==m?c+f:f+"",a.push({node:e.node,name:e.conf.name,idx:g}),e.buttons&&d(a,e.buttons,g+"-")},g=function(a,b){var f,h,i=[];d(i,b.s.buttons);f=e.map(i,function(a){return a.node});if(e.isArray(a)||a instanceof e){f=0;for(h=a.length;f<h;f++)g(a[f],b)}else if(null===a||a===m||"*"===a){f=0;for(h=i.length;f<h;f++)c.push({inst:b,node:i[f].node})}else if("number"===
typeof a)c.push({inst:b,node:b.s.buttons[a].node});else if("string"===typeof a)if(-1!==a.indexOf(",")){i=a.split(",");f=0;for(h=i.length;f<h;f++)g(e.trim(i[f]),b)}else if(a.match(/^\d+(\-\d+)*$/))f=e.map(i,function(a){return a.idx}),c.push({inst:b,node:i[e.inArray(a,f)].node});else if(-1!==a.indexOf(":name")){var l=a.replace(":name","");f=0;for(h=i.length;f<h;f++)i[f].name===l&&c.push({inst:b,node:i[f].node})}else e(f).filter(a).each(function(){c.push({inst:b,node:this})});else"object"===typeof a&&
a.nodeName&&(i=e.inArray(a,f),-1!==i&&c.push({inst:b,node:f[i]}))},f=0,h=a.length;f<h;f++)g(b,a[f]);return c};l.defaults={buttons:["copy","excel","csv","pdf","print"],name:"main",tabIndex:0,dom:{container:{tag:"div",className:"dt-buttons"},collection:{tag:"div",className:""},button:{tag:"ActiveXObject"in q?"a":"button",className:"dt-button",active:"active",disabled:"disabled"},buttonLiner:{tag:"span",className:""}}};l.version="1.6.2";e.extend(o,{collection:{text:function(a){return a.i18n("buttons.collection",
"Collection")},className:"buttons-collection",init:function(a,b){b.attr("aria-expanded",!1)},action:function(a,b,c,d){a.stopPropagation();d._collection.parents("body").length?this.popover(!1,d):this.popover(d._collection,d)},attr:{"aria-haspopup":!0}},copy:function(a,b){if(o.copyHtml5)return"copyHtml5";if(o.copyFlash&&o.copyFlash.available(a,b))return"copyFlash"},csv:function(a,b){if(o.csvHtml5&&o.csvHtml5.available(a,b))return"csvHtml5";if(o.csvFlash&&o.csvFlash.available(a,b))return"csvFlash"},
excel:function(a,b){if(o.excelHtml5&&o.excelHtml5.available(a,b))return"excelHtml5";if(o.excelFlash&&o.excelFlash.available(a,b))return"excelFlash"},pdf:function(a,b){if(o.pdfHtml5&&o.pdfHtml5.available(a,b))return"pdfHtml5";if(o.pdfFlash&&o.pdfFlash.available(a,b))return"pdfFlash"},pageLength:function(a){var a=a.settings()[0].aLengthMenu,b=e.isArray(a[0])?a[0]:a,c=e.isArray(a[0])?a[1]:a;return{extend:"collection",text:function(a){return a.i18n("buttons.pageLength",{"-1":"Show all rows",_:"Show %d rows"},
a.page.len())},className:"buttons-page-length",autoClose:!0,buttons:e.map(b,function(a,b){return{text:c[b],className:"button-page-length",action:function(b,c){c.page.len(a).draw()},init:function(b,c,e){var g=this,c=function(){g.active(b.page.len()===a)};b.on("length.dt"+e.namespace,c);c()},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}),init:function(a,b,c){var e=this;a.on("length.dt"+c.namespace,function(){e.text(c.text)})},destroy:function(a,b,c){a.off("length.dt"+c.namespace)}}}});i.Api.register("buttons()",
function(a,b){b===m&&(b=a,a=m);this.selector.buttonGroup=a;var c=this.iterator(!0,"table",function(c){if(c._buttons)return l.buttonSelector(l.instanceSelector(a,c._buttons),b)},!0);c._groupSelector=a;return c});i.Api.register("button()",function(a,b){var c=this.buttons(a,b);1<c.length&&c.splice(1,c.length);return c});i.Api.registerPlural("buttons().active()","button().active()",function(a){return a===m?this.map(function(a){return a.inst.active(a.node)}):this.each(function(b){b.inst.active(b.node,
a)})});i.Api.registerPlural("buttons().action()","button().action()",function(a){return a===m?this.map(function(a){return a.inst.action(a.node)}):this.each(function(b){b.inst.action(b.node,a)})});i.Api.register(["buttons().enable()","button().enable()"],function(a){return this.each(function(b){b.inst.enable(b.node,a)})});i.Api.register(["buttons().disable()","button().disable()"],function(){return this.each(function(a){a.inst.disable(a.node)})});i.Api.registerPlural("buttons().nodes()","button().node()",
function(){var a=e();e(this.each(function(b){a=a.add(b.inst.node(b.node))}));return a});i.Api.registerPlural("buttons().processing()","button().processing()",function(a){return a===m?this.map(function(a){return a.inst.processing(a.node)}):this.each(function(b){b.inst.processing(b.node,a)})});i.Api.registerPlural("buttons().text()","button().text()",function(a){return a===m?this.map(function(a){return a.inst.text(a.node)}):this.each(function(b){b.inst.text(b.node,a)})});i.Api.registerPlural("buttons().trigger()",
"button().trigger()",function(){return this.each(function(a){a.inst.node(a.node).trigger("click")})});i.Api.register("button().popover()",function(a,b){return this.map(function(c){return c.inst._popover(a,this.button(this[0].node),b)})});i.Api.register("buttons().containers()",function(){var a=e(),b=this._groupSelector;this.iterator(!0,"table",function(c){if(c._buttons)for(var c=l.instanceSelector(b,c._buttons),d=0,e=c.length;d<e;d++)a=a.add(c[d].container())});return a});i.Api.register("buttons().container()",
function(){return this.containers().eq(0)});i.Api.register("button().add()",function(a,b){var c=this.context;c.length&&(c=l.instanceSelector(this._groupSelector,c[0]._buttons),c.length&&c[0].add(b,a));return this.button(this._groupSelector,a)});i.Api.register("buttons().destroy()",function(){this.pluck("inst").unique().each(function(a){a.destroy()});return this});i.Api.registerPlural("buttons().remove()","buttons().remove()",function(){this.each(function(a){a.inst.remove(a.node)});return this});var s;
i.Api.register("buttons.info()",function(a,b,c){var d=this;if(!1===a)return this.off("destroy.btn-info"),u(e("#datatables_buttons_info"),400,function(){e(this).remove()}),clearTimeout(s),s=null,this;s&&clearTimeout(s);e("#datatables_buttons_info").length&&e("#datatables_buttons_info").remove();t(e('<div id="datatables_buttons_info" class="dt-button-info"/>').html(a?"<h2>"+a+"</h2>":"").append(e("<div/>")["string"===typeof b?"html":"append"](b)).css("display","none").appendTo("body"));c!==m&&0!==c&&
(s=setTimeout(function(){d.buttons.info(!1)},c));this.on("destroy.btn-info",function(){d.buttons.info(!1)});return this});i.Api.register("buttons.exportData()",function(a){if(this.context.length){var b=new i.Api(this.context[0]),c=e.extend(!0,{},{rows:null,columns:"",modifier:{search:"applied",order:"applied"},orthogonal:"display",stripHtml:!0,stripNewlines:!0,decodeEntities:!0,trim:!0,format:{header:function(a){return d(a)},footer:function(a){return d(a)},body:function(a){return d(a)}},customizeData:null},
a),d=function(a){if("string"!==typeof a)return a;a=a.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");a=a.replace(/<!\-\-.*?\-\->/g,"");c.stripHtml&&(a=a.replace(/<[^>]*>/g,""));c.trim&&(a=a.replace(/^\s+|\s+$/g,""));c.stripNewlines&&(a=a.replace(/\n/g," "));c.decodeEntities&&(x.innerHTML=a,a=x.value);return a},a=b.columns(c.columns).indexes().map(function(a){var d=b.column(a).header();return c.format.header(d.innerHTML,a,d)}).toArray(),g=b.table().footer()?b.columns(c.columns).indexes().map(function(a){var d=
b.column(a).footer();return c.format.footer(d?d.innerHTML:"",a,d)}).toArray():null,f=e.extend({},c.modifier);b.select&&"function"===typeof b.select.info&&f.selected===m&&b.rows(c.rows,e.extend({selected:!0},f)).any()&&e.extend(f,{selected:!0});for(var f=b.rows(c.rows,f).indexes().toArray(),h=b.cells(f,c.columns),f=h.render(c.orthogonal).toArray(),h=h.nodes().toArray(),k=a.length,l=[],j=0,n=0,o=0<k?f.length/k:0;n<o;n++){for(var r=[k],q=0;q<k;q++)r[q]=c.format.body(f[j],n,q,h[j]),j++;l[n]=r}a={header:a,
footer:g,body:l};c.customizeData&&c.customizeData(a);return a}});i.Api.register("buttons.exportInfo()",function(a){a||(a={});var b;var c=a;b="*"===c.filename&&"*"!==c.title&&c.title!==m&&null!==c.title&&""!==c.title?c.title:c.filename;"function"===typeof b&&(b=b());b===m||null===b?b=null:(-1!==b.indexOf("*")&&(b=e.trim(b.replace("*",e("head > title").text()))),b=b.replace(/[^a-zA-Z0-9_\u00A1-\uFFFF\.,\-_ !\(\)]/g,""),(c=v(c.extension))||(c=""),b+=c);c=v(a.title);c=null===c?null:-1!==c.indexOf("*")?
c.replace("*",e("head > title").text()||"Exported data"):c;return{filename:b,title:c,messageTop:y(this,a.message||a.messageTop,"top"),messageBottom:y(this,a.messageBottom,"bottom")}});var v=function(a){return null===a||a===m?null:"function"===typeof a?a():a},y=function(a,b,c){b=v(b);if(null===b)return null;a=e("caption",a.table().container()).eq(0);return"*"===b?a.css("caption-side")!==c?null:a.length?a.text():"":b},x=e("<textarea/>")[0];e.fn.dataTable.Buttons=l;e.fn.DataTable.Buttons=l;e(r).on("init.dt plugin-init.dt",
function(a,b){if("dt"===a.namespace){var c=b.oInit.buttons||i.defaults.buttons;c&&!b._buttons&&(new l(b,c)).container()}});i.ext.feature.push({fnInit:w,cFeature:"B"});i.ext.features&&i.ext.features.register("buttons",w);return l});
|
import React from 'react';
import PropTypes from '../prop-types';
import LeftRight from './LeftRight';
import SidebarSection from './SidebarSection';
class EnumSelectorSection extends React.Component {
renderOptions() {
return this.props.options.map((option, index) => {
let { label } = option;
if (this.props.value !== option.value) {
label = (
<a href="#" onClick={() => this.props.onChange(option.value)}>
{option.label}
</a>
);
}
return (
<span key={option.value}>
{index ? ' | ' : ''}
{' '}
{label}
</span>
);
});
}
render() {
return (
<SidebarSection>
<LeftRight>
<div className="mr-2">{this.props.label}</div>
<div>{this.renderOptions()}</div>
</LeftRight>
</SidebarSection>
);
}
}
EnumSelectorSection.propTypes = {
label: PropTypes.string.isRequired,
options: PropTypes.Custom.EnumOptions.isRequired,
value: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired,
};
export default EnumSelectorSection;
|
const logger = store => next => action => {
console.group(action.type);
console.info("dispatching", action);
let result = next(action);
console.log("next state", store.getState());
console.groupEnd(action.type);
return result;
};
export default logger;
|
describe('<md-tabs>', function () {
beforeEach(module('material.components.tabs'));
beforeEach(function () {
jasmine.mockElementFocus(this);
jasmine.addMatchers({
toBeActiveTab: function () {
return {
compare: function (actual, expected) {
var fails = [];
if (!actual.length) {
fails.push('element not found');
} else {
if (!actual.hasClass('md-active')) {
fails.push('does not have active class');
}
if (actual.attr('aria-selected') != 'true') {
fails.push('aria-selected is not true');
}
}
var results = { pass: fails.length === 0 };
var negation = !results.pass ? "" : " not ";
results.message = "";
results.message += "Expected '";
results.message += angular.mock.dump(actual);
results.message += negation + "' to be the active tab. Failures: " + fails.join(', ');
return results;
}
};
}
});
});
function setup (template, scope) {
var el;
inject(function ($compile, $rootScope) {
var newScope = $rootScope.$new();
for (var key in scope || {}) newScope[key] = scope[key];
el = $compile(template)(newScope);
newScope.$apply();
});
return el;
}
function triggerKeydown (el, keyCode) {
return el.triggerHandler({
type: 'keydown',
keyCode: keyCode,
preventDefault: angular.noop
});
}
describe('activating tabs', function () {
it('should have `._md` class indicator', inject(function() {
var tabs = setup(
'<md-tabs> ' +
' <md-tab label="a">a</md-tab>' +
' <md-tab label="b">b</md-tab>' +
'</md-tabs>'
);
expect(tabs.find('md-tabs-content-wrapper').hasClass('_md')).toBe(true);
}));
it('should select first tab by default', function () {
var tabs = setup(
'<md-tabs> ' +
' <md-tab label="a">a</md-tab>' +
' <md-tab label="b">b</md-tab>' +
'</md-tabs>'
);
expect(tabs.find('md-tab-item').eq(0)).toBeActiveTab();
});
it('should select & focus tab on click', inject(function ($document, $rootScope) {
var tabs = setup('<md-tabs>' +
'<md-tab></md-tab>' +
'<md-tab></md-tab>' +
'<md-tab ng-disabled="true"></md-tab>' +
'</md-tabs>');
var tabItems = tabs.find('md-tab-item');
tabs.find('md-tab-item').eq(1).triggerHandler('click');
$rootScope.$apply();
expect(tabItems.eq(1)).toBeActiveTab();
tabs.find('md-tab-item').eq(0).triggerHandler('click');
expect(tabItems.eq(0)).toBeActiveTab();
}));
it('should focus tab on arrow if tab is enabled', inject(function ($document, $mdConstant, $timeout) {
var tabs = setup('<md-tabs>' +
'<md-tab></md-tab>' +
'<md-tab ng-disabled="true"></md-tab>' +
'<md-tab></md-tab>' +
'</md-tabs>');
var tabItems = tabs.find('md-tab-item');
expect(tabItems.eq(0)).toBeActiveTab();
// Boundary case, do nothing
triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.LEFT_ARROW);
expect(tabItems.eq(0)).toBeActiveTab();
// Tab 0 should still be active, but tab 2 focused (skip tab 1 it's disabled)
triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.RIGHT_ARROW);
expect(tabItems.eq(0)).toBeActiveTab();
triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.ENTER);
expect(tabItems.eq(2)).toBeActiveTab();
// Boundary case, do nothing
triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.RIGHT_ARROW);
expect(tabItems.eq(2)).toBeActiveTab();
triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.ENTER);
expect(tabItems.eq(2)).toBeActiveTab();
// Skip tab 1 again, it's disabled
triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.LEFT_ARROW);
triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.ENTER);
expect(tabItems.eq(0)).toBeActiveTab();
}));
it('should select tab on space or enter', inject(function ($mdConstant) {
var tabs = setup('<md-tabs>' +
'<md-tab></md-tab>' +
'<md-tab></md-tab>' +
'</md-tabs>');
var tabItems = tabs.find('md-tab-item');
tabs.find('md-tab-item').eq(0).triggerHandler('click');
triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.RIGHT_ARROW);
triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.ENTER);
expect(tabItems.eq(1)).toBeActiveTab();
triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.LEFT_ARROW);
triggerKeydown(tabs.find('md-tabs-canvas').eq(0), $mdConstant.KEY_CODE.SPACE);
expect(tabItems.eq(0)).toBeActiveTab();
}));
it('should bind to selected', function () {
var tabs = setup('<md-tabs md-selected="current">' +
'<md-tab></md-tab>' +
'<md-tab></md-tab>' +
'<md-tab></md-tab>' +
'</md-tabs>');
var tabItems = tabs.find('md-tab-item');
var dummyTabs = tabs.find('md-dummy-tab');
expect(tabItems.eq(0)).toBeActiveTab();
expect(tabs.scope().current).toBe(0);
expect(dummyTabs.eq(0).attr('aria-selected')).toBe('true');
tabs.scope().$apply('current = 1');
expect(tabItems.eq(1)).toBeActiveTab();
expect(tabItems.eq(0).attr('aria-selected')).toBe('false');
expect(dummyTabs.eq(0).attr('aria-selected')).toBe('false');
expect(dummyTabs.eq(1).attr('aria-selected')).toBe('true');
tabItems.eq(2).triggerHandler('click');
expect(tabs.scope().current).toBe(2);
});
it('disabling active tab', function () {
var tabs = setup('<md-tabs>' +
'<md-tab ng-disabled="disabled0"></md-tab>' +
'<md-tab ng-disabled="disabled1"></md-tab>' +
'</md-tabs>');
var tabItems = tabs.find('md-tab-item');
var dummyTabs = tabs.find('md-dummy-tab');
expect(tabItems.eq(0)).toBeActiveTab();
expect(dummyTabs.eq(0).attr('aria-selected')).toBe('true');
tabs.scope().$apply('disabled0 = true');
expect(tabItems.eq(1)).toBeActiveTab();
expect(tabItems.eq(0).attr('aria-disabled')).toBe('true');
expect(dummyTabs.eq(0).attr('aria-disabled')).toBe('true');
expect(tabItems.eq(1).attr('aria-disabled')).toBe('false');
expect(dummyTabs.eq(1).attr('aria-disabled')).toBe('false');
tabs.scope().$apply('disabled0 = false; disabled1 = true');
expect(tabItems.eq(0)).toBeActiveTab();
expect(tabItems.eq(0).attr('aria-disabled')).toBe('false');
expect(dummyTabs.eq(0).attr('aria-disabled')).toBe('false');
expect(tabItems.eq(1).attr('aria-disabled')).toBe('true');
expect(dummyTabs.eq(1).attr('aria-disabled')).toBe('true');
});
});
describe('tab label & content DOM', function () {
it('should support both label types', function () {
var tabs1 = setup('<md-tabs>' +
'<md-tab label="super label"></md-tab>' +
'</md-tabs>');
expect(tabs1.find('md-tab-item').text()).toBe('super label');
var tabs2 = setup('<md-tabs>' +
'<md-tab><md-tab-label><b>super</b> label</md-tab-label></md-tab>' +
'</md-tabs>');
expect(tabs2.find('md-tab-item').text()).toBe('super label');
});
it('should support content inside with each kind of label', function () {
var tabs1 = setup('<md-tabs>' +
'<md-tab label="label that!"><b>content</b> that!</md-tab>' +
'</md-tabs>');
expect(tabs1.find('md-tab-item').text()).toBe('label that!');
expect(tabs1[ 0 ].querySelector('md-tab-content').textContent.trim()).toBe('content that!');
var tabs2 = setup('<md-tabs>\
<md-tab>\
<md-tab-label>label that!</md-tab-label>\
<md-tab-body><b>content</b> that!</md-tab-body>\
</md-tab>\
</md-tabs>');
expect(tabs1.find('md-tab-item').text()).toBe('label that!');
expect(tabs1[ 0 ].querySelector('md-tab-content').textContent.trim()).toBe('content that!');
});
});
describe('aria', function () {
it('should link tab content to tabItem with auto-generated ids', function () {
var tabs = setup('<md-tabs>' +
'<md-tab label="label!">content!</md-tab>' +
'</md-tabs>');
var tabItem = tabs.find('md-dummy-tab');
var tabContent = angular.element(tabs[ 0 ].querySelector('md-tab-content'));
expect(tabs.find('md-tabs-canvas').attr('role')).toBe('tablist');
expect(tabItem.attr('id')).toBeTruthy();
expect(tabItem.attr('role')).toBe('tab');
expect(tabItem.attr('aria-controls')).toBe(tabContent.attr('id'));
expect(tabContent.attr('id')).toBeTruthy();
expect(tabContent.attr('role')).toBe('tabpanel');
expect(tabContent.attr('aria-labelledby')).toBe(tabItem.attr('id'));
//Unique ids check
expect(tabContent.attr('id')).not.toEqual(tabItem.attr('id'));
});
});
describe('<md-tab>', function () {
it('should use its contents as the label if there is no label attribute or label/body tags', function () {
var tab = setup('<md-tab>test</md-tab>');
expect(tab[ 0 ].tagName).toBe('MD-TAB');
expect(tab.find('md-tab-label').length).toBe(1);
expect(tab.find('md-tab-label').text()).toBe('test');
expect(tab.find('md-tab-body').length).toBe(0);
});
it('should use its contents as the body if there is a label attribute', function () {
var tab = setup('<md-tab label="test">content</md-tab>');
expect(tab[ 0 ].tagName).toBe('MD-TAB');
expect(tab.find('md-tab-label').length).toBe(1);
expect(tab.find('md-tab-body').length).toBe(1);
expect(tab.find('md-tab-label').html()).toBe('test');
expect(tab.find('md-tab-body').html()).toBe('content');
});
it('should convert a label attribute to a label tag', function () {
var tab = setup('<md-tab label="test"><md-tab-body>content</md-tab-body></md-tab>');
expect(tab[ 0 ].tagName).toBe('MD-TAB');
expect(tab.find('md-tab-label').length).toBe(1);
expect(tab.find('md-tab-body').length).toBe(1);
expect(tab.find('md-tab-label').html()).toBe('test');
expect(tab.find('md-tab-body').html()).toBe('content');
});
it('should not insert a body if there is no content', function () {
var tab = setup('<md-tab>' +
'<md-tab-label>test</md-tab-label>' +
'</md-tab>');
expect(tab[ 0 ].tagName).toBe('MD-TAB');
expect(tab.find('md-tab-label').length).toBe(1);
expect(tab.find('md-tab-label').text()).toBe('test');
expect(tab.find('md-tab-body').length).toBe(0);
});
});
describe('internal scope', function () {
it('should have the same internal scope as external', function () {
var template = '\
<md-tabs md-selected="selectedTab">\
<md-tab label="a">\
<md-button ng-click="data = false">Set data to false</md-button>\
</md-tab>\
</md-tabs>\
';
var element = setup(template);
var button = element.find('md-button');
expect(button[ 0 ].tagName).toBe('MD-BUTTON');
button.triggerHandler('click');
expect(element.scope().data).toBe(false);
});
});
describe('no tab selected', function () {
it('should allow cases where no tabs are selected', inject(function () {
var template = '\
<md-tabs md-selected="selectedIndex">\
<md-tab label="a">tab content</md-tab>\
<md-tab label="b">tab content</md-tab>\
</md-tabs>\
';
var element = setup(template, { selectedIndex: -1 });
var scope = element.scope();
expect(scope.selectedIndex).toBe(-1);
expect(element.find('md-tab-item').eq(0).hasClass('md-active')).toBe(false);
expect(element.find('md-tab-item').eq(1).hasClass('md-active')).toBe(false);
expect(element.find('md-tabs-content-wrapper').hasClass('ng-hide')).toBe(true);
element.find('md-tab-item').eq(0).triggerHandler('click');
expect(element.find('md-tab-item').eq(0).hasClass('md-active')).toBe(true);
expect(element.find('md-tab-item').eq(1).hasClass('md-active')).toBe(false);
expect(scope.selectedIndex).toBe(0);
element.find('md-tab-item').eq(1).triggerHandler('click');
expect(element.find('md-tab-item').eq(0).hasClass('md-active')).toBe(false);
expect(element.find('md-tab-item').eq(1).hasClass('md-active')).toBe(true);
expect(scope.selectedIndex).toBe(1);
scope.$apply('selectedIndex = -1');
expect(scope.selectedIndex).toBe(-1);
expect(element.find('md-tab-item').eq(0).hasClass('md-active')).toBe(false);
expect(element.find('md-tab-item').eq(1).hasClass('md-active')).toBe(false);
expect(element.find('md-tabs-content-wrapper').hasClass('ng-hide')).toBe(true);
}));
});
describe('nested tabs', function () {
it('should properly nest tabs', inject(function () {
var template = '' +
'<md-tabs>' +
' <md-tab label="one">' +
' <md-tabs>' +
' <md-tab><md-tab-label>a</md-tab-label></md-tab>' +
' <md-tab><md-tab-label>b</md-tab-label></md-tab>' +
' <md-tab><md-tab-label>c</md-tab-label></md-tab>' +
' </md-tabs>' +
' </md-tab>' +
' <md-tab label="two">two</md-tab>' +
'</md-tabs>';
var element = setup(template);
// first item should be 'one'
expect(element.find('md-tab-item').eq(0).text()).toBe('one');
// first item in nested tabs should be 'a'
expect(element.find('md-tabs').find('md-tab-item').eq(0).text()).toBe('a');
}));
});
describe('md-pagination-wrapper', function () {
var template = '<md-tabs md-stretch-tabs="{{stretch}}">' +
' <md-tab label="label!">content!</md-tab>' +
'</md-tabs>';
it('should have inline width if md-stretch-tabs="never"',
inject(function ($timeout, $document) {
var scope = { 'stretch': 'never' };
var element = setup(template, scope);
// Appending to body is required for style checks
angular.element($document.body).append(element);
// $timeout.flush required to run nextTick inside init();
$timeout.flush();
expect(element.find('md-pagination-wrapper').attr('style').indexOf('width')).toBeGreaterThan(-1);
element.remove();
}));
it('should not have inline width if md-stretch-tabs="always"',
inject(function ($timeout, $document) {
var scope = { 'stretch': 'always' };
var element = setup(template, scope);
// Appending to body is required for style checks
angular.element($document.body).append(element);
// $timeout.flush required to run nextTick inside init();
$timeout.flush();
expect(element.find('md-pagination-wrapper').attr('style').indexOf('width')).toBe(-1);
element.remove();
}));
});
});
|
/*
* Ext JS Library 2.2
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
// some data used in the examples
Ext.namespace('Ext.exampledata');
Ext.exampledata.states = [
['AL', 'Alabama', 'The Heart of Dixie','ALClass'],
['AK', 'Alaska', 'The Land of the Midnight Sun','AKClass'],
['AZ', 'Arizona', 'The Grand Canyon State','AZClass'],
['AR', 'Arkansas', 'The Natural State','ARClass'],
['CA', 'California', 'The Golden State','CAClass'],
['CO', 'Colorado', 'The Mountain State','COClass'],
['CT', 'Connecticut', 'The Constitution State','CTClass'],
['DE', 'Delaware', 'The First State','DEClass'],
['DC', 'District of Columbia', "The Nation's Capital",'DCClass'],
['FL', 'Florida', 'The Sunshine State','FLClass'],
['GA', 'Georgia', 'The Peach State','GAClass'],
['HI', 'Hawaii', 'The Aloha State','HIClass'],
['ID', 'Idaho', 'Famous Potatoes','IDClass'],
['IL', 'Illinois', 'The Prairie State','ILClass'],
['IN', 'Indiana', 'The Hospitality State','INClass'],
['IA', 'Iowa', 'The Corn State','AIClass'],
['KS', 'Kansas', 'The Sunflower State','KSClass'],
['KY', 'Kentucky', 'The Bluegrass State','KYClass'],
['LA', 'Louisiana', 'The Bayou State','LAClass'],
['ME', 'Maine', 'The Pine Tree State','MEClass'],
['MD', 'Maryland', 'Chesapeake State','MDClass'],
['MA', 'Massachusetts', 'The Spirit of America','MAClass'],
['MI', 'Michigan', 'Great Lakes State','MIClass'],
['MN', 'Minnesota', 'North Star State','MNClass'],
['MS', 'Mississippi', 'Magnolia State','MSClass'],
['MO', 'Missouri', 'Show Me State','MOClass'],
['MT', 'Montana', 'Big Sky Country','MTClass'],
['NE', 'Nebraska', 'Beef State','NEClass'],
['NV', 'Nevada', 'Silver State','NVClass'],
['NH', 'New Hampshire', 'Granite State','NHClass'],
['NJ', 'New Jersey', 'Garden State','NJClass'],
['NM', 'New Mexico', 'Land of Enchantment','NMClass'],
['NY', 'New York', 'Empire State','NYClass'],
['NC', 'North Carolina', 'First in Freedom','NCClass'],
['ND', 'North Dakota', 'Peace Garden State','NDClass'],
['OH', 'Ohio', 'The Heart of it All','OHClass'],
['OK', 'Oklahoma', 'Oklahoma is OK','OKClass'],
['OR', 'Oregon', 'Pacific Wonderland','ORClass'],
['PA', 'Pennsylvania', 'Keystone State','PAClass'],
['RI', 'Rhode Island', 'Ocean State','RIClass'],
['SC', 'South Carolina', 'Nothing Could be Finer','SCClass'],
['SD', 'South Dakota', 'Great Faces, Great Places','SDClass'],
['TN', 'Tennessee', 'Volunteer State','TNClass'],
['TX', 'Texas', 'Lone Star State','TXClass'],
['UT', 'Utah', 'Salt Lake State','UTClass'],
['VT', 'Vermont', 'Green Mountain State','VTClass'],
['VA', 'Virginia', 'Mother of States','VAClass'],
['WA', 'Washington', 'Green Tree State','WAClass'],
['WV', 'West Virginia', 'Mountain State','WVClass'],
['WI', 'Wisconsin', "America's Dairyland",'WIClass'],
['WY', 'Wyoming', 'Like No Place on Earth','WYClass']
];
|
export { default } from './lock.container';
|
import * as Engine from "../../../engine/engine.js"
export default class MoleMakerComponent extends Engine.Component {
constructor(gameObject) {
super(gameObject);
this.tick = 0;
}
update() {
let score = this.gameObject.getComponent("ScoreComponent").score;
let screenTextComponent = this.gameObject.getComponent("ScreenTextComponent");
screenTextComponent.string = score;
//Check to see if need to add another mole
if (!Engine.SceneManager.currentScene.getGameObject("ClickToDestroy")) {
this.tick++;
}
if (this.tick > 100) {
console.log("Add another")
this.tick = 0;
Engine.SceneManager.currentScene.instantiate({
prefabName: "ClickToDestroy",
x: 0,
y: 0
})
}
}
}
|
const celeste = document.getElementById('celeste')
const violeta = document.getElementById('violeta')
const naranja = document.getElementById('naranja')
const verde = document.getElementById('verde')
const btnEmpezar = document.getElementById('btnEmpezar')
const ULTIMO_LVL = 15
class Juego {
constructor() {
this.start = this.start.bind(this)
this.start()
this.generarSecuencia()
setTimeout(this.siguienteLevel, 800)
}
start() {
console.log('start');
this.siguienteLevel = this.siguienteLevel.bind(this)
this.elegirColor = this.elegirColor.bind(this)
this.toggleBtnEmpezar()
this.nivel = 1;
this.colores = {
celeste,
violeta,
naranja,
verde
}
}
toggleBtnEmpezar() {
if (btnEmpezar.classList.contains('hide')) {
btnEmpezar.classList.remove('hide')
} else {
btnEmpezar.classList.add('hide')
}
}
generarSecuencia() {
console.log('generar secuencia');
this.secuencia = new Array(ULTIMO_LVL).fill(0).map(n => Math.floor(Math.random() * 4))
}
siguienteLevel() {
console.log('------------------------' + ' nivel ' + this.nivel + ' ------------------------');
this.subnivel = 0
this.iluminarSecuencia()
this.agregarEventosClic()
}
transformarNumero(numero) {
switch (numero) {
case 0:
return 'celeste'
case 1:
return 'violeta'
case 2:
return 'naranja'
case 3:
return 'verde'
}
}
transformarColor(color) {
switch (color) {
case 'celeste':
return 0
case 'violeta':
return 1
case 'naranja':
return 2
case 'verde':
return 3
}
}
iluminarSecuencia() {
for (let i = 0; i < this.nivel; i++) {
const color = this.transformarNumero(this.secuencia[i])
setTimeout(() => {
this.iluminarColor(color)
console.log('iluminar ' + color);
}, 900 * i)
}
}
iluminarColor(color) {
this.colores[color].classList.add('light')
setTimeout(() => this.apagarColor(color), 300)
}
apagarColor(color) {
this.colores[color].classList.remove('light')
}
agregarEventosClic() {
this.colores.celeste.addEventListener('click', this.elegirColor)
this.colores.violeta.addEventListener('click', this.elegirColor)
this.colores.naranja.addEventListener('click', this.elegirColor)
this.colores.verde.addEventListener('click', this.elegirColor)
console.log('add events');
}
eliminarEventosClic() {
this.colores.celeste.removeEventListener('click', this.elegirColor)
this.colores.violeta.removeEventListener('click', this.elegirColor)
this.colores.naranja.removeEventListener('click', this.elegirColor)
this.colores.verde.removeEventListener('click', this.elegirColor)
console.log('remove events');
}
elegirColor(ev) {
const nombreColor = ev.target.dataset.color
const numeroColor = this.transformarColor(nombreColor)
console.log('subnivel ' + this.subnivel);
console.log('seleccion ' + nombreColor);
this.iluminarColor(nombreColor)
if (numeroColor === this.secuencia[this.subnivel]) {
this.subnivel ++
if (this.subnivel === this.nivel) {
this.nivel ++
this.eliminarEventosClic()
if (this.nivel === ULTIMO_LVL) {
this.ganaste()
} else {
// en los setTimeout se llama a la función pero no se invoca, ie m no le pongas los parentecis nunca aqui
setTimeout(this.siguienteLevel, 1100)
console.log('next');
}
}
} else {
this.perdiste()
console.log('perdiste');
}
}
ganaste() {
setTimeout(() => {
swal('Simón dice:', 'Ganaste!!!', 'success', { button: false})
.then(this.start)
}, 800)
}
perdiste() {
setTimeout(() => {swal('Simón dice:', 'Perdiste.', 'error', { button: false})
.then(() => {
this. eliminarEventosClic()
this.start()
})}, 800)
}
}
function empezarJuego() {
// alert('Ya comienza...')
// var juego = new Juego();
window.juego = new Juego();
}
|
const express = require('express');
const routes = require('./routes');
var exphbs = require("express-handlebars");
// import sequelize connection
const app = express();
const PORT = process.env.PORT || 3001;
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(routes);
app.engine("handlebars", exphbs({ defaultLayout: "main" }));
app.set("view engine", "handlebars");
// sync sequelize models to the database, then turn on the server
app.listen(PORT, () => {
console.log(`App listening on port ${PORT}!`);
});
|
var simpl = require('../')
var test = require('tap').test
var server, client, socket
test("start server", function (t) {
t.plan(2)
server = simpl.createServer(8080)
server.use(simpl.uid())
server.use(simpl.events())
server.use(simpl.json())
server.on('ready', function () {
t.pass("server is ready")
})
server.on('listening', function () {
t.pass("server is listening")
})
})
test("start client", function (t) {
t.plan(2)
server.on('connection', function (s) {
t.pass("received connection")
socket = s
})
client = simpl.createClient(8080)
client.use(simpl.uid())
client.use(simpl.events())
client.use(simpl.json())
client.on('connect', function () {
t.pass("client connected")
})
})
test("client emit to server", function (t) {
t.plan(1)
socket.remote.once('hello', function (message) {
t.equal(message, 'world')
})
client.remote.emit('hello', 'world')
})
test("server emit to client", function (t) {
t.plan(1)
client.remote.once('hello', function (message) {
t.equal(message, 'world')
})
socket.remote.emit('hello', 'world')
})
test("close client", function (t) {
t.plan(2)
client.once('disconnect', function () {
t.pass("client disconnected")
})
socket.once('close', function () {
t.pass("socket closed")
})
client.close()
})
test("close server", function (t) {
t.plan(1)
server.once('close', function () {
t.pass("server closed")
})
server.close()
})
|
'use strict';
module.exports = {
CallbackBasedCredentialsProvider: require('./CallbackBasedCredentialsProvider'),
RepositoryBasedCredentialsProvider: require('./RepositoryBasedCredentialsProvider'),
CredentialsProvider: require('./CredentialsProvider')
};
|
require('dotenv').config();
const { notarize } = require('electron-notarize');
exports.default = async function notarizing(context) {
const { electronPlatformName, appOutDir } = context;
if (electronPlatformName !== 'darwin') {
return;
}
const appName = context.packager.appInfo.productFilename;
return await notarize({
appBundleId: 'com.wagerr.electron.app',
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASS,
ascProvider: process.env.APPLE_PROVIDER_SHORT_NAME
});
};
|
const { Model, DataTypes } = require('sequelize');
const {sequelize} = require('./database')
class User extends Model {}
User.init(
{
id : {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
img_url:{
type: DataTypes.STRING,
allowNull:false,
defaultValue:'/default/def.img'
},
username: {
type: DataTypes.STRING,
unique: true,
defaultValue: "@user"+Math.round(Math.random() * 100000),
allowNull: false
},
email:{
type: DataTypes.STRING,
unique:true,
allowNull:false,
},
password:{
type:DataTypes.STRING,
allowNull:false,
}
},
{ sequelize, modelName: 'user' }
);
class UserLink extends Model {}
UserLink.init(
{
id : {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
url: {
type: DataTypes.STRING,
unique: true,
allowNull: false,
},
link_name:{
type: DataTypes.STRING,
unique:false,
allowNull:true,
},
},
{ sequelize, modelName: 'user_link' }
);
class Character extends Model{}
Character.init(
{
id:{
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
name:{
type: DataTypes.STRING,
allowNull: false,
unique:false,
},
avatar:{
type: DataTypes.STRING,
allowNull: false,
},
age:{
type: DataTypes.INTEGER,
allowNull:false,
defaultValue:21,
},
sex:{
type: DataTypes.STRING,
allowNull: false,
defaultValue: "Male",
},
full_name : {
type: DataTypes.STRING,
allowNull: false
},
about:{
type: DataTypes.TEXT,
allowNull: false,
},
likes:{
type: DataTypes.STRING,
allowNull: true,
},
dislikes:{
type: DataTypes.STRING,
allowNull: true,
},
image:{
type: DataTypes.STRING,
allowNull: false,
},
reference:{
type: DataTypes.STRING,
allowNull: true,
},
quote:{
type: DataTypes.STRING,
allowNull:true
}
},
{sequelize, modelName:'character'}
)
class CharacterImage extends Model{}
CharacterImage.init(
{
id:{
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
img_name:{
type: DataTypes.STRING,
allowNull: false,
defaultValue: "image"+this.id,
},
img_url: {
type: DataTypes.STRING,
allowNull: true,
},
},
{sequelize, modelName:'character_image'}
)
class Test extends Model {}
Test.init(
{
id : {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
word: {
type: DataTypes.STRING,
unique: true,
allowNull: false,
},
text:{
type: DataTypes.STRING,
unique:false,
allowNull:true,
},
},
{ sequelize, modelName: 'test' }
);
User.hasMany(UserLink, {onDelete: "cascade"});
User.hasMany(Character, {onDelete: "cascade"});
Character.hasMany(CharacterImage, {onDelete:"cascade"});
module.exports = {
User,
UserLink,
Character,
Test,
}
|
/*
* VenoBox - jQuery Plugin
* version: 1.9.3
* @requires jQuery >= 1.7.0
*
* Examples at http://veno.es/venobox/
* License: MIT License
* License URI: https://github.com/nicolafranchini/VenoBox/blob/master/LICENSE
* Copyright 2013-2021 Nicola Franchini - @nicolafranchini
*
*/
/* global jQuery */
(function($){
"use strict";
var autoplay, bgcolor, blockleft, blocknum, blockshare, blocktitle, border, core, container, content, dest, extraCss,
framewidth, frameheight, gallItems, infinigall, items, keyNavigationDisabled, margine, noArrows, numeratio,
overlayColor, overlay, title, thisgall, thenext, theprev, nextok, prevok, preloader, $preloader, navigation,
obj, gallIndex, startouch, vbheader, images, startY, startX, endY, endX, diff, diffX, diffY, threshold,
share, sharelinks, vbfooter, sharepos;
var pinIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.372-12 12 0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738.098.119.112.224.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146 1.124.347 2.317.535 3.554.535 6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z" fill-rule="evenodd" clip-rule="evenodd"/></svg>';
var fbIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm3 8h-1.35c-.538 0-.65.221-.65.778v1.222h2l-.209 2h-1.791v7h-3v-7h-2v-2h2v-2.308c0-1.769.931-2.692 3.029-2.692h1.971v3z"/></svg>';
var twitterIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm6.066 9.645c.183 4.04-2.83 8.544-8.164 8.544-1.622 0-3.131-.476-4.402-1.291 1.524.18 3.045-.244 4.252-1.189-1.256-.023-2.317-.854-2.684-1.995.451.086.895.061 1.298-.049-1.381-.278-2.335-1.522-2.304-2.853.388.215.83.344 1.301.359-1.279-.855-1.641-2.544-.889-3.835 1.416 1.738 3.533 2.881 5.92 3.001-.419-1.796.944-3.527 2.799-3.527.825 0 1.572.349 2.096.907.654-.128 1.27-.368 1.824-.697-.215.671-.67 1.233-1.263 1.589.581-.07 1.135-.224 1.649-.453-.384.578-.87 1.084-1.433 1.489z"/></svg>';
var linkedinIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm-2 16h-2v-6h2v6zm-1-6.891c-.607 0-1.1-.496-1.1-1.109 0-.612.492-1.109 1.1-1.109s1.1.497 1.1 1.109c0 .613-.493 1.109-1.1 1.109zm8 6.891h-1.998v-2.861c0-1.881-2.002-1.722-2.002 0v2.861h-2v-6h2v1.093c.872-1.616 4-1.736 4 1.548v3.359z"/></svg>';
var downloadIcon = '<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24"><path d="M12 0c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm2 9h-4v-1h4v1zm0-3v1h-4v-1h4zm-2 13l-6-6h4v-3h4v3h4l-6 6z"/></svg>';
$.fn.extend({
//plugin name - venobox
venobox: function(options) {
var plugin = this;
// default options
var defaults = {
arrowsColor : '#B6B6B6',
noArrows: false,
autoplay : false, // same as data-autoplay - thanks @codibit
bgcolor: '#fff',
border: '0',
closeBackground : 'transparent',
closeColor : "#d2d2d2",
framewidth: '',
frameheight: '',
gallItems: false,
infinigall: false,
htmlClose : '×',
htmlNext : '<span>Next</span>',
htmlPrev : '<span>Prev</span>',
numeratio: false,
numerationBackground : '#161617',
numerationColor : '#d2d2d2',
numerationPosition : 'top', // 'top' || 'bottom'
overlayClose: true, // disable overlay click-close - thanx @martybalandis
overlayColor : 'rgba(23,23,23,0.85)',
spinner : 'double-bounce', // available: 'rotating-plane' | 'double-bounce' | 'wave' | 'wandering-cubes' | 'spinner-pulse' | 'chasing-dots' | 'three-bounce' | 'circle' | 'cube-grid' | 'fading-circle' | 'folding-cube'
spinColor : '#d2d2d2',
titleattr: 'title', // specific attribute to get a title (e.g. [data-title]) - thanx @mendezcode
titleBackground: '#161617',
titleColor: '#d2d2d2',
titlePosition : 'top', // 'top' || 'bottom'
share: [], // ['facebook', 'twitter', 'linkedin', 'pinterest', 'download']
cb_pre_open: function(){ return true; }, // Callbacks - thanx @garyee
cb_post_open: function(){},
cb_pre_close: function(){ return true; },
cb_post_close: function(){},
cb_post_resize: function(){},
cb_after_nav: function(){},
cb_content_loaded: function(){},
cb_init: function(){}
};
var option = $.extend(defaults, options);
// callback plugin initialization
option.cb_init(plugin);
return this.each(function() {
obj = $(this);
// Prevent double initialization - thanx @matthistuff
if (obj.data('venobox')) {
return true;
}
// method to be used outside the plugin
plugin.VBclose = function() {
closeVbox();
};
obj.addClass('vbox-item');
obj.data('framewidth', option.framewidth);
obj.data('frameheight', option.frameheight);
obj.data('border', option.border);
obj.data('bgcolor', option.bgcolor);
obj.data('numeratio', option.numeratio);
obj.data('gallItems', option.gallItems);
obj.data('infinigall', option.infinigall);
obj.data('noArrows', option.noArrows);
obj.data('overlaycolor', option.overlayColor);
obj.data('titleattr', option.titleattr);
obj.data('share', option.share);
obj.data('venobox', true);
obj.on('click', function(e){
e.preventDefault();
obj = $(this);
// callback plugin initialization
var cb_pre_open = option.cb_pre_open(obj);
if (cb_pre_open === false) {
return false;
}
// Remove focus from link to avoid multiple calls with enter key
obj.blur();
// methods to be used outside the plugin
plugin.VBnext = function() {
navigateGall(thenext);
};
plugin.VBprev = function() {
navigateGall(theprev);
};
overlayColor = obj.data('overlay') || obj.data('overlaycolor');
framewidth = obj.data('framewidth');
frameheight = obj.data('frameheight');
// set data-autoplay="true" for vimeo and youtube videos - thanx @zehfernandes
autoplay = obj.data('autoplay') || option.autoplay;
border = obj.data('border');
bgcolor = obj.data('bgcolor');
nextok = false;
prevok = false;
keyNavigationDisabled = false;
// set a different url to be loaded using data-href="" - thanx @pixeline
dest = obj.data('href') || obj.attr('href');
extraCss = obj.data( 'css' ) || '';
title = obj.attr(obj.data('titleattr')) || '';
share = obj.data('share');
preloader = '<div class="vbox-preloader">';
switch (option.spinner) {
case 'rotating-plane':
preloader += '<div class="sk-rotating-plane"></div>';
break;
case 'double-bounce':
preloader += '<div class="sk-double-bounce">'+
'<div class="sk-child sk-double-bounce1"></div>'+
'<div class="sk-child sk-double-bounce2"></div>'+
'</div>';
break;
case 'wave':
preloader += '<div class="sk-wave">'+
'<div class="sk-rect sk-rect1"></div>'+
'<div class="sk-rect sk-rect2"></div>'+
'<div class="sk-rect sk-rect3"></div>'+
'<div class="sk-rect sk-rect4"></div>'+
'<div class="sk-rect sk-rect5"></div>'+
'</div>';
break;
case 'wandering-cubes':
preloader += '<div class="sk-wandering-cubes">'+
'<div class="sk-cube sk-cube1"></div>'+
'<div class="sk-cube sk-cube2"></div>'+
'</div>';
break;
case 'spinner-pulse':
preloader += '<div class="sk-spinner sk-spinner-pulse"></div>';
break;
case 'chasing-dots':
preloader += '<div class="sk-chasing-dots">'+
'<div class="sk-child sk-dot1"></div>'+
'<div class="sk-child sk-dot2"></div>'+
'</div>';
break;
case 'three-bounce':
preloader += '<div class="sk-three-bounce">'+
'<div class="sk-child sk-bounce1"></div>'+
'<div class="sk-child sk-bounce2"></div>'+
'<div class="sk-child sk-bounce3"></div>'+
'</div>';
break;
case 'circle':
preloader += '<div class="sk-circle">'+
'<div class="sk-circle1 sk-child"></div>'+
'<div class="sk-circle2 sk-child"></div>'+
'<div class="sk-circle3 sk-child"></div>'+
'<div class="sk-circle4 sk-child"></div>'+
'<div class="sk-circle5 sk-child"></div>'+
'<div class="sk-circle6 sk-child"></div>'+
'<div class="sk-circle7 sk-child"></div>'+
'<div class="sk-circle8 sk-child"></div>'+
'<div class="sk-circle9 sk-child"></div>'+
'<div class="sk-circle10 sk-child"></div>'+
'<div class="sk-circle11 sk-child"></div>'+
'<div class="sk-circle12 sk-child"></div>'+
'</div>';
break;
case 'cube-grid':
preloader += '<div class="sk-cube-grid">'+
'<div class="sk-cube sk-cube1"></div>'+
'<div class="sk-cube sk-cube2"></div>'+
'<div class="sk-cube sk-cube3"></div>'+
'<div class="sk-cube sk-cube4"></div>'+
'<div class="sk-cube sk-cube5"></div>'+
'<div class="sk-cube sk-cube6"></div>'+
'<div class="sk-cube sk-cube7"></div>'+
'<div class="sk-cube sk-cube8"></div>'+
'<div class="sk-cube sk-cube9"></div>'+
'</div>';
break;
case 'fading-circle':
preloader += '<div class="sk-fading-circle">'+
'<div class="sk-circle1 sk-circle"></div>'+
'<div class="sk-circle2 sk-circle"></div>'+
'<div class="sk-circle3 sk-circle"></div>'+
'<div class="sk-circle4 sk-circle"></div>'+
'<div class="sk-circle5 sk-circle"></div>'+
'<div class="sk-circle6 sk-circle"></div>'+
'<div class="sk-circle7 sk-circle"></div>'+
'<div class="sk-circle8 sk-circle"></div>'+
'<div class="sk-circle9 sk-circle"></div>'+
'<div class="sk-circle10 sk-circle"></div>'+
'<div class="sk-circle11 sk-circle"></div>'+
'<div class="sk-circle12 sk-circle"></div>'+
'</div>';
break;
case 'folding-cube':
preloader += '<div class="sk-folding-cube">'+
'<div class="sk-cube1 sk-cube"></div>'+
'<div class="sk-cube2 sk-cube"></div>'+
'<div class="sk-cube4 sk-cube"></div>'+
'<div class="sk-cube3 sk-cube"></div>'+
'</div>';
break;
}
preloader += '</div>';
navigation = '<a class="vbox-next">' + option.htmlNext + '</a><a class="vbox-prev">' + option.htmlPrev + '</a>';
vbheader = '<div class="vbox-title"></div><div class="vbox-left"><div class="vbox-num">0/0</div></div><div class="vbox-close">' + option.htmlClose + '</div>';
vbfooter = '<div class="vbox-share"></div>';
core = '<div class="vbox-overlay ' + extraCss + '" style="background:'+ overlayColor +'">'+
preloader + '<div class="vbox-container"><div class="vbox-content"></div></div>' + vbheader + navigation + vbfooter + '</div>';
$('body').append(core).addClass('vbox-open');
$('.vbox-preloader div:not(.sk-circle) .sk-child, .vbox-preloader .sk-rotating-plane, .vbox-preloader .sk-rect, .vbox-preloader div:not(.sk-folding-cube) .sk-cube, .vbox-preloader .sk-spinner-pulse').css('background-color', option.spinColor);
overlay = $('.vbox-overlay');
container = $('.vbox-container');
content = $('.vbox-content');
blockleft = $('.vbox-left');
blocknum = $('.vbox-num');
blockshare = $('.vbox-share');
blocktitle = $('.vbox-title');
$preloader = $('.vbox-preloader');
$preloader.show();
if (option.titlePosition == 'top') {
sharepos = 'bottom';
} else {
sharepos = 'top';
}
blockshare.css(sharepos, '-1px');
blockshare.css({
'color' : option.titleColor,
'fill' : option.titleColor,
'background-color' : option.titleBackground
});
blocktitle.css(option.titlePosition, '-1px');
blocktitle.css({
'color' : option.titleColor,
'background-color' : option.titleBackground
});
$('.vbox-close').css({
'color' : option.closeColor,
'background-color' : option.closeBackground
});
blockleft.css(option.numerationPosition, '-1px');
blockleft.css({
'color' : option.numerationColor,
'background-color' : option.numerationBackground
});
$('.vbox-next span, .vbox-prev span').css({
'border-top-color' : option.arrowsColor,
'border-right-color' : option.arrowsColor
});
content.html('');
content.css('opacity', '0');
overlay.css('opacity', '0');
checknav();
// fade in overlay
overlay.animate({opacity:1}, 250, function(){
if (obj.data('vbtype') == 'iframe') {
loadIframe();
} else if (obj.data('vbtype') == 'inline') {
loadInline();
} else if (obj.data('vbtype') == 'ajax') {
loadAjax();
} else if (obj.data('vbtype') == 'video') {
loadVid(autoplay);
} else {
content.html('<img src="'+dest+'">');
preloadFirst();
}
option.cb_post_open(obj, gallIndex, thenext, theprev);
});
/* -------- KEYBOARD ACTIONS -------- */
$('body').keydown(keyboardHandler);
/* -------- PREVGALL -------- */
$('.vbox-prev').on('click', function(){
navigateGall(theprev);
});
/* -------- NEXTGALL -------- */
$('.vbox-next').on('click', function(){
navigateGall(thenext);
});
return false;
}); // click
/* -------- CHECK NEXT / PREV -------- */
function checknav(){
thisgall = obj.data('gall');
numeratio = obj.data('numeratio');
gallItems = obj.data('gallItems');
infinigall = obj.data('infinigall');
share = obj.data('share');
noArrows = obj.data('noArrows');
blockshare.html('');
if ( obj.data('vbtype') !== 'iframe' && obj.data('vbtype') !== 'inline' && obj.data('vbtype') !== 'ajax' ) {
sharelinks = {
pinterest : '<a target="_blank" href="https://pinterest.com/pin/create/button/?url='+obj.prop('href')+'&media='+obj.prop('href')+'&description='+title+'">'+pinIcon+'</a>',
facebook : '<a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u='+obj.prop('href')+'">'+fbIcon+'</a>',
twitter : '<a target="_blank" href="https://twitter.com/intent/tweet?text='+title+'&url='+obj.prop('href')+'">'+twitterIcon+'</a>',
linkedin : '<a target="_blank" href="https://www.linkedin.com/sharing/share-offsite/?url='+obj.prop('href')+'">'+linkedinIcon+'</a>',
download : '<a target="_blank" href="'+obj.prop('href')+'">'+downloadIcon+'</a>'
};
$.each( share, function( key, value ) {
blockshare.append(sharelinks[value]);
});
}
if (gallItems) {
items = gallItems;
} else {
items = $('.vbox-item[data-gall="' + thisgall + '"]');
}
if (items.length < 2) {
infinigall = false;
numeratio = false;
}
thenext = items.eq( items.index(obj) + 1 );
theprev = items.eq( items.index(obj) - 1 );
if (!thenext.length && infinigall === true) {
thenext = items.eq(0);
}
// update gall numeration
if (items.length >= 1) {
gallIndex = items.index(obj)+1;
blocknum.html(gallIndex + ' / ' + items.length);
} else {
gallIndex = 1;
}
if (numeratio === true) {
blocknum.show();
} else {
blocknum.hide();
}
// update title
if (title !== '') {
blocktitle.show();
} else {
blocktitle.hide();
}
// update navigation arrows
if (!thenext.length && infinigall !== true) {
$('.vbox-next').css('display', 'none');
nextok = false;
} else {
$('.vbox-next').css('display', 'block');
nextok = true;
}
if (items.index(obj) > 0 || infinigall === true) {
$('.vbox-prev').css('display', 'block');
prevok = true;
} else {
$('.vbox-prev').css('display', 'none');
prevok = false;
}
if (noArrows == true) {
$('.vbox-prev, .vbox-next ').css('display', 'none');
prevok = false;
}
// activate swipe
if (prevok === true || nextok === true) {
content.on(TouchMouseEvent.DOWN, onDownEvent);
content.on(TouchMouseEvent.MOVE, onMoveEvent);
content.on(TouchMouseEvent.UP, onUpEvent);
}
}
/* -------- gallery navigation -------- */
function navigateGall(destination) {
if (destination.length < 1) {
return false;
}
if (keyNavigationDisabled) {
return false;
}
keyNavigationDisabled = true;
overlayColor = destination.data('overlay') || destination.data('overlaycolor');
framewidth = destination.data('framewidth');
frameheight = destination.data('frameheight');
border = destination.data('border');
bgcolor = destination.data('bgcolor');
dest = destination.data('href') || destination.attr('href');
autoplay = destination.data('autoplay');
title = (destination.data('titleattr') && destination.attr(destination.data('titleattr'))) || '';
// swipe out item
if (destination === theprev) {
content.addClass('vbox-animated').addClass('swipe-right');
}
if (destination === thenext) {
content.addClass('vbox-animated').addClass('swipe-left');
}
$preloader.show();
content.animate({
opacity : 0,
}, 500, function(){
overlay.css('background',overlayColor);
content
.removeClass('vbox-animated')
.removeClass('swipe-left')
.removeClass('swipe-right')
.css({'margin-left': 0,'margin-right': 0});
if (destination.data('vbtype') == 'iframe') {
loadIframe();
} else if (destination.data('vbtype') == 'inline') {
loadInline();
} else if (destination.data('vbtype') == 'ajax') {
loadAjax();
} else if (destination.data('vbtype') == 'video') {
loadVid(autoplay);
} else {
content.html('<img src="'+dest+'">');
preloadFirst();
}
obj = destination;
checknav();
keyNavigationDisabled = false;
option.cb_after_nav(obj, gallIndex, thenext, theprev);
});
}
/* -------- KEYBOARD HANDLER -------- */
function keyboardHandler(e) {
if (e.keyCode === 27) { // esc
closeVbox();
}
if (e.keyCode == 37 && prevok === true) { // left
navigateGall(theprev);
}
if (e.keyCode == 39 && nextok === true) { // right
navigateGall(thenext);
}
}
/* -------- CLOSE VBOX -------- */
function closeVbox(){
var cb_pre_close = option.cb_pre_close(obj, gallIndex, thenext, theprev);
if (cb_pre_close === false) {
return false;
}
$('body').off('keydown', keyboardHandler).removeClass('vbox-open');
obj.focus();
overlay.animate({opacity:0}, 500, function(){
overlay.remove();
keyNavigationDisabled = false;
option.cb_post_close();
});
}
/* -------- CLOSE CLICK -------- */
var closeclickclass = '.vbox-overlay';
if(!option.overlayClose){
closeclickclass = '.vbox-close'; // close only on X
}
$('body').on('click touchstart', closeclickclass, function(e){
if ($(e.target).is('.vbox-overlay') ||
$(e.target).is('.vbox-content') ||
$(e.target).is('.vbox-close') ||
$(e.target).is('.vbox-preloader') ||
$(e.target).is('.vbox-container')
) {
closeVbox();
}
});
startX = 0;
endX = 0;
diff = 0;
threshold = 50;
startouch = false;
function onDownEvent(e){
content.addClass('vbox-animated');
startY = endY = e.pageY;
startX = endX = e.pageX;
startouch = true;
}
function onMoveEvent(e){
if (startouch === true) {
endX = e.pageX;
endY = e.pageY;
diffX = endX - startX;
diffY = endY - startY;
var absdiffX = Math.abs(diffX);
var absdiffY = Math.abs(diffY);
if ((absdiffX > absdiffY) && (absdiffX <= 100)) {
e.preventDefault();
content.css('margin-left', diffX);
}
}
}
function onUpEvent(e){
if (startouch === true) {
startouch = false;
var subject = obj;
var change = false;
diff = endX - startX;
if (diff < 0 && nextok === true) {
subject = thenext;
change = true;
}
if (diff > 0 && prevok === true) {
subject = theprev;
change = true;
}
if (Math.abs(diff) >= threshold && change === true) {
navigateGall(subject);
} else {
content.css({'margin-left': 0,'margin-right': 0});
}
}
}
/* == GLOBAL DECLERATIONS == */
var TouchMouseEvent = {
DOWN: "touchmousedown",
UP: "touchmouseup",
MOVE: "touchmousemove"
};
/* == EVENT LISTENERS == */
var onMouseEvent = function(event) {
var type;
switch (event.type) {
case "mousedown": type = TouchMouseEvent.DOWN; break;
case "mouseup": type = TouchMouseEvent.UP; break;
case "mouseout": type = TouchMouseEvent.UP; break;
case "mousemove": type = TouchMouseEvent.MOVE; break;
default:
return;
}
var touchMouseEvent = normalizeEvent(type, event, event.pageX, event.pageY);
$(event.target).trigger(touchMouseEvent);
};
var onTouchEvent = function(event) {
var type;
switch (event.type) {
case "touchstart": type = TouchMouseEvent.DOWN; break;
case "touchend": type = TouchMouseEvent.UP; break;
case "touchmove": type = TouchMouseEvent.MOVE; break;
default:
return;
}
var touch = event.originalEvent.touches[0];
var touchMouseEvent;
if (type == TouchMouseEvent.UP) {
touchMouseEvent = normalizeEvent(type, event, null, null);
} else {
touchMouseEvent = normalizeEvent(type, event, touch.pageX, touch.pageY);
}
$(event.target).trigger(touchMouseEvent);
};
/* == NORMALIZE == */
var normalizeEvent = function(type, original, x, y) {
return $.Event(type, {
pageX: x,
pageY: y,
originalEvent: original
});
};
/* == LISTEN TO ORIGINAL EVENT == */
if ("ontouchstart" in window) {
$(document).on("touchstart", onTouchEvent);
$(document).on("touchmove", onTouchEvent);
$(document).on("touchend", onTouchEvent);
} else {
$(document).on("mousedown", onMouseEvent);
$(document).on("mouseup", onMouseEvent);
$(document).on("mouseout", onMouseEvent);
$(document).on("mousemove", onMouseEvent);
}
/* -------- LOAD AJAX -------- */
function loadAjax(){
$.ajax({
url: dest,
cache: false
}).done(function( msg ) {
content.html('<div class="vbox-inline">'+ msg +'</div>');
preloadFirst();
}).fail(function() {
content.html('<div class="vbox-inline"><p>Error retrieving contents, please retry</div>');
updateoverlay();
});
}
/* -------- LOAD IFRAME -------- */
function loadIframe(){
content.html('<iframe class="venoframe" src="'+dest+'"></iframe>');
// $('.venoframe').load(function(){ // valid only for iFrames in same domain
updateoverlay();
// });
}
/* -------- LOAD VIDEOs -------- */
function loadVid(autoplay){
var player;
var videoObj = parseVideo(dest);
// set rel=0 to hide related videos at the end of YT + optional autoplay
var stringAutoplay = autoplay ? "?rel=0&autoplay=1" : "?rel=0";
var queryvars = stringAutoplay + getUrlParameter(dest);
if (videoObj.type == 'vimeo') {
player = 'https://player.vimeo.com/video/';
} else if (videoObj.type == 'youtube') {
player = 'https://www.youtube.com/embed/';
}
content.html('<iframe class="venoframe vbvid" webkitallowfullscreen mozallowfullscreen allowfullscreen allow="autoplay" frameborder="0" src="'+player+videoObj.id+queryvars+'"></iframe>');
updateoverlay();
}
/**
* Parse Youtube or Vimeo videos and get host & ID
*/
function parseVideo (url) {
url.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
var type;
if (RegExp.$3.indexOf('youtu') > -1) {
type = 'youtube';
} else if (RegExp.$3.indexOf('vimeo') > -1) {
type = 'vimeo';
}
return {
type: type,
id: RegExp.$6
};
}
/**
* get additional video url parameters
*/
function getUrlParameter(name) {
var result = '';
var sPageURL = decodeURIComponent(name);
var firstsplit = sPageURL.split('?');
if (firstsplit[1] !== undefined) {
var sURLVariables = firstsplit[1].split('&');
var sParameterName;
var i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
result = result + '&'+ sParameterName[0]+'='+ sParameterName[1];
}
}
return encodeURI(result);
}
/* -------- LOAD INLINE -------- */
function loadInline(){
content.html('<div class="vbox-inline">'+$(dest).html()+'</div>');
updateoverlay();
}
/* -------- PRELOAD IMAGE -------- */
function preloadFirst(){
images = content.find('img');
if (images.length) {
images.each(function(){
$(this).one('load', function() {
updateoverlay();
});
});
} else {
updateoverlay();
}
}
/* -------- FADE-IN THE NEW CONTENT -------- */
function updateoverlay(){
blocktitle.html(title);
content.find(">:first-child").addClass('vbox-figlio').css({
'width': framewidth,
'height': frameheight,
'padding': border,
'background': bgcolor
});
$('img.vbox-figlio').on('dragstart', function(event) {
event.preventDefault();
});
// reset content scroll
container.scrollTop(0);
updateOL();
content.animate({
'opacity': '1'
},'slow', function(){
$preloader.hide();
});
option.cb_content_loaded(obj, gallIndex, thenext, theprev);
}
/* -------- CENTER FRAME -------- */
function updateOL(){
var sonH = content.outerHeight();
var finH = $(window).height();
if (sonH + 60 < finH) {
margine = (finH - sonH)/2;
} else {
margine = '30px';
}
content.css('margin-top', margine);
content.css('margin-bottom', margine);
option.cb_post_resize();
}
$(window).resize(function(){
if($('.vbox-content').length){
setTimeout(updateOL(), 800);
}
});
}); // each
} // venobox
}); // extend
})(jQuery);
|
const echeance = (duree) => `Dans ${duree}`;
const expiration = (duree) => `${duree.charAt(0).toUpperCase()}${duree.slice(1)} après signature de la présente homologation`;
module.exports = {
seuilsCriticites: ['critique', 'eleve', 'moyen', 'faible'],
typesService: {
siteInternet: { description: 'Site Internet' },
applicationMobile: { description: 'Application Mobile' },
api: { description: "API mise à disposition par l'organisation" },
},
provenancesService: {
developpement: {
description: 'Développé en interne ou par un prestataire au profit de votre organisation',
},
achat: {
description: "Acheté sur étagère auprès d'un fournisseur ou obtenu à titre gratuit",
},
},
statutsDeploiement: {
accessible: {
description: 'Le service est déjà accessible aux utilisateurs',
},
nonAccessible: {
description: "Le service n'est pas accessible aux utilisateurs",
},
},
fonctionnalites: {
newsletter: {
description: 'Inscription à une newsletter',
seuilCriticite: 'faible',
},
questionnaire: {
description: 'Questionnaires, sondages',
seuilCriticite: 'faible',
},
reseauSocial: {
description: 'Réseau social, forum, commentaires',
seuilCriticite: 'moyen',
},
visionconference: {
description: 'Audio, visioconférence',
seuilCriticite: 'moyen',
},
paiement: {
description: 'Paiement en ligne',
seuilCriticite: 'eleve',
},
signatureElectronique: {
description: 'Dispositif de signature électronique',
seuilCriticite: 'critique',
},
compte: {
description: 'Création de compte (utilisateurs avec comptes)',
seuilCriticite: 'faible',
},
messagerie: {
description: 'Messagerie instantanée',
seuilCriticite: 'moyen',
},
emails: {
description: "Envoi et réception d'emails",
seuilCriticite: 'moyen',
},
documents: {
description: 'Stockage de documents',
seuilCriticite: 'moyen',
},
formulaire: {
description: 'Formulaire administratif ou démarche en ligne',
seuilCriticite: 'faible',
},
edition: {
description: 'Édition collaborative (documents, murs collaboratifs, etc.)',
seuilCriticite: 'moyen',
},
reservation: {
description: 'Outils de réservation (livres, places, salles, etc.)',
seuilCriticite: 'faible',
},
},
donneesCaracterePersonnel: {
contact: {
description: 'Données de contact',
exemple: 'mail, numéro de téléphone, adresse postale.',
seuilCriticite: 'faible',
},
identite: {
description: "Données d'identité",
exemple: 'nom/prénom, pseudonyme, date de naissance, numéro de sécurité sociale.',
seuilCriticite: 'faible',
},
document: {
description: "Documents d'identité et autres documents officiels",
exemple: 'photo de passeport, titre de séjour.',
seuilCriticite: 'faible',
},
situation: {
description: 'Données relatives à la situation familiale, économique et financière',
exemple: 'revenus, état civil.',
seuilCriticite: 'moyen',
},
localisation: {
description: 'Données de localisation',
exemple: 'adresse IP, identifiant de connexion, cookies.',
seuilCriticite: 'faible',
},
banque: {
description: 'Données de paiement',
exemple: 'nº de carte bancaire, etc.',
seuilCriticite: 'critique',
},
mineurs: {
description: 'Données concernant des personnes mineures',
seuilCriticite: 'eleve',
},
sensibiliteParticuliere: {
description: 'Données de santé et autres données particulièrement sensibles',
exemple: 'orientation sexuelle, origine, orientations politiques, religieuses.',
seuilCriticite: 'critique',
},
diffusionRestreinte: {
description: 'Données de niveau « Diffusion Restreinte »',
seuilCriticite: 'critique',
},
autre: {
description: 'Autre données sensibles',
exemple: "documents sensibles internes à l'administration.",
seuilCriticite: 'faible',
},
},
delaisAvantImpactCritique: {
moinsUneHeure: {
description: "Moins d'une heure",
seuilCriticite: 'critique',
},
uneJournee: {
description: 'Une journée',
seuilCriticite: 'moyen',
},
plusUneJournee: {
description: "Plus d'une journée",
seuilCriticite: 'faible',
},
},
niveauxGravite: {
nonConcerne: { position: 0, description: 'Non concerné', important: false },
minime: { position: 1, description: 'Minime', important: false },
significatif: { position: 2, description: 'Significatif', important: true },
grave: { position: 3, description: 'Grave', important: true },
critique: { position: 4, description: 'Critique', important: true },
},
risques: {
indisponibiliteService: {
description: 'Le service numérique et ses données sont tout ou en partie inaccessibles',
descriptionLongue: "Votre service numérique est susceptible d'être concerné par ce risque si son indisponibilité peut avoir des conséquences graves sur le fonctionnement de l'organisation, de telle sorte qu'un attaquant pourrait chercher à en tirer un avantage financier – via une demande de rançon – ou à nuire au fonctionnement de votre organisation ou à sa réputation. Par exemple, <a href=\"https://www.lemonde.fr/pixels/article/2021/02/15/apres-celui-de-dax-l-hopital-de-villefranche-paralyse-par-un-rancongiciel_6070049_4408996.html\" target=\"_blank\" rel=\"noopener\">les données d'un hôpital public ont été rendues inaccessibles par un rançongiciel</a>, qui constitue l'une des attaques les plus répandues aujourd'hui.",
},
donneesModifiees: {
description: 'Des informations concernant des utilisateurs sont modifiées ou supprimées',
descriptionLongue: "Votre service numérique est susceptible d'être concerné par ce risque si celui-ci inclut des données dont la modification pourrait bénéficier à une ou plusieurs personnes ou à l'inverse leur porter préjudice, ou nuire à la réputation ou au fonctionnement de votre organisation. Par exemple, <a href=\"https://www.europe1.fr/faits-divers/Un-collegien-pirate-son-proviseur-pour-modifier-ses-notes-en-ligne-781242\" target=\"_blank\" rel=\"noopener\">un attaquant a modifié les notes et le relevé d'assiduité d'élèves en leur faveur depuis l'espace numérique d'un établissement scolaire</a>.",
},
divulgationDonnees: {
description: 'Des informations sont divulguées publiquement',
descriptionLongue: "Votre service numérique est susceptible d'être concerné par ce risque si celui-ci inclut des informations dont la divulgation publique pourrait porter préjudice aux personnes concernées et à la réputation de votre organisation. Par exemple, <a href=\"https://www.lagazettedescommunes.com/746159/les-donnees-personnelles-dagents-du-grand-annecy-diffusees-cinq-mois-apres-la-cyberattaque/?abo=1\" target=\"_blank\" rel=\"noopener\">un attaquant a déjà diffusé publiquement des données à caractère personnel concernant plusieurs agents d'une collectivité</a>.",
},
defigurationSiteWeb: {
description: 'Le service numérique est défiguré',
descriptionLongue: "Votre service numérique est susceptible d'être concerné par ce risque si sa visibilité est à même d'être exploitée par des attaquants cherchant à diffuser des messages à des fins idéologiques, de revanche ou de simple dégradation. Ce risque est accru si des vulnérabilités facilement identifiables peuvent être exploitées. Par exemple, <a href=\"https://www.europe1.fr/technologies/plusieurs-sites-internet-francais-ont-ete-victimes-de-cyberattaques-4001200\" target=\"_blank\" rel=\"noopener\">des messages ou des images à caractère terroriste ont déjà été affichés sur des sites internet français ainsi défigurés</a>. Votre service numérique peut aussi être concerné par ce risque si la modification discrète des informations affichées peut nuire à des utilisateurs ou à la réputation de votre organisation.",
},
arnaques: {
description: "Des informations dérobées sont utilisées à des fins d'escroquerie",
descriptionLongue: "Votre service numérique est susceptible d'être concerné par ce risque si celui-ci inclut des informations pouvant être réutilisées à des fins malveillantes, la plupart du temps motivées par le gain financier. Par exemple par leur <a href=\"https://www.hashtagg.fr/2021/03/07/le-business-des-donnees-revendues-sur-le-dark-web/\" target=\"_blank\" rel=\"noopener\">revente</a> sur le dark web, à des fins <a href=\"https://www.cybermalveillance.gouv.fr/tous-nos-contenus/actualites/violation-donnees-ap-hp-formulaire-lettre-plainte-electronique\" target=\"_blank\" rel=\"noopener\">d'arnaque</a>, de spam, d'usurpation d'identité ou pour mener d'autres attaques telles que des campagnes de <a href=\"https://www.cybermalveillance.gouv.fr/tous-nos-contenus/actualites/hameconnage-assurance-maladie-ameli\" target=\"_blank\" rel=\"noopener\">hameçonnage</a>.",
},
logicielsMalveillants: {
description: 'Le service numérique est détourné de son usage initial',
descriptionLongue: "Votre service numérique est susceptible d'être concerné par ce risque si ses capacités techniques ou encore ses utilisateurs sont susceptibles d'intéresser un attaquant souhaitant mener d'autres actions malveillantes la plupart du temps à des fins de gain financier. Ce risque est accru si des vulnérabilités facilement identifiables peuvent être exploitées. Par exemple, le détournement de la puissance de votre service peut permettre de miner des crypto-monnaies ou <a href=\"https://business.lesechos.fr/directions-numeriques/technologie/cybersecurite/0602985980097-de-nombreux-hackers-utilisent-le-covid-19-a-des-fins-malveillantes-336176.php\" target=\"_blank\" rel=\"noopener\">l'introduction d'un logiciel malveillant visant à infecter des utilisateurs du service</a> peut permettre de dérober des informations.",
},
surveillance: {
description: "Le contenu d'échanges est intercepté",
descriptionLongue: "Votre service numérique est susceptible d'être concerné par ce risque si l'interception du contenu d'échanges entre agents publics ou avec des usagers peut intéresser des acteurs malveillants à des fins de renseignement, d'espionnage économique. Par exemple, les échanges entre de jeunes entreprises technologiques et une administration soutenant ces dernières pourraient donner accès à des informations privilégiées à de potentiels concurrents sur les « pépites » françaises.",
},
},
categoriesMesures: {
gouvernance: 'Gouvernance',
protection: 'Protection',
defense: 'Défense',
resilience: 'Résilience',
},
statutsMesures: {
fait: 'Fait',
planifie: 'Planifié',
nonFait: 'Non fait',
nonRetenu: 'Non concerné',
},
mesures: {
limitationInterconnexions: {
description: "Limiter et connaître les interconnexions du service avec d'autres systèmes",
categorie: 'gouvernance',
indispensable: true,
descriptionLongue: "Cette mesure permet de limiter le risque de contagion d'un incident de sécurité d'un système d'information vers un autre. Il peut s'agir d'autres systèmes essentiels de l'organisation ou de systèmes externes de partenaires ou de sous-traitants (hébergeur, prestataire d'infogérance, prestataire de service de sécurité, etc.).",
},
listeEquipements: {
description: "Disposer d'une liste à jour des équipements et des logiciels contribuant au fonctionnement du service numérique",
categorie: 'gouvernance',
descriptionLongue: 'Cette mesure contribue au maintien du service en sécurité, en permettant leur mise à jour régulière et la correction des failles de sécurité connues des équipements et logiciels qui permettent le fonctionnement du service.',
},
identificationDonneesSensibles: {
description: 'Identifier les données les plus sensibles à protéger',
categorie: 'gouvernance',
indispensable: true,
descriptionLongue: "Cette mesure permet de concentrer l'effort de sécurisation (notamment les sauvegardes) sur ce qui a le plus de valeur et de diminuer le risque d'atteinte à ces données.",
},
contactSecurite: {
description: 'Rendre public un contact pour signaler un problème de sécurité',
categorie: 'gouvernance',
descriptionLongue: 'Cette mesure facilite le signalement de problèmes de sécurité et leur correction.',
},
exigencesSecurite: {
description: 'Connaître les exigences de sécurité incombant aux sous-traitants du service numérique',
categorie: 'gouvernance',
descriptionLongue: 'Cette mesure permet de vérifier le respect des exigences de sécurité par les sous-traitants (hébergeur, prestataires, etc.) idéalement fixées sur le plan contractuel.',
},
modalitesSuivi: {
description: 'Fixer les modalités du suivi de la sécurité du service entre les parties prenantes',
categorie: 'gouvernance',
descriptionLongue: "Cette mesure garantit que le ou la spécialiste cybersécurité et l'ensemble des parties prenantes (internes, externes) échangent régulièrement sur le maintien en sécurité du service et décident des actions à mener en conséquence. Il est recommandé de réunir l'équipe au moins 2 fois par an.",
},
formaliserModalitesSecurite: {
description: 'Formaliser les modalités de mise en œuvre des mécanismes de sécurité importants pour le service',
categorie: 'gouvernance',
descriptionLongue: 'Cette mesure permet à tous les administrateurs et exploitants du système de savoir quelles mesures mettre en œuvre pour assurer le niveau de sécurité du système tel que prévu par les équipes projets',
},
hebergementUE: {
description: "Héberger le service numérique et les données au sein de l'Union européenne",
categorie: 'gouvernance',
indispensable: true,
descriptionLongue: "Cette mesure renforce le niveau de confiance dans la protection des données à caractère personnel des utilisateurs du service et facilite l'ensemble des actions qui pourraient découler de la survenue d'un incident de sécurité (rémédiation, enquête, etc.).",
},
secNumCloud: {
description: "Héberger le service numérique et les données au sein d'un Cloud qualifié SecNumCloud",
categorie: 'gouvernance',
descriptionLongue: "Cette mesure apporte des garanties techniques et juridiques supplémentaires pour la sécurité du service et des données, en recourant à une solution d'hébergement disposant d'un visa de sécurité de l'ANSSI.",
},
interdictionParageVente: {
description: 'Proscrire le partage ou la vente de données des utilisateurs du service à des tierces parties à des fins commerciales',
categorie: 'gouvernance',
indispensable: true,
descriptionLongue: "Cette mesure protège les utilisateurs contre toutes formes d'utilisation abusive de leurs données, par exemple, via l'installation d'outils d'analyse d'audience, dispositif publicitaires, etc. Cette mesure n'empêche pas l'ouverture des données publiques à des fins d'intérêt général.",
},
sensibilisationRisques: {
description: 'Réaliser des actions régulières de sensibilisation des agents aux risques numériques',
categorie: 'gouvernance',
indispensable: true,
descriptionLongue: "Cette mesure contribue à accroître globalement la vigilance des agents face aux risques de sécurité et d'adopter les bons réflexes, comme éviter certaines actions imprudentes ou signaler un problème de sécurité.",
},
consignesSecurite: {
description: "Fixer et sensibiliser les agents aux consignes de sécurité liées à l'utilisation du service",
categorie: 'gouvernance',
indispensable: true,
descriptionLongue: "Cette mesure permet de former les agents aux bonnes pratiques dans l'usage d'un service numérique et aux actions à proscrire.",
},
analyseRisques: {
description: "Organiser au moins un atelier d'analyse des risques du service numérique",
categorie: 'gouvernance',
descriptionLongue: "Cette mesure vise à étoffer, par l'organisation d'un atelier d'analyse de risques avec l'ensemble des acteurs de l'homologation, à améliorer la connaissance des risques pour le service numérique et permettre l'ajout de mesures de sécurité spécifiques. Ces informations doivent être renseignées dans les rubriques « risques » et « mesures » de sécurité de MonServiceSécurisé.",
},
deconnexionAutomatique: {
description: "Mettre en place la déconnexion automatique des sessions d'accès après une certaine durée",
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure vise à diminuer le risque d'usurpation d'un accès au service, dans le cas où l'équipement serait laissé sans surveillance par l'utilisateur.",
},
accesSecurise: {
description: 'Mettre en place une politique de sécurité des mots de passe',
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure permet d'éviter des mots de passe trop simples, trop courts ou anciens ne soient utilisés par un acteur malveillant pour accéder au service. Cette mesure peut être mise en œuvre en fixant des règles au moment de l'enregistrement d'un mot de passe (longueur, complexité, etc.) ; l'introduction d'un testeur de force de mot de passe ; un délai d'expiration du mot de passe ; une politique de renouvellement automatique ; un accès sans mot de passe par la réception d'un code à usage unique à chaque connexion (hors SMS) ; l'impossibilité de réutiliser des mots de passe déjà employés par le passé ; la révocation immédiate de mots de passe en cas de connexion suspecte, etc. Pour plus de détails, consultez le <a href=\"https://www.ssi.gouv.fr/administration/guide/recommandations-relatives-a-lauthentification-multifacteur-et-aux-mots-de-passe/\" target=\"_blank\" rel=\"noopener\">« Guide de l'ANSSI relatives à l'authentification multifacteur et aux mots de passe ».</a>",
},
franceConnect: {
description: 'Permettre la connexion des utilisateurs via FranceConnect',
categorie: 'protection',
descriptionLongue: "Cette mesure vise à faciliter l'accès sécurisé des utilisateurs au service. FranceConnect permet également aux internautes de s'identifier sur un service en ligne par l'intermédiaire d'un compte existant",
},
listeComptesPrivilegies: {
description: "Disposer d'une liste à jour des comptes disposant d'un d'accès privilégié au service",
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure permet de connaître toutes les personnes en interne ou en externe (sous-traitant, etc.) disposant d'un accès au service. Cette mesure est indispensable en vue de limiter le nombre de comptes d'accès privilégiés, de supprimer les comptes obsolètes, etc.",
},
gestionComptesAcces: {
description: "Mettre en œuvre une procédure de gestion des comptes d'accès",
categorie: 'protection',
descriptionLongue: "Cette mesure permet de maintenir une liste à jour des utilisateurs ayant le droit d'accéder au service et d'éviter que des comptes d'utilisateurs ou d'administrateurs inactifs, notamment de ceux ayant quitté l'organisation, soient utilisés à des fins malveillantes. Les comptes inactifs et ou de personnes parties doivent être désactivés, puis supprimés au bout d'une période à définir.",
},
compartimenter: {
description: "Compartimenter les rôles d'administration métier et d'administration technique",
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure permet de limiter la portée d'une compromission d'un compte d'administrateur et le risque de pouvoir accéder à des services/fonctions non nécessaires à ce rôle. Elle consiste à compartimenter les rôles d'administration métier/fonctionnel (rôle de publication, gestion des utilisateurs du sites, etc.) des rôles techniques (administration des bases de données, le serveur web, l'infrastructure d'accueil, l'admin de la ou des VM participant à l'offre de service).",
},
dissocierComptesAdmin: {
description: 'Dissocier les accès, les comptes et les privilèges des agents à la fois utilisateurs et administrateurs',
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure permet d'éviter qu'un administrateur n'utilise le service en tant qu'utilisateur avec son compte administrateur. Cela permet de diminuer le risque d'usurpation du compte administrateur. Il est recommandé de dissocier également les équipements permettant l'accès utilisateur et administrateur. Cela contribue à réduire le risque d'utilisation illégitime et malveillant d'un accès administrateur.",
},
limitationCreationComptes: {
description: "Limiter la création de comptes d'accès à des comptes nominatifs",
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure permet d'éviter de disposer de comptes partagés par plusieurs personnes, beaucoup plus difficiles à suivre et plus simples à usurper, en particulier les comptes d'accès administrateurs. Cette mesure participe à l'imputabilité des actions.",
},
doubleAuthentAdmins: {
description: "Prévoir l'authentification multifacteur pour les administrateurs techniques et métiers du service",
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure vise à réduire le risque d'usurpation d'accès au service avec un compte administrateur, donnant des droits supérieurs à ceux d'un utilisateur, susceptibles d'être utilisés à des fins malveillantes (ex. supprimer des données, faire cesser le service, etc.). Pour plus de détails, consultez les recommandations de l'ANSSI relatives à l'authentification multifacteur et aux mots de passe.",
},
limitationAccesAdmin: {
description: "Limiter au strict nécessaire le nombre d'administrateurs du service",
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure permet de limiter le nombre de personnes (agents, personnes externes) capables d'administrer le service, susceptibles de voir leur compte usurpé à des fins malveillantes. Cette mesure réduit la surface d'attaque.",
},
limitationDroitsAdmin: {
description: "Limiter les droits d'administration au seul rôle ciblé",
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure permet de réduire le pouvoir d'administration aux seuls services utiles à ce rôle. Par exemple, l'admin de base de donnée n'a de droits que sur la BDD, ou sur le serveur de bases de données, etc.",
},
certificatChiffrement: {
description: "Chiffrer le trafic avec l'utilisation d'un certificat conforme au référentiel général de sécurité",
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure vise à renforcer la sécurité du trafic. Il s'agit d'une mesure de filtrage.",
},
differentiationFiltrage: {
description: 'Différencier le filtrage des accès utilisateurs et administrateurs (métiers et technique)',
categorie: 'protection',
descriptionLongue: "Cette mesure vise à cloisonner les différents types d'accès afin d'éviter qu'un accès utilisateur puisse être détourné par un attaquant pour gagner un accès administrateur au service.",
},
nomsDomaineFrUe: {
description: "Privilégier l'achat de noms de domaines en .fr ou .ue",
categorie: 'protection',
descriptionLongue: 'Cette mesure vise à permettre une réaction rapide en cas de typosquatting (consistant à utiliser des noms de domaines proches contenant des erreurs typographiques discrètes ou courantes permettant de rediriger les utilisateurs vers un site malveillant) et renforcer la confiance dans les utilisateurs du service',
},
nomsDomaineSimilaires: {
description: 'Acheter plusieurs noms de domaine proches du nom de domaine du service',
categorie: 'protection',
descriptionLongue: 'Cette mesure vise à permettre une réaction rapide en cas de typosquatting (consistant à utiliser des noms de domaines proches contenant des erreurs typographiques discrètes ou courantes permettant de rediriger les utilisateurs vers un site malveillant) et renforcer la confiance dans les utilisateurs du service',
},
securisationCode: {
description: 'Mettre en œuvre des bonnes pratiques de sécurisation du code',
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure vise à renforcer la sécurité du service dès son développement (« security by design ») afin de limiter les vulnérabilités techniques du service susceptibles d'être exploitées par des attaquants. Par exemple, cette mesure permet de réduire le risque de défiguration du service ou son utilisation en « point d'eau » visant à infecter, depuis le service, les équipements des utilisateurs du service. Le respect des bonnes pratiques proposé par l'OWASP est recommandé.",
},
auditsSecurite: {
description: 'Organiser des contrôles et audits de sécurité périodiques',
categorie: 'protection',
descriptionLongue: "Cette mesure vise à assurer un suivi de la sécurité du service. Les contrôles doivent porter sur l'architecture, la configuration, le code source, la réalisation de tests d'intrusion",
},
parefeu: {
description: 'Installer un parefeu',
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure vise à filtrer les flux au niveau du réseau, afin d'éviter des accès illégitimes au service.",
},
chiffrementFlux: {
description: 'Désactiver tout flux non chiffré',
categorie: 'protection',
indispensable: true,
descriptionLongue: 'Cette mesure vise à empêcher que des flux de données non chiffrés ne soient interceptés par des acteurs malveillants.',
},
protectionDeniService: {
description: 'Souscrire à un service de protection contre les attaques de déni de service',
categorie: 'protection',
descriptionLongue: 'Cette mesure vise à protéger le service contre les attaques de type « déni de service » pouvant rendre le service temporairement innaccessible.',
},
hebergementMachineVirtuelle: {
description: 'Héberger le service et les données dans une machine virtuelle',
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure vise à renforcer la sécurité de l'hébergement du service et faciliter la limitation des accès à ce dernier.",
},
chiffrementMachineVirtuelle: {
description: 'Chiffrer la machine virtuelle',
categorie: 'protection',
descriptionLongue: 'Cette mesure vise à renforcer la sécurité des données grâce au chiffrement de leur contenant, à savoir la machine virtuelle.',
},
misesAJour: {
description: "Disposer d'une politique d'application des mises à jour fonctionnelles et de sécurité du service numérique",
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure vise à limiter la vulnérabilité du service à des failles de sécurité disposant d'un correctif de sécurité qui n'auraient pas été prises en compte. Cette mesure permet également de disposer d'une version toujours récente du service, réduisant ainsi l'exploitation possible de vulnérabilités connues.",
},
versionRecente: {
description: 'Utiliser une version récente et maintenue des éléments applicatifs composant le service',
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure vise à éviter d'utiliser une version ancienne d'éléments applicatifs sous-jacents au service (ex. un CMS) qui comporterait des vulnérabilités connues ou qui ne ferait plus l'objet de mises à jour de sécurité par l'éditeur.",
},
moindrePrivilege: {
description: 'Configurer les applicatifs selon la règle du moindre privilège',
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure vise à limiter les droits (privilèges) accordés aux différents éléments applicatifs du service afin d'éviter que ceux-ci ne puissent être détournés à des fins malveillantes.",
},
configurationMinimaliste: {
description: 'Configurer le service selon la règle de la configuration minimaliste',
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure vise à éviter d'installer des fonctionnalités non nécessaires qu'il sera nécessaire de maintenir à jour et qui pourraient être autant de moyens d'accès additionnels possibles pour un attaquant. L'approche minimaliste « réduit la surface d'attaque ». Cela comprend aussi la désactivation des services préinstallés par contrainte et non utilisés.",
},
verificationAutomatique: {
description: 'Procéder à des vérifications techniques automatiques de la sécurité du service',
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure vise à vérifier, avant le lancement du service, la présence de défauts de configuration ou de vulnérabilités connues, grâce à des outils de tests disponibles la plupart du temps gratuitement en ligne ou à installer en local comme <a href=\"https://testssl.sh/\" target=\"_blank\" rel=\"noopener\">testSSL</a> permettant d'évaluer le niveau de confiance du certificat SSL ; <a href=\"https://observatory.mozilla.org/\" target=\"_blank\" rel=\"noopener\">MozzilaObservatory</a> permettant d'évaluer le respect des bonnes pratiques de configuration HTTP ; dependabot, codeQL, Nmap permettant d'identifier la présence de vulnérabilités.",
},
testIntrusion: {
description: "Effectuer un test d'intrusion et/ou réaliser un bug bounty",
categorie: 'protection',
descriptionLongue: "Cette mesure vise à vérifier, avant le lancement du service, la présence de vulnérabilités dans le service, par la réalisation d'un test d'intrusion ou d'un bug bounty, mobilisant des chercheurs de vulnérabilités.",
},
telechargementsOfficiels: {
description: "Permettre exclusivement le téléchargement d'une application mobile depuis les magasins officiels",
categorie: 'protection',
indispensable: true,
descriptionLongue: "Cette mesure vise à éviter le téléchargement, par les utilisateurs, depuis internet, d'une version de l'application qui aurait été compromise par un acteur malveillant.",
},
veilleSecurite: {
description: "Disposer d'éléments de veille relatifs aux vulnérabilités et aux campagnes de compromission sur Internet",
categorie: 'defense',
indispensable: true,
descriptionLongue: "Cette mesure peut se décliner par le suivi des alertes fournies par le CERT-FR, un abonnement à des solutions de veille permettant de s'informer sur l'actualité des vulnérabilités découvertes et publiées, ainsi que sur les campagnes de piratages.",
},
gestionIncidents: {
description: 'Définir une procédure de gestion des incidents de sécurité',
categorie: 'defense',
indispensable: true,
descriptionLongue: "Cette mesure vise à fixer les rôles et responsabilités des différentes parties prenantes de l'organisation en cas d'incident de sécurité ainsi que les bons réflexes à avoir dans la gestion de l'incident, sur le plan opérationnel mais aussi vis-à-vis des agents publics et des utilisateurs.",
},
journalAcces: {
description: 'Mettre en œuvre la journalisation et la centralisation des accès',
categorie: 'defense',
indispensable: true,
descriptionLongue: "Cette mesure permet de conserver une trace des accès des utilisateurs, des administrateurs et des applicatifs. Elle vise à faciliter la détection d'actions inhabituelles susceptibles d'être malveillantes mais aussi à investiguer les causes d'un incident de sécurité une fois que celui-ci est intervenu, en vue de faciliter sa rémédiation. Le journal des logs est permis lors de la configuration du service.",
},
journalEvenementSecu: {
description: 'Mettre en œuvre la journalisation et la centralisation des évènements de sécurité',
categorie: 'defense',
indispensable: true,
descriptionLongue: "Cette mesure permet de conserver une trace des évènements de sécurité passés, des mesures mises en place en vue d'y rémédier et de détecter plus aisément de nouveaux évènements de sécurité, par corrélation.",
},
notificationConnexionsSuspectes: {
description: 'Envoyer aux administrateurs et aux utilisateurs une notification en cas de connexion suspecte',
categorie: 'defense',
descriptionLongue: "Cette mesure vise à signaler les connexions inhabituelles aux utilisateurs et aux administrateurs. Elle permet de stopper ou de détecter une tentative d'accès illégitime potentiellement malveillant.",
},
supervision: {
description: 'Recourir à un service de supervision de la sécurité',
categorie: 'defense',
descriptionLongue: "Cette mesure vise à renforcer la capacité de détection et de réponse à incident en souscrivant aux services d'une entité experte (security operation center, équipe de réponse à incident, etc.)",
},
testsProcedures: {
description: "Tester régulièrement les procédures de gestion d'incident",
categorie: 'defense',
descriptionLongue: 'Cette mesure vise à vérifier que les procédures de détection et de gestion des incidents en place sont bien fonctionnelles.',
},
scanIP: {
description: "Souscrire ou mettre en œuvre un outil de scan Internet des plages d'adresses IP du service numérique",
categorie: 'defense',
descriptionLongue: "Cette mesure vise à mesurer le niveau d'exposition du service numérique aux menaces et déterminer si seuls les services numériques utiles sont exposés à Internet. Cette mesure peut également viser à consolider les éléments de cartographie du système d'information.",
},
affichageDerniereConnexion: {
description: "Afficher aux utilisateurs l'heure et la date de leur dernière connexion",
categorie: 'defense',
descriptionLongue: 'Cette mesure contribue à aider les utilisateurs à détecter eux-mêmes une utilisation à leur insu du service par une autre personne.',
},
exerciceGestionCrise: {
description: 'Planifier un exercice de gestion de crise, notamment face au risque de rançongiciel',
categorie: 'resilience',
descriptionLongue: "Cette mesure vise à préparer l'organisation à la gestion de crises de sécurité, afin de permettre un retour le plus rapide possible à un mode de fonctionnement normal du service et de l'organisation. Cette mesure permet d'identifier et de qualifier la capacité de réaction de l'ensemble de la chaîne hiérarchique (phase de réaction), dont les équipes techniques et de vérifier la résilience en validant la capacité à remettre en service opérationnel le service web.",
},
politiqueInformation: {
description: "Disposer d'une politique d'information des administrateurs métiers et des utilisateurs en cas d'incident",
categorie: 'resilience',
descriptionLongue: "Cette mesure vise à préparer l'organisation à communiquer vers les utilisateurs de son service au bon moment, notamment dans le cas où des données seraient compromises. Le réglement général sur la protection des données à caractère personnel prévoit notamment une obligation d'information des personnes concernées en cas de fuite de données à caractère personnel.",
},
sauvegardeDonnees: {
description: 'Mettre en place une sauvegarde régulière des données dans un environnement non connecté au service numérique',
categorie: 'resilience',
indispensable: true,
descriptionLongue: "Cette mesure vise à permettre de protéger l'ensemble des données contenues dans le service et permettre à nouveau leur accès dans le cas où le service serait compromis, par exemple, par un rançongiciel qui aurait « chiffré » et donc rendu inaccessibles ces données. Il est recommandé de procéder à cette sauvegarde au minimum, une fois par semaine.",
},
sauvegardeMachineVirtuelle: {
description: 'Mettre en place une sauvegarde en continu de la machine virtuelle sur lequel est déployé le service numérique.',
categorie: 'resilience',
descriptionLongue: 'Cette mesure vise à permettre de réinstaller le service dans sa configuration la plus récente, dans le cas où celui-ci aurait été compromis, par exemple, par un rançongiciel, par une défiguration, etc.',
},
testsSauvegardes: {
description: 'Tester régulièrement les sauvegardes',
categorie: 'resilience',
indispensable: true,
descriptionLongue: 'Cette mesure vise à vérifier que les sauvegardes réalisées sont fonctionnelles et pourront être utilisées en cas de problème.',
},
},
localisationsDonnees: {
france: { description: 'France' },
unionEuropeenne: { description: 'Union Européenne' },
autre: { description: 'Autre' },
},
echeancesRenouvellement: {
sixMois: { description: echeance('six mois'), expiration: expiration('six mois') },
unAn: { description: echeance('un an'), expiration: expiration('un an') },
deuxAns: { description: echeance('deux ans'), expiration: expiration('deux ans') },
},
};
|
/*
* Copyright 2020 Google LLC
*
* 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
*
* https://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.
*/
/**
* External dependencies
*/
import { createContext } from '@web-stories-wp/react';
export default createContext({
actions: { setZoomSetting: () => {} },
state: {},
});
|
import { useState } from 'react';
import './TextField.css';
function TestField({ name, placeholder, type }) {
const [data, setData] = useState('');
const _handleOnChange = (e) => {
setData((p) => e.target.val);
};
return (
<div className='input-group'>
<label className='input-group__label' htmlFor={name}>
{name}
</label>
<input
className='input-group__input'
type={type}
name={name}
id={name}
placeholder={placeholder}
value={data}
onChange={_handleOnChange}
/>
</div>
);
}
export default TestField;
|
/**
* React Static Boilerplate
* https://github.com/kriasoft/react-static-boilerplate
*
* Copyright © 2015-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import React from 'react';
import Navigation from './Navigation';
import s from './Header.css';
const Header = () => (
<header className={s.header}>
<div >Мар'яна Михайлова</div>
<Navigation />
</header>
);
export default Header;
|
import './main';
import './user';
import './dbSearch';
import './ftpLinks';
|
// The Nature of Code
// Daniel Shiffman
// http://natureofcode.com
// A rectangular box
// Constructor
class Lollipop {
constructor(x, y) {
this.w = 8;
this.h = 24;
this.r = 8;
// Define a body
let bd = new box2d.b2BodyDef();
bd.type = box2d.b2BodyType.b2_dynamicBody;
bd.position = scaleToWorld(x, y);
// Define fixture #1
let fd1 = new box2d.b2FixtureDef();
// Fixture holds shape
fd1.shape = new box2d.b2PolygonShape();
fd1.shape.SetAsBox(scaleToWorld(this.w / 2), scaleToWorld(this.h / 2));
fd1.density = 1.0;
fd1.friction = 0.5;
fd1.restitution = 0.2;
// Define fixture #2
let fd2 = new box2d.b2FixtureDef();
fd2.shape = new box2d.b2CircleShape();
fd2.shape.m_radius = scaleToWorld(this.r);
let offset = scaleToWorld(new box2d.b2Vec2(0, -this.h / 2));
fd2.shape.m_p = new box2d.b2Vec2(offset.x, offset.y);
fd2.density = 1.0;
fd2.friction = 0.5;
fd2.restitution = 0.2;
// Create the body
this.body = world.CreateBody(bd);
// Attach the fixture
this.body.CreateFixture(fd1);
this.body.CreateFixture(fd2);
// Some additional stuff
this.body.SetLinearVelocity(new box2d.b2Vec2(random(-5, 5), random(2, 5)));
this.body.SetAngularVelocity(random(-5, 5));
}
// This function removes the particle from the box2d world
killBody() {
world.DestroyBody(this.body);
}
// Is the particle ready for deletion?
done() {
// Let's find the screen position of the particle
let pos = scaleToPixels(this.body.GetPosition());
// Is it off the bottom of the screen?
if (pos.y > height + this.w * this.h) {
this.killBody();
return true;
}
return false;
}
// Drawing the box
display() {
// Get the body's position
let pos = scaleToPixels(this.body.GetPosition());
// Get its angle of rotation
let a = this.body.GetAngleRadians();
// Draw it!
rectMode(CENTER);
push();
translate(pos.x, pos.y);
rotate(a);
fill(127);
stroke(200);
strokeWeight(2);
rect(0, 0, this.w, this.h);
ellipse(0, -this.h / 2, this.r * 2, this.r * 2);
pop();
}
}
|
import { System } from './ecs.js';
import { Stage } from './stage.js';
import { Transform } from './transform.js';
import { InstanceColor } from './instance-color.js';
export const AttributeLocation = {
position: 0,
normal: 1,
tangent: 2,
texcoord: 3,
texcoord2: 4,
color: 5,
joints: 6,
weights: 7,
maxAttributeLocation: 8,
};
const DefaultAttributeFormat = {
position: 'float32x3',
normal: 'float32x3',
tangent: 'float32x3',
texcoord: 'float32x2',
texcoord2: 'float32x2',
color: 'float32x4',
joints: 'uint16x4',
weights: 'float32x4',
};
const DefaultStride = {
uint8x2: 2,
uint8x4: 4,
sint8x2: 2,
sint8x4: 4,
unorm8x2: 2,
unorm8x4: 4,
snorm8x2: 2,
snorm8x4: 4,
uint16x2: 4,
uint16x4: 8,
sint16x2: 4,
sint16x4: 8,
unorm16x2: 4,
unorm16x4: 8,
snorm16x2: 4,
snorm16x4: 8,
float16x2: 4,
float16x4: 8,
float32: 4,
float32x2: 8,
float32x3: 12,
float32x4: 16,
uint32: 4,
uint32x2: 8,
uint32x3: 12,
uint32x4: 16,
sint32: 4,
sint32x2: 8,
sint32x3: 12,
sint32x4: 16,
};
class GeometryLayoutCache {
#nextId = 1;
#keyMap = new Map(); // Map of the given key to an ID
#cache = new Map(); // Map of ID to cached resource
getLayout(id) {
return this.#cache.get(id);
}
createLayout(attribBuffers, topology, indexFormat = 'uint32') {
const buffers = [];
const locationsUsed = [];
for (const buffer of attribBuffers) {
const attributes = [];
for (const attrib of buffer.attributes) {
// Exact offset will be handled when setting the buffer.
const offset = attrib.offset - buffer.minOffset
attributes.push({
shaderLocation: attrib.shaderLocation,
format: attrib.format,
offset,
});
locationsUsed.push(attrib.shaderLocation);
}
buffers.push({
arrayStride: buffer.arrayStride,
attributes
});
}
const primitive = { topology };
switch(topology) {
case 'triangle-strip':
case 'line-strip':
primitive.stripIndexFormat = indexFormat;
}
const layout = {
buffers,
primitive,
};
layout.key = JSON.stringify(layout);
layout.id = this.#keyMap.get(layout.key);
layout.locationsUsed = locationsUsed;
if (layout.id === undefined) {
layout.id = this.#nextId++;
this.#keyMap.set(layout.key, layout.id);
this.#cache.set(layout.id, layout);
}
return layout;
}
}
const LAYOUT_CACHE = new GeometryLayoutCache();
export class InterleavedAttributes {
constructor(buffer, stride) {
this.buffer = buffer;
this.arrayStride = stride;
this.attributes = [];
this.minOffset = Number.MAX_SAFE_INTEGER;
this.minShaderLocation = Number.MAX_SAFE_INTEGER;
}
addAttribute(attribute, offset = 0, format) {
const shaderLocation = AttributeLocation[attribute];
if (shaderLocation === undefined) {
throw new Error(`Unable to determine shader location for ${attribute}.`);
}
if (format === undefined) {
format = DefaultAttributeFormat[attribute];
if (!format) {
throw new Error(`Unable to determine attribute format for ${attribute}.`);
}
}
this.minOffset = Math.min(this.minOffset, offset);
this.minShaderLocation = Math.min(this.minShaderLocation, shaderLocation);
this.attributes.push({attribute, shaderLocation, offset, format});
return this;
}
};
export class Attribute extends InterleavedAttributes {
constructor(attribute, buffer, format, stride) {
if (format === undefined) {
format = DefaultAttributeFormat[attribute];
if (!format) {
throw new Error(`Unable to determine attribute format for ${attribute}.`);
}
}
if (!stride) {
stride = DefaultStride[format];
}
super(buffer, stride);
super.addAttribute(attribute, 0, format);
}
addAttribute() {
throw new Error('Cannot add attributes to a AttributeBuffer. Use InterleavedBuffer instead.');
}
};
let nextGeometryId = 1;
export class Geometry {
id = nextGeometryId++;
vertexBuffers = [];
indexBuffer = null;
drawCount = 0;
layoutId;
constructor(options) {
// Sort the buffers/attributes by shaderLocation to aid in pipeline deduplication.
const attribBuffers = [];
if (options.attributes) {
for (const attribBuffer of options.attributes) {
if (!attribBuffer.attributes.length) { continue; }
attribBuffers.push(attribBuffer);
}
attribBuffers.sort((a, b) => a.minShaderLocation - b.minShaderLocation);
let i = 0;
for (const buffer of attribBuffers) {
this.vertexBuffers.push({
slot: i++,
buffer: buffer.buffer,
offset: buffer.minOffset
});
buffer.attributes.sort((a, b) => a.shaderLocation - b.shaderLocation);
}
}
if (options.indices?.buffer) {
this.indexBuffer = {
buffer: options.indices.buffer,
offset: options.indices.offset || 0,
format: options.indices.format || 'uint32'
};
}
const topology = options.topology || 'triangle-list';
const layout = LAYOUT_CACHE.createLayout(attribBuffers, topology, this.indexBuffer?.format);
this.layoutId = layout.id;
this.drawCount = options.drawCount || 0;
// TODO: If an explicit drawCount wasn't given, guess one from the given buffers.
}
get layout() {
return LAYOUT_CACHE.getLayout(this.layoutId);
}
}
// A mesh is a collection of geometry/material pairs. Only meshes should be used as components for
// an entity. (This allows entities to have multiple geometries, whereas otherwise they would only
// be able to have a single geometry and material, which would be limiting cases in which
// an object consisting of multiple parts need to function as a single entity.)
export class Mesh {
name = ''; // Primarily for debugging.
primitives = []; // Borrowing the term from glTF, but it's clunky.
skin = null;
boundingVolume = null; // Not required, but may be available in some cases.
constructor(...primitives) {
for (const primitive of primitives) {
if (!primitive.geometry || !primitive.material) {
throw new Error('Primitive specified for mesh that lacks geometry or material');
}
}
this.primitives.push(...primitives);
}
}
export class MeshSystem extends System {
stage = Stage.PostFrameLogic;
async init() {
this.meshQuery = this.query(Mesh);
}
execute(delta, time, gpu) {
// TODO: This would be a perfect place for some frustum culling, etc.
this.meshQuery.forEach((entity, mesh) => {
gpu.addFrameMeshInstance(mesh, entity.get(Transform), entity.get(InstanceColor));
});
}
}
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var pixi = require("pixi.js");
var _1 = require("../../");
var core = require("./core");
var BitmapText = /** @class */ (function (_super) {
tslib_1.__extends(BitmapText, _super);
function BitmapText() {
return _super !== null && _super.apply(this, arguments) || this;
}
BitmapText.prototype.getRawClass = function () {
return pixi.Sprite;
};
BitmapText.prototype.create = function (props) {
return new pixi.extras.BitmapText(props.text);
};
BitmapText.prototype.update = function (node, key, val, props) {
core.baseUpdate(node, key, val, props);
};
return BitmapText;
}(_1.NativeWrapper));
exports.BitmapText = BitmapText;
var AnimatedSprite = /** @class */ (function (_super) {
tslib_1.__extends(AnimatedSprite, _super);
function AnimatedSprite() {
return _super !== null && _super.apply(this, arguments) || this;
}
AnimatedSprite.prototype.getRawClass = function () {
return pixi.Sprite;
};
AnimatedSprite.prototype.create = function (props) {
return new pixi.extras.AnimatedSprite(props.textures, props.autoUpdate);
};
AnimatedSprite.prototype.update = function (node, key, val, props) {
if (key === 'playing' && val !== node.playing) {
if (val) {
node.play();
}
else {
node.stop();
}
}
core.baseUpdate(node, key, val, props);
};
return AnimatedSprite;
}(_1.NativeWrapper));
exports.AnimatedSprite = AnimatedSprite;
var TilingSprite = /** @class */ (function (_super) {
tslib_1.__extends(TilingSprite, _super);
function TilingSprite() {
return _super !== null && _super.apply(this, arguments) || this;
}
TilingSprite.prototype.getRawClass = function () {
return pixi.Sprite;
};
TilingSprite.prototype.create = function (props) {
return new pixi.extras.TilingSprite(props.texture);
};
TilingSprite.prototype.update = function (node, key, val, props) {
core.baseUpdate(node, key, val, props, TilingSprite._updateMap);
};
TilingSprite._updateMap = {
tileScaleX: function (node, val) { return (node.tileScale.x = val); },
tileScaleY: function (node, val) { return (node.tileScale.y = val); },
tilePositionX: function (node, val) { return (node.tilePosition.x = val); },
tilePositionY: function (node, val) { return (node.tilePosition.y = val); },
};
return TilingSprite;
}(_1.NativeWrapper));
exports.TilingSprite = TilingSprite;
//# sourceMappingURL=extras.js.map
|
import React from "react"
import PropTypes from "prop-types"
const PhotoTitle = ({ title, photo }) => (
<>
<div className="w-full lg:h-60 h-32 relative bg-gray-900">
<h1 className="w-full h-full lg:text-5xl text-4xl text-white absolute flex items-center justify-center">
{title}
</h1>
<img
className="w-full h-full object-cover opacity-30"
src={photo}
alt={title}
/>
</div>
</>
)
PhotoTitle.propTypes = {
title: PropTypes.element.isRequired,
photo: PropTypes.element.isRequired,
}
export default PhotoTitle
|
import CoOpMissionOne from "../../static/images/co-op-missions-one.jpg"
import CoOpMissionTwo from "../../static/images/co-op-missions-two.jpg"
import CoOpMissionThree from "../../static/images/co-op-missions-three.jpg"
import HeroOne from "../../static/images/hero-one.jpg"
import HeroTwo from "../../static/images/hero-two.jpg"
import HeroThree from "../../static/images/hero-three.jpg"
import FactionsOne from "../../static/images/factions-one.png"
import FactionsTwo from "../../static/images/factions-two.jpg"
import FactionsThree from "../../static/images/factions-three.jpg"
import FactionsFour from "../../static/images/factions-four.png"
export const carouselReducer = (state, action) => {
switch (action.type) {
case "story":
return CoOpMissionsStory()
case "hero":
return CoOpMissionsHero()
case "factions":
return CoOpMissionsFactions()
default:
return null
}
}
export const CoOpMissionsStory = () => {
const slides = [
{
picture: CoOpMissionOne,
content: "CHARGE BOLDLY INTO BATTLE ALONGSIDE YOUR FRIENDS",
id: 1,
},
{
picture: CoOpMissionTwo,
content: "CONFRONT GLOBAL CONFLICT IN NEW LOCATIONS",
id: 2,
},
{
picture: CoOpMissionThree,
content: "LEVEL UP YOUR GAMEPLAY WITH ITEMS",
id: 3,
},
]
return slides
}
export const CoOpMissionsHero = () => {
const slides = [
{
picture: HeroOne,
content: "BRING THE HAMMER DOWN WITH POWERFUL CUSTOMIZATION",
id: 1,
},
{
picture: HeroTwo,
content: "GAIN AN EXTRA EDGE BY MODIFYING YOUR ATTACKS",
id: 2,
},
{
picture: HeroThree,
content: "AID YOUR ALLIES WITH DIVERSE ITEMS",
id: 3,
},
]
return slides
}
export const CoOpMissionsFactions = () => {
const slides = [
{ picture: FactionsOne, content: "NULL SECTOR", id: 1 },
{ picture: FactionsTwo, content: "NULL SECTOR", id: 2 },
{ picture: FactionsThree, content: "NULL SECTOR", id: 3 },
{ picture: FactionsFour, content: "NULL SECTOR", id: 4 },
]
return slides
}
|
/* Burak Kanber */
var width = 500;
var height = 400;
var canvas = ctx = false;
var frameRate = 1/40; // Seconds
var frameDelay = frameRate * 1000; // ms
var loopTimer = false;
/*
* Experiment with values of mass, radius, restitution,
* gravity (ag), and density (rho)!
*
* Changing the constants literally changes the environment
* the ball is in.
*
* Some settings to try:
* the moon: ag = 1.6
* water: rho = 1000, mass 5
* beach ball: mass 0.05, radius 30
* lead ball: mass 10, restitution -0.05
*/
var ball = {
position: {x: width/2, y: 0},
velocity: {x: 10, y: 0},
mass: 0.1, //kg
radius: 15, // 1px = 1cm
restitution: -0.7
};
var Cd = 0.47; // Dimensionless
var rho = 1.22; // kg / m^3
var A = Math.PI * ball.radius * ball.radius / (10000); // m^2
var ag = 9.81; // m / s^2
var mouse = {x: 0, y: 0, isDown: false};
function getMousePosition(e) {
mouse.x = e.pageX - canvas.offsetLeft;
mouse.y = e.pageY - canvas.offsetTop;
}
var mouseDown = function(e) {
if (e.which == 1) {
getMousePosition(e);
mouse.isDown = true;
ball.position.x = mouse.x;
ball.position.y = mouse.y;
}
}
var mouseUp = function(e) {
if (e.which == 1) {
mouse.isDown = false;
ball.velocity.y = (ball.position.y - mouse.y) /10;
ball.velocity.x = (ball.position.x - mouse.x) / 10;
}
}
var setup = function() {
canvas = document.getElementById("canvas");
ctx = canvas.getContext("2d");
canvas.onmousemove = getMousePosition;
canvas.onmousedown = mouseDown;
canvas.onmouseup = mouseUp;
ctx.fillStyle = 'blue';
ctx.strokeStyle = '#000000';
loopTimer = setInterval(loop, frameDelay);
}
var loop = function() {
if ( ! mouse.isDown) {
// Do physics
// Drag force: Fd = -1/2 * Cd * A * rho * v * v
var Fx = -0.5 * Cd * A * rho * ball.velocity.x * ball.velocity.x * ball.velocity.x / Math.abs(ball.velocity.x);
var Fy = -0.5 * Cd * A * rho * ball.velocity.y * ball.velocity.y * ball.velocity.y / Math.abs(ball.velocity.y);
Fx = (isNaN(Fx) ? 0 : Fx);
Fy = (isNaN(Fy) ? 0 : Fy);
// Calculate acceleration ( F = ma )
var ax = Fx / ball.mass;
var ay = ag + (Fy / ball.mass);
// Integrate to get velocity
ball.velocity.x += ax*frameRate;
ball.velocity.y += ay*frameRate;
// Integrate to get position
ball.position.x += ball.velocity.x*frameRate*100;
ball.position.y += ball.velocity.y*frameRate*100;
}
// Handle collisions
if (ball.position.y > height - ball.radius) {
ball.velocity.y *= ball.restitution;
ball.position.y = height - ball.radius;
}
if (ball.position.x > width - ball.radius) {
ball.velocity.x *= ball.restitution;
ball.position.x = width - ball.radius;
}
if (ball.position.x < ball.radius) {
ball.velocity.x *= ball.restitution;
ball.position.x = ball.radius;
}
// Draw the ball
ctx.clearRect(0,0,width,height);
ctx.save();
ctx.translate(ball.position.x, ball.position.y);
ctx.beginPath();
ctx.arc(0, 0, ball.radius, 0, Math.PI*2, true);
ctx.fill();
ctx.closePath();
ctx.restore();
// Draw the slingshot
if (mouse.isDown) {
ctx.beginPath();
ctx.moveTo(ball.position.x, ball.position.y);
ctx.lineTo(mouse.x, mouse.y);
ctx.stroke();
ctx.closePath();
}
}
setup();
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function (mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("../htmlmixed/htmlmixed"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "../htmlmixed/htmlmixed"], mod);
else // Plain browser env
mod(CodeMirror);
})(function (CodeMirror) {
"use strict";
var indentingTags = ["template", "literal", "msg", "fallbackmsg", "let", "if", "elseif",
"else", "switch", "case", "default", "foreach", "ifempty", "for",
"call", "param", "deltemplate", "delcall", "log"];
CodeMirror.defineMode("soy", function (config) {
var textMode = CodeMirror.getMode(config, "text/plain");
var modes = {
html: CodeMirror.getMode(config, {
name: "text/html",
multilineTagIndentFactor: 2,
multilineTagIndentPastTag: false
}),
attributes: textMode,
text: textMode,
uri: textMode,
css: CodeMirror.getMode(config, "text/css"),
js: CodeMirror.getMode(config, {name: "text/javascript", statementIndent: 2 * config.indentUnit})
};
function last(array) {
return array[array.length - 1];
}
function tokenUntil(stream, state, untilRegExp) {
var oldString = stream.string;
var match = untilRegExp.exec(oldString.substr(stream.pos));
if (match) {
// We don't use backUp because it backs up just the position, not the state.
// This uses an undocumented API.
stream.string = oldString.substr(0, stream.pos + match.index);
}
var result = stream.hideFirstChars(state.indent, function () {
return state.localMode.token(stream, state.localState);
});
stream.string = oldString;
return result;
}
function contains(list, element) {
while (list) {
if (list.element === element) return true;
list = list.next;
}
return false;
}
function prepend(list, element) {
return {
element: element,
next: list
};
}
function pop(list) {
return list && list.next;
}
// Reference a variable `name` in `list`.
// Let `loose` be truthy to ignore missing identifiers.
function ref(list, name, loose) {
return contains(list, name) ? "variable-2" : (loose ? "variable" : "variable-2 error");
}
return {
startState: function () {
return {
kind: [],
kindTag: [],
soyState: [],
templates: null,
variables: null,
scopes: null,
indent: 0,
localMode: modes.html,
localState: CodeMirror.startState(modes.html)
};
},
copyState: function (state) {
return {
tag: state.tag, // Last seen Soy tag.
kind: state.kind.concat([]), // Values of kind="" attributes.
kindTag: state.kindTag.concat([]), // Opened tags with kind="" attributes.
soyState: state.soyState.concat([]),
templates: state.templates,
variables: state.variables,
scopes: state.scopes,
indent: state.indent, // Indentation of the following line.
localMode: state.localMode,
localState: CodeMirror.copyState(state.localMode, state.localState)
};
},
token: function (stream, state) {
var match;
switch (last(state.soyState)) {
case "comment":
if (stream.match(/^.*?\*\//)) {
state.soyState.pop();
} else {
stream.skipToEnd();
}
return "comment";
case "templ-def":
if (match = stream.match(/^\.?([\w]+(?!\.[\w]+)*)/)) {
state.templates = prepend(state.templates, match[1]);
state.scopes = prepend(state.scopes, state.variables);
state.soyState.pop();
return "def";
}
stream.next();
return null;
case "templ-ref":
if (match = stream.match(/^\.?([\w]+)/)) {
state.soyState.pop();
// If the first character is '.', try to match against a local template name.
if (match[0][0] == '.') {
return ref(state.templates, match[1], true);
}
// Otherwise
return "variable";
}
stream.next();
return null;
case "param-def":
if (match = stream.match(/^([\w]+)(?=:)/)) {
state.variables = prepend(state.variables, match[1]);
state.soyState.pop();
state.soyState.push("param-type");
return "def";
}
stream.next();
return null;
case "param-type":
if (stream.peek() == "}") {
state.soyState.pop();
return null;
}
if (stream.eatWhile(/^[\w]+/)) {
return "variable-3";
}
stream.next();
return null;
case "var-def":
if (match = stream.match(/^\$([\w]+)/)) {
state.variables = prepend(state.variables, match[1]);
state.soyState.pop();
return "def";
}
stream.next();
return null;
case "tag":
if (stream.match(/^\/?}/)) {
if (state.tag == "/template" || state.tag == "/deltemplate") {
state.variables = state.scopes = pop(state.scopes);
state.indent = 0;
} else {
if (state.tag == "/for" || state.tag == "/foreach") {
state.variables = state.scopes = pop(state.scopes);
}
state.indent -= config.indentUnit *
(stream.current() == "/}" || indentingTags.indexOf(state.tag) == -1 ? 2 : 1);
}
state.soyState.pop();
return "keyword";
} else if (stream.match(/^([\w?]+)(?==)/)) {
if (stream.current() == "kind" && (match = stream.match(/^="([^"]+)/, false))) {
var kind = match[1];
state.kind.push(kind);
state.kindTag.push(state.tag);
state.localMode = modes[kind] || modes.html;
state.localState = CodeMirror.startState(state.localMode);
}
return "attribute";
} else if (stream.match(/^"/)) {
state.soyState.push("string");
return "string";
}
if (match = stream.match(/^\$([\w]+)/)) {
return ref(state.variables, match[1]);
}
if (stream.match(/(?:as|and|or|not|in)/)) {
return "keyword";
}
stream.next();
return null;
case "literal":
if (stream.match(/^(?=\{\/literal})/)) {
state.indent -= config.indentUnit;
state.soyState.pop();
return this.token(stream, state);
}
return tokenUntil(stream, state, /\{\/literal}/);
case "string":
var match = stream.match(/^.*?("|\\[\s\S])/);
if (!match) {
stream.skipToEnd();
} else if (match[1] == "\"") {
state.soyState.pop();
}
return "string";
}
if (stream.match(/^\/\*/)) {
state.soyState.push("comment");
return "comment";
} else if (stream.match(stream.sol() ? /^\s*\/\/.*/ : /^\s+\/\/.*/)) {
return "comment";
} else if (stream.match(/^\{literal}/)) {
state.indent += config.indentUnit;
state.soyState.push("literal");
return "keyword";
} else if (match = stream.match(/^\{([\/@\\]?[\w?]*)/)) {
if (match[1] != "/switch")
state.indent += (/^(\/|(else|elseif|ifempty|case|default)$)/.test(match[1]) && state.tag != "switch" ? 1 : 2) * config.indentUnit;
state.tag = match[1];
if (state.tag == "/" + last(state.kindTag)) {
// We found the tag that opened the current kind="".
state.kind.pop();
state.kindTag.pop();
state.localMode = modes[last(state.kind)] || modes.html;
state.localState = CodeMirror.startState(state.localMode);
}
state.soyState.push("tag");
if (state.tag == "template" || state.tag == "deltemplate") {
state.soyState.push("templ-def");
}
if (state.tag == "call" || state.tag == "delcall") {
state.soyState.push("templ-ref");
}
if (state.tag == "let") {
state.soyState.push("var-def");
}
if (state.tag == "for" || state.tag == "foreach") {
state.scopes = prepend(state.scopes, state.variables);
state.soyState.push("var-def");
}
if (state.tag.match(/^@param\??/)) {
state.soyState.push("param-def");
}
return "keyword";
}
return tokenUntil(stream, state, /\{|\s+\/\/|\/\*/);
},
indent: function (state, textAfter) {
var indent = state.indent, top = last(state.soyState);
if (top == "comment") return CodeMirror.Pass;
if (top == "literal") {
if (/^\{\/literal}/.test(textAfter)) indent -= config.indentUnit;
} else {
if (/^\s*\{\/(template|deltemplate)\b/.test(textAfter)) return 0;
if (/^\{(\/|(fallbackmsg|elseif|else|ifempty)\b)/.test(textAfter)) indent -= config.indentUnit;
if (state.tag != "switch" && /^\{(case|default)\b/.test(textAfter)) indent -= config.indentUnit;
if (/^\{\/switch\b/.test(textAfter)) indent -= config.indentUnit;
}
if (indent && state.localMode.indent)
indent += state.localMode.indent(state.localState, textAfter);
return indent;
},
innerMode: function (state) {
if (state.soyState.length && last(state.soyState) != "literal") return null;
else return {state: state.localState, mode: state.localMode};
},
electricInput: /^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/,
lineComment: "//",
blockCommentStart: "/*",
blockCommentEnd: "*/",
blockCommentContinue: " * ",
fold: "indent"
};
}, "htmlmixed");
CodeMirror.registerHelper("hintWords", "soy", indentingTags.concat(
["delpackage", "namespace", "alias", "print", "css", "debugger"]));
CodeMirror.defineMIME("text/x-soy", "soy");
});
|
var searchData=
[
['right',['Right',['../classglcd.html#a6f1db2d3e921d6c346eb537abfac886b',1,'glcd']]]
];
|
const DATAPREFIX = "data";
export default attrs => {
let p, bits;
return Object.keys(attrs).reduce((o, key) => {
bits = key.split("-");
if (bits.length > 1 && bits[0] === DATAPREFIX) bits = bits.splice(1);
p = bits.reduce((s, key, idx) => {
s += idx ? key.substring(0, 1).toUpperCase() + key.substring(1) : key;
return s;
}, "");
o[p] = attrs[key];
return o;
}, {});
};
|
var hierarchy =
[
[ "IDisposable", null, [
[ "RexTools.RexReader", "class_rex_tools_1_1_rex_reader.html", null ]
] ],
[ "RexTools.Tile", "class_rex_tools_1_1_tile.html", null ],
[ "RexTools.TileLayer", "class_rex_tools_1_1_tile_layer.html", null ],
[ "RexTools.TileMap", "class_rex_tools_1_1_tile_map.html", null ]
];
|
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(function() {
return factory(root);
});
} else if (typeof exports === 'object') {
module.exports = factory;
} else {
root.echo = factory(root);
}
})(this, function (root) {
'use strict';
var echo = {};
var callback = function () {};
var offset, poll, delay, useDebounce, unload;
var isHidden = function (element) {
return (element.offsetParent === null);
};
var inView = function (element, view) {
if (isHidden(element)) {
return false;
}
var box = element.getBoundingClientRect();
return (box.right >= view.l && box.bottom >= view.t && box.left <= view.r && box.top <= view.b);
};
var debounceOrThrottle = function () {
if(!useDebounce && !!poll) {
return;
}
clearTimeout(poll);
poll = setTimeout(function(){
echo.render();
poll = null;
}, delay);
};
echo.init = function (opts) {
opts = opts || {};
var offsetAll = opts.offset || 0;
var offsetVertical = opts.offsetVertical || offsetAll;
var offsetHorizontal = opts.offsetHorizontal || offsetAll;
var optionToInt = function (opt, fallback) {
return parseInt(opt || fallback, 10);
};
offset = {
t: optionToInt(opts.offsetTop, offsetVertical),
b: optionToInt(opts.offsetBottom, offsetVertical),
l: optionToInt(opts.offsetLeft, offsetHorizontal),
r: optionToInt(opts.offsetRight, offsetHorizontal)
};
delay = optionToInt(opts.throttle, 250);
useDebounce = opts.debounce !== false;
unload = !!opts.unload;
callback = opts.callback || callback;
echo.render();
if (document.addEventListener) {
root.addEventListener('scroll', debounceOrThrottle, false);
root.addEventListener('load', debounceOrThrottle, false);
} else {
root.attachEvent('onscroll', debounceOrThrottle);
root.attachEvent('onload', debounceOrThrottle);
}
};
echo.render = function (context) {
var nodes = (context || document).querySelectorAll('[data-echo], [data-echo-background]');
var length = nodes.length;
var src, elem;
var view = {
l: 0 - offset.l,
t: 0 - offset.t,
b: (root.innerHeight || document.documentElement.clientHeight) + offset.b,
r: (root.innerWidth || document.documentElement.clientWidth) + offset.r
};
for (var i = 0; i < length; i++) {
elem = nodes[i];
if (inView(elem, view)) {
if (unload) {
elem.setAttribute('data-echo-placeholder', elem.src);
}
if (elem.getAttribute('data-echo-background') !== null) {
elem.style.backgroundImage = 'url(' + elem.getAttribute('data-echo-background') + ')';
}
else if (elem.src !== (src = elem.getAttribute('data-echo'))) {
elem.src = src;
}
if (!unload) {
elem.removeAttribute('data-echo');
elem.removeAttribute('data-echo-background');
}
callback(elem, 'load');
}
else if (unload && !!(src = elem.getAttribute('data-echo-placeholder'))) {
if (elem.getAttribute('data-echo-background') !== null) {
elem.style.backgroundImage = 'url(' + src + ')';
}
else {
elem.src = src;
}
elem.removeAttribute('data-echo-placeholder');
callback(elem, 'unload');
}
}
if (!length) {
echo.detach();
}
};
echo.detach = function () {
if (document.removeEventListener) {
root.removeEventListener('scroll', debounceOrThrottle);
} else {
root.detachEvent('onscroll', debounceOrThrottle);
}
clearTimeout(poll);
};
return echo;
});
echo.init({
offset: 2500,
throttle: 250,
unload: false,
callback: function (element, op) {
//console.log(element, 'has been', op + 'ed')
}
});
|
var blue = '#348fe2',
blueLight = '#5da5e8',
blueDark = '#1993E4',
aqua = '#49b6d6',
aquaLight = '#6dc5de',
aquaDark = '#3a92ab',
green = '#00acac',
greenLight = '#33bdbd',
greenDark = '#008a8a',
orange = '#f59c1a',
orangeLight = '#f7b048',
orangeDark = '#c47d15',
dark = '#2d353c',
grey = '#b6c2c9',
purple = '#727cb6',
purpleLight = '#8e96c5',
purpleDark = '#5b6392',
red = '#ff5b57';
/* -------------------------------
Custom Part
------------------------------- */
/* Start CityController */
/* var myHost = document.location.hostname;
console.log(myHost);
if(myHost=='www.cbsatwork.com')
var ldh = 'http://www.cbsatwork.com/laundry/';
else
var ldh = 'http://192.168.10.104/laundry/';*/
/*****************************************************/
/****************** Login Controller *****************/
/*****************************************************/
colorAdminApp.controller('loginController',['$rootScope','$scope','$http','$location','ngNotify', function($rootScope,$scope,$http,$location,ngNotify){
$scope.login = {'email':'', 'password':''};
$scope.login = function(form,data){
if(form.$valid){
console.log(form, data);
// $location.path('/app/customerenquiry').replace();
$http.post(ldh+'store-authentication',data).success(function(response,status){
if(status == 202){
ngNotify.set(response.message);
$location.path('/app/city').replace();
localStorage.setItem('laundry_admin_user_obj',angular.toJson(response))
}
}).error(function(error){
ngNotify.set('Error while trying to login.', {type: 'error',duration: 5000});
console.log(error);
});
}else{
console.log('in valid ');
}
};
}]);
colorAdminApp.controller('CityController',['$rootScope','$scope','$http','pagination','ls','ngNotify','NgTableParams',function($rootScope,$scope,$http,$pagination,$ls,ngNotify, NgTableParams){
'use strict';
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add City ';
$scope.city = {name:'',id:''};
$scope.unique = function(){
validationForm.city.name.$pristine = false;
console.log('unique test ');
};
$scope.addCity = function(){
$http.post(ldh+'admin/cities/store',$scope.city).success(function(response,status){
$scope.getCities();
if($scope.city.id){
ngNotify.set('Your successfully updated '+$scope.city.name+'');
}else{
ngNotify.set('Your successfully added '+$scope.city.name+'');
}
$scope.city ={};
$scope.city.apply;
}).error(function(error){
console.log(error);
});
};
$scope.editCity = function($c){
console.log('city edited');
$http.post(ldh+'admin/cities/edit',$c).success(function(response,status){
$scope.city.name = response.name; // city name populate
$scope.city.id = response.id;
console.log(response);
}).error(function(error){
console.log(error);
});
};
$scope.statusCity = function($c){
console.log('city status');
$http.post(ldh+'admin/cities/status',$c).success(function(response,status){
ngNotify.set('status successfully changed.');
$scope.getCities();
}).error(function(error){
console.log(error);
});
};
$scope.heading = ' Cities ';
$scope.cities = [];
$scope.getCities = function(){
$http.get(ldh+'admin/cities/lists').success(function(response,status){
$scope.cities = response;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
$scope.cities.apply;
}).error(function(error){
console.log(error);
});
};
$scope.getCities();
}]);
/*--- AreaController ---- */
colorAdminApp.controller('AreaController',['$scope','$http','pagination','ngNotify','NgTableParams',function($scope,$http,$pagination,ngNotify,NgTableParams){
'use strict';
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add Area ';
$scope.area = {name:'',city:''};
$scope.cities =[];
$http.get(ldh+'admin/cities/listsz').success(function(response,status){
$scope.cities = response;
$scope.cities.apply;
}).error(function(error){
console.log(error);
});
$scope.addArea = function(){
console.log('area form submited');
$http.post(ldh+'admin/areas/store',$scope.area).success(function(response,status){
$scope.area = {name:'',city:''};
$scope.area.apply;
$scope.getAreas();
if($scope.area.id)
ngNotify.set('Your successfully updated '+$scope.area.name+'',{html:true});
else
ngNotify.set('Your successfully added '+$scope.area.name+'',{html:true});
$scope.area ={};
$scope.area.apply;
}).error(function(error){
console.log(error);
});
};
$scope.editArea = function($a){
$http.post(ldh+'admin/areas/edit',$a).success(function(response,status){
$scope.area.name = response.name; // area name populate
$scope.area.id = response.id;
$scope.area.city = response.city_id.id;
}).error(function(error){
console.log(error);
});
};
$scope.statusArea = function($a){
$http.post(ldh+'admin/areas/status',$a).success(function(response,status){
ngNotify.set('status successfully changed.');
$scope.getAreas();
}).error(function(error){
console.log(error);
});
};
$scope.heading = ' Areas ';
$scope.areas = [];
$scope.getAreas = function(){
$http.get(ldh+'admin/areas/lists').success(function(response,status){
$scope.areas = response;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
$scope.areas.apply;
}).error(function(error){
console.log(error);
});
};
$scope.getAreas();
}]);
/*--- ApartmentController ---- */
colorAdminApp.controller('ApartmentController',['$scope','$http','pagination','ngNotify','NgTableParams',function($scope,$http,$pagination,ngNotify,NgTableParams){
'use strict';
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add Apartment ';
$scope.apartment = {name:'',area:''};
$scope.areas =[];
$http.get(ldh+'admin/areas/listsz').success(function(response,status){
$scope.areas = response;
$scope.areas.apply;
}).error(function(error){
console.log(error);
});
$scope.catalogs =[];
$http.get(ldh+'admin/catalog/listsz').success(function(response,status){
$scope.catalogs = response;
$scope.catalogs.apply;
}).error(function(error){
console.log(error);
});
$scope.addApartment = function(){
console.log('apartment form submited');
$http.post(ldh+'admin/apartments/store',$scope.apartment).success(function(response,status){
$scope.getApartments();
if($scope.apartment.id)
ngNotify.set('Your successfully updated '+$scope.apartment.name+'',{html:true});
else
ngNotify.set('Your successfully added '+$scope.apartment.name+'',{html:true});
$scope.apartment ={};
$scope.apartment.apply;
}).error(function(error){
console.log(error);
});
};
$scope.editApartment = function($a){
$http.post(ldh+'admin/apartments/edit',$a).success(function(response,status){
$scope.apartment.name = response.name; // apartment name populate
$scope.apartment.id = response.id;
$scope.apartment.address = response.address;
$scope.apartment.pincode = response.pincode;
$scope.apartment.area = response.area_id.id;
$scope.apartment.catalog = response.catalog_id.id;
}).error(function(error){
console.log(error);
});
};
$scope.heading = ' Apartment ';
$scope.statusApartment = function($a){
$http.post(ldh+'admin/apartments/status',$a).success(function(response,status){
$scope.getApartments();
ngNotify.set('Status successfully changed.');
}).error(function(error){
console.log(error);
});
};
$scope.apartments = [];
$scope.getApartments = function(){
$http.get(ldh+'admin/apartments/lists').success(function(response,status){
$scope.apartments = response;
console.log(response);
$scope.apartments.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
};
$scope.getApartments();
}]);
/*--- ApartmentBlockController ---- */
colorAdminApp.controller('ApartmentBlockController',['$scope','$http','$stateParams',function($scope,$http,$stateParams){
$scope.apartment = ' ';
//$scope.apartment = {name:'',area:''};
$scope.blocks = [];
$a = $stateParams.id;
$http.put(ldh+'admin/apartments/edit',$a).success(function(response,status){
console.log(response);
// $scope.apartment.name = response.name;
$scope.apartment.apply;
}).error(function(error){
console.log(error);
});
$http.put(ldh+'admin/blocks/apartmentsblockswithflats',$a).success(function(response,status){
console.log(response);
$scope.blocks = response;
$scope.blocks.apply;
}).error(function(error){
console.log(error);
});
}]);
/*--- FlatCustomerController ---- */
colorAdminApp.controller('FlatCustomerController',['$scope','$http','$stateParams','NgTableParams',function($scope,$http,$stateParams, NgTableParams){
$scope.flat =[];
$scope.customers = [];
$scope.customer = [];
$scope.orders = [];
$a = $stateParams.id;
$http.put(ldh+'admin/flats/edit',$a).success(function(response,status){
console.log(response.name);
$scope.flat = response.name;
$scope.flat.apply;
}).error(function(error){
console.log(error);
});
$http.put(ldh+'admin/customers/flatcustlists',$a).success(function(response,status){
console.log(response);
$scope.customers = response;
$scope.customers.apply;
}).error(function(error){
console.log(error);
});
$scope.viewCustomer = function($c){
console.log('Customer display');
$http.post(ldh+'admin/customers/custview',$c).success(function(response,status){
$scope.customer.firstname = response.firstname; // firstname populate
$scope.customer.lastname = response.lastname;
$scope.customer.email = response.email;
$scope.customer.mobile = response.mobile;
$scope.customer.id = response.id;
console.log(response);
}).error(function(error){
console.log(error);
});
}
$scope.viewOrder = function($o){
$scope.orderhis = 'Order History';
console.log('Order History');
$http.post(ldh+'admin/customers/orderview',$o).success(function(response,status){
$scope.orders = response; // firstname populate
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
console.log(response);
}).error(function(error){
console.log(error);
});
}
$scope.orderDetails = function($d){
$scope.orderdetails = 'Order Details';
console.log('Order Details');
$http.post(ldh+'admin/customers/orderdetails',$d).success(function(response,status){
$scope.orderdetailss = response; // firstname populate
console.log(response);
}).error(function(error){
console.log(error);
});
}
}]);
/*--- IndividualUserController ---- */
colorAdminApp.controller('IndividualUserController',['$scope','$http','$stateParams','NgTableParams',function($scope,$http,$stateParams, NgTableParams){
$scope.flat =[];
$scope.customers = [];
$scope.customer = [];
$scope.orders = [];
$a = $stateParams.id;
$http.put(ldh+'admin/customers/customeredit',$a).success(function(response,status){
$scope.customer.firstname = response.firstname; // customer name populate
$scope.customer.id = response.id;
}).error(function(error){
console.log(error);
});
console.log('Customer display');
$http.post(ldh+'admin/customers/custview',$a).success(function(response,status){
$scope.customer.firstname = response.firstname; // firstname populate
$scope.customer.lastname = response.lastname;
$scope.customer.email = response.email;
$scope.customer.mobile = response.mobile;
$scope.customer.id = response.id;
console.log(response);
}).error(function(error){
console.log(error);
});
$scope.viewOrders = function($o){
$scope.orderhis = 'Order History';
console.log('Order History');
$http.post(ldh+'admin/customers/orderview',$o).success(function(response,status){
$scope.orders = response; // firstname populate
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
console.log(response);
}).error(function(error){
console.log(error);
});
};
$scope.orderDetails = function($d){
$scope.orderdetails = 'Order Details';
console.log('Order Details');
$http.post(ldh+'admin/customers/orderdetails',$d).success(function(response,status){
$scope.orderdetailss = response; // firstname populate
console.log(response);
}).error(function(error){
console.log(error);
});
}
}]);
/*--- BlockController ---- */
colorAdminApp.controller('BlockController',['$scope','$http','pagination','ngNotify','NgTableParams',function($scope,$http,$pagination,ngNotify, NgTableParams){
'use strict';
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add Block ';
$scope.block = {name:'',apartment:''};
$scope.apartments =[];
$scope.addBlock = function(){
console.log('block form submited');
$http.post(ldh+'admin/blocks/store',$scope.block).success(function(response,status){
console.log(response);
$scope.getBlocks();
if($scope.block.id)
ngNotify.set('Your successfully updated '+$scope.block.name+'',{html:true});
else
ngNotify.set('Your successfully added '+$scope.block.name+'',{html:true});
$scope.block ={};
$scope.block.apply;
console.log(status);
}).error(function(error){
console.log(error);
});
}
$scope.editBlock = function($a){
$http.post(ldh+'admin/blocks/edit',$a).success(function(response,status){
console.log(response);
$scope.block.name = response.name; // block name populate
$scope.block.id = response.id;
$scope.block.apartment = response.apt_id.id;
}).error(function(error){
console.log(error);
});
}
$scope.statusBlock = function($a){
$http.post(ldh+'admin/blocks/status',$a).success(function(response,status){
$scope.getBlocks();
ngNotify.set('Status successfully changed.');
}).error(function(error){
console.log(error);
});
}
$http.get(ldh+'admin/apartments/listsz').success(function(response,status){
$scope.apartments = response;
$scope.apartments.apply;
}).error(function(error){
console.log(error);
});
$scope.heading1 = ' Blocks ';
$scope.blocks = [];
$scope.getBlocks = function(){
$http.get(ldh+'admin/blocks/lists').success(function(response,status){
$scope.blocks = response;
console.log(response);
$scope.blocks.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
}
$scope.getBlocks();
}]);
/*--- FlatController ---- */
colorAdminApp.controller('FlatController',['$scope','$http','pagination','ngNotify','NgTableParams',function($scope,$http,$pagination,ngNotify, NgTableParams){
'use strict';
$scope.heading = 'Add Flat ';
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.flats =[];
$scope.flat = {};
$scope.addFlat = function(){
console.log($scope.flat);
$http.post(ldh+'admin/flats/store',$scope.flat).success(function(response,status){
$scope.getFlats();
if($scope.flat.id){
ngNotify.set('Your successfully updated '+$scope.flat.name);}
else{
ngNotify.set('Your successfully added '+$scope.flat.name);
}
$scope.flat ={};
$scope.flat.apply;
}).error(function(error){
console.log(error);
});
}
$http.get(ldh+'admin/apartments/arealistsz').success(function(response,status){
$scope.apartments = response;
$scope.apartments.apply;
}).error(function(error){
console.log(error);
});
$scope.blocks=[];
$scope.getBlocks = function($id){
$id = $scope.flat.apartment;
$http.post(ldh+'admin/blocks/listsz',$id).success(function(response,status){
$scope.blocks = response;
$scope.blocks.apply;
}).error(function(error){
console.log(error);
});
}
$scope.heading1 = ' Flats ';
$scope.flats = [];
$scope.editFlat = function($f){
console.log('edit');
$http.post(ldh+'admin/flats/edit',$f).success(function(response,status){
$scope.getBlocks();
console.log(response);
$scope.flat.id = response.id;
$scope.flat.name = response.name; // area name populate
$scope.flat.unitType = response.bhk; // area name populate
$scope.flat.area = response.size; // area name populate
$scope.flat.facing = response.facing; // area name populate
$scope.flat.eusn = response.eusn; // area name populate
$scope.flat.intercom = response.intercom; // area name populate
$scope.flat.sale = response.readyToSale; // area name populate
$scope.flat.roccupy = response.readyToOccupy; // area name populate
$scope.flat.salePrice = response.salePrice; // area name populate
$scope.flat.rentPrice = response.rentPrice; // area name populate
$scope.flat.nofpplStay = response.nofpplStay; // area name populate
$scope.flat.cntOneName = response.cntOneName; // area name populate
$scope.flat.cntOneMobile = response.cntOneMobile; // area name populate
$scope.flat.cntTwoName = response.cntTwoName; // area name populate
$scope.flat.cntTwoMobile = response.cntTwoMobile; // area name populate
$scope.flat.block = response.block_id.id;
$scope.flat.apartment = response.block_id.apt_id.id;
}).error(function(error){
console.log(error);
});
};
$scope.statusFlat = function($a){
$http.post(ldh+'admin/flats/status',$a).success(function(response,status){
$scope.getFlats();
ngNotify.set('status successfully changed.');
}).error(function(error){
console.log(error);
});
};
$scope.getFlats = function(){
$http.get(ldh+'admin/flats/lists').success(function(response,status){
$scope.flats = response;
$scope.flats.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
};
$scope.getFlats();
}]);
/* Start CatalogController */
colorAdminApp.controller('CatalogController',['$scope','$http','pagination','ngNotify','NgTableParams',function($scope,$http,$pagination,ngNotify, NgTableParams){
'use strict';
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add Catalog ';
$scope.catalogs = [];
$scope.catalog = {name:'',id:'',description:''};
$scope.addCatalog = function(){
console.log('catalog form submited');
$http.post(ldh+'admin/catalog/store',$scope.catalog).success(function(response,status){
$scope.getCatalogs();
if($scope.catalog.id){
ngNotify.set('Your successfully updated '+$scope.catalog.name+'',{html:true});}
else{
ngNotify.set('Your successfully added '+$scope.catalog.name+'',{html:true});}
$scope.catalog = {};
$scope.catalog.apply;
}).error(function(error){
console.log(error);
});
};
$scope.editCatalog = function($c){
console.log('catalog edited');
$http.post(ldh+'admin/catalog/edit',$c).success(function(response,status){
$scope.catalog.name = response.name; // catalog name populate
$scope.catalog.id = response.id;
$scope.catalog.description = response.description;
//console.log(response);
}).error(function(error){
console.log(error);
});
};
$scope.statusCatalog = function($c){
console.log('catalog status'+$c);
$http.post(ldh+'admin/catalog/status',$c).success(function(response,status){
ngNotify.set('status successfully changed.');
console.log(response);
$scope.getCatalogs();
}).error(function(error){
console.log(error);
});
};
$scope.heading = ' Cities ';
$scope.catalogs = [];
$scope.getCatalogs = function(){
$http.get(ldh+'admin/catalog/lists').success(function(response,status){
$scope.catalogs = response;
console.log(response);
$scope.catalogs.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
};
$scope.getCatalogs();
}]);
/* Start CatalogItemController */
colorAdminApp.controller('CatalogItemController',['$scope','$http','ls','pagination','ngNotify','NgTableParams',function($scope,$http,$ls,$pagination,ngNotify, NgTableParams){
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add Catalog Item';
$scope.catalogs = [];
$scope.catalogitem = {id:'',catalog:'',service:'',itemtype:'',item:'',price:'',discount:''};
$scope.services = [];
$scope.itemTypes = [];
$scope.services = $ls.getServices().then(function(data){
$scope.services = data.data;
$scope.services.apply;
});
$scope.catalogs = $ls.getCatalogs().then(function(data){
$scope.catalogs = data.data;
$scope.catalogs.apply;
});
$scope.itemTypes = $ls.getItemTypes().then(function(data){
$scope.itemTypes = data.data;
$scope.itemTypes.apply;
});
$scope.items = [];
$scope.getItems = function(){
if($scope.catalogitem.itemtype===undefined)
return;
$scope.items = $ls.getItems($scope.catalogitem.itemtype).then(function(data){
$scope.items = data.data;
$scope.items.apply;
});
};
$scope.addCatalogItem = function(){
//console.log('catalog item form submited');
$http.post(ldh+'admin/catalog/storeitems',$scope.catalogitem).success(function(response,status){
if($scope.catalogitem.id){
ngNotify.set('Your successfully updated catalog item');
}else{
ngNotify.set('Your successfully added catalogitem');
}
$scope.getCatalogItems();
$scope.catalogitem ={};
$scope.catalogitem.apply;
}).error(function(error){
console.log(error);
});
}
$scope.editCatalogItem = function($c){
console.log('catalog item edited');
$http.post(ldh+'admin/catalog/edititem',$c).success(function(response,status){
$scope.catalogitem.id = response.id;
$scope.catalogitem.catalog = response.catalog_id.id;
$scope.catalogitem.service = response.service_id.id;
$scope.catalogitem.item = response.item_id.id;
$scope.catalogitem.itemtype = response.itype_id.id;
$scope.catalogitem.price = response.cost;
$scope.catalogitem.discount = response.discount;
$scope.catalogitem.rpoints = response.rpoints;
//console.log($scope.catalogitem.id);
$scope.getItems();
}).error(function(error){
console.log(error);
});
}
$scope.statusCatalogItem = function($c){
console.log('catalog status');
$http.post(ldh+'admin/catalog/statusitem',$c).success(function(response,status){
ngNotify.set('status successfully changed.');
console.log(response);
$scope.getCatalogItems();
}).error(function(error){
console.log(error);
});
}
$scope.heading = ' Add items to Catalog ';
$scope.catalogs = [];
$scope.applyGlobalSearch = function() {
$scope.tableParams.filter({ $: $scope.search });
}
$scope.getCatalogItems = function(){
$ls.getCatalogItems().then(function(data){
$scope.catalogitems = data.data;
//console.log(data.data+'items');
$scope.catalogitems.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: data.data});
});
}
$scope.statusArea = function($a){
$http.post(ldh+'admin/areas/status',$a).success(function(response,status){
$scope.getAreas();
}).error(function(error){
console.log(error);
});
}
$scope.getCatalogItems();
}]);
/* Start ItemtypeController */
colorAdminApp.controller('ItemTypeController',['$scope','$http','pagination','ngNotify','NgTableParams',function($scope,$http,$pagination,ngNotify, NgTableParams){
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add Itemtype ';
$scope.itemtype = {name:'',code:'',id:''};
$scope.addItemtype = function(){
console.log('itemtype form submited');
$http.post(ldh+'admin/itemtypes/store',$scope.itemtype).success(function(response,status){
console.log(response);
$scope.getItemtypes();
if($scope.itemtype.id)
ngNotify.set('Your successfully updated '+$scope.itemtype.name+'',{html:true});
else
ngNotify.set('Your successfully added '+$scope.itemtype.name+'',{html:true});
$scope.itemtype ={};
$scope.itemtype.apply;
}).error(function(error){
console.log(error);
});
}
$scope.editItemtype = function($c){
console.log('itemtype edited');
$http.post(ldh+'admin/itemtypes/edit',$c).success(function(response,status){
$scope.itemtype.name = response.name; // item name populate
$scope.itemtype.code = response.code;
$scope.itemtype.id = response.id;
console.log(response);
}).error(function(error){
console.log(error);
});
}
$scope.statusItemtype = function($a){
$http.post(ldh+'admin/itemtypes/status',$a).success(function(response,status){
$scope.getItemtypes();
ngNotify.set('status successfully changed.');
}).error(function(error){
console.log(error);
});
}
$scope.heading = ' Itemtypes ';
$scope.itemtypes = [];
$scope.getItemtypes = function(){
$http.get(ldh+'admin/itemtypes/lists').success(function(response,status){
$scope.itemtypes = response;
console.log(response);
$scope.itemtypes.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
}
$scope.getItemtypes();
}]);
/* Start ItemController */
colorAdminApp.controller('ItemController',['$scope','$http','pagination','FileUploader','ngNotify','NgTableParams',function($scope,$http,$pagination,FileUploader,ngNotify, NgTableParams){
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add Item ';
$scope.item = {name:'',id:'',image:'',itemtype:''};
var uploader = $scope.uploader = new FileUploader({
url: ldh+'admin/items/upload/',
data: $scope.item.name
});
uploader.filters.push({
name: 'imageFilter',
fn: function(item , options) {
var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|';
return '|jpg|png|jpeg|bmp|gif|'.indexOf(type) !== -1;
}
});
uploader.onWhenAddingFileFailed = function(item /*{File|FileLikeObject}*/, filter, options) {
// console.info('onWhenAddingFileFailed', item, filter, options);
};
uploader.onAfterAddingFile = function(fileItem) {
$scope.item.image = uploader.queue[0].file.name;
$scope.item.apply;
console.log($scope.item.image);
};
uploader.onAfterAddingAll = function(addedFileItems) {
//console.info('onAfterAddingAll', addedFileItems);
};
uploader.onBeforeUploadItem = function(item) {
};
uploader.onProgressItem = function(fileItem, progress) {
//console.info('onProgressItem', fileItem, progress);
};
uploader.onProgressAll = function(progress) {
//console.info('onProgressAll', progress);
};
uploader.onSuccessItem = function(fileItem, response, status, headers) {
//console.info('onSuccessItem', fileItem, response, status, headers);
};
uploader.onErrorItem = function(fileItem, response, status, headers) {
//console.info('onErrorItem', fileItem, response, status, headers);
};
uploader.onCancelItem = function(fileItem, response, status, headers) {
// console.info('onCancelItem', fileItem, response, status, headers);
};
uploader.onCompleteItem = function(fileItem, response, status, headers) {
};
uploader.onCompleteAll = function() {
};
$scope.addItem = function(){
console.log($scope.item);
if(!$scope.item.sservices || $scope.item.sservices.length == 0){
ngNotify.set("Please select atleast one service", {type: 'error',duration: 5000});
}else{
$http.post(ldh+'admin/items/store',$scope.item).success(function(response,status){
$scope.item.apply;
$scope.getItems();
if($scope.item.id)
ngNotify.set('Your successfully updated '+$scope.item.name+'',{html:true});
else
ngNotify.set('Your successfully added '+$scope.item.name+'',{html:true});
$scope.item ={};
$scope.item.apply;
}).error(function(error){
console.log(error);
});
}
}
$scope.sitemServices = [];
$scope.editItem = function($c){
console.log('item edited');
$http.put(ldh+'admin/items/edit',$c).success(function(response,status){
$scope.item.name = response.name; // item name populate
$scope.item.id = response.id;
$scope.item.image = response.image;
$scope.item.code = response.code;
$scope.item.itemtype = response.itype_id.id;
var ss = new Array();
for(var i=0; i< response.itemServices.length;i++){
ss.push(response.itemServices[i].id);
}
$scope.item.sservices = ss;
$scope.item.apply;
// console.log(response);
}).error(function(error){
console.log(error);
});
}
$scope.statusItem = function($c){
console.log('item status');
$http.post(ldh+'admin/items/status',$c).success(function(response,status){
ngNotify.set('status successfully changed.');
console.log(response);
$scope.getItems();
}).error(function(error){
console.log(error);
});
}
$scope.heading = ' Items ';
$scope.items = [];
$scope.getItems = function(){
$http.get(ldh+'admin/items/lists').success(function(response,status){
$scope.items = response;
$scope.items.apply;
// console.log(response);
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
}
$scope.getItems();
$scope.tfilters = function(){
var term = $scope.tsearch;
$scope.tableParams.filter({ $: term });
$scope.tableParams.apply;
}
$scope.changeFilter = function(field, value){
var filter = {};
filter[field] = value;
angular.extend($scope.tableParams.filter(), filter);
}
$scope.getServices = function(){
$scope.services = $http.get(ldh+'admin/services/listsz').success(function(response,status){
$scope.services = response;
$scope.services.apply;
}).error(function(error){
console.log(error);
});
}
$scope.getServices();
$scope.itemtypes = $http.get(ldh+'admin/itemtypes/listsz').success(function(response,status){
$scope.itemtypes = response;
$scope.itemtypes.apply;
}).error(function(error){
console.log(error);
});
}]);
/*--- CatalogServiceController ---- */
colorAdminApp.controller('CatalogServiceController',['$scope','$http','$stateParams','NgTableParams', function($scope,$http,$stateParams,NgTableParams){
$scope.catalog = ' ';
$scope.catalog = {name:''};
$c = $stateParams.id;
$http.put(ldh+'admin/catalog/edit',$c).success(function(response,status){
console.log(response.name);
$scope.catalog.name = response.name;
$scope.catalog.id = response.id;
$scope.catalog.apply;
}).error(function(error){
console.log(error);
});
$http.put(ldh+'admin/catalog/catalogservices',$c).success(function(response,status){
console.log(response);
$scope.catalogservices = response;
$scope.catalogservices.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "asc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
$scope.viewServiceItem = function($a,$b){
console.log('items='+$a+' '+$b);
$scope.serviceitem = {catalogid:$a,serviceid:$b};
$http.post(ldh+'admin/catalog/serviceitems',$scope.serviceitem).success(function(response,status){
console.log(response);
$scope.serviceitems = response;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
//console.log(response);
}).error(function(error){
console.log(error);
});
}
}]);
/* Start ServiceController */
colorAdminApp.controller('ServiceController',['$scope','$http','pagination','FileUploader','ngNotify','NgTableParams', function($scope,$http,$pagination,FileUploader,ngNotify, NgTableParams){
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add Service ';
$scope.service = {name:'', id:'', image:'',aimage:'', description:'', discount:''};
var uploader = $scope.uploader = new FileUploader({
url: ldh+'admin/services/upload/',
data: $scope.service.name
});
uploader.filters.push({
name: 'imageFilter',
fn: function(item , options) {
console.log('filters')
var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|';
return '|jpg|png|jpeg|bmp|gif|'.indexOf(type) !== -1;
}
});
uploader.onWhenAddingFileFailed = function(item, filter, options) {
};
uploader.onAfterAddingFile = function(fileItem) {
$scope.service.aimage = uploader.queue[0].file.name;
$scope.service.apply;
console.log(uploader.queue[0].file.name);
};
uploader.onAfterAddingAll = function(addedFileItems) {
//console.info('onAfterAddingAll', addedFileItems);
};
uploader.onBeforeUploadItem = function(item) {
};
uploader.onProgressItem = function(fileItem, progress) {
//console.info('onProgressItem', fileItem, progress);
};
uploader.onProgressAll = function(progress) {
//console.info('onProgressAll', progress);
};
uploader.onSuccessItem = function(fileItem, response, status, headers) {
//console.info('onSuccessItem', fileItem, response, status, headers);
};
uploader.onErrorItem = function(fileItem, response, status, headers) {
//console.info('onErrorItem', fileItem, response, status, headers);
};
uploader.onCancelItem = function(fileItem, response, status, headers) {
// console.info('onCancelItem', fileItem, response, status, headers);
};
uploader.onCompleteItem = function(fileItem, response, status, headers) {
// console.info('onCompleteItem', fileItem, response, status, headers);
};
uploader.onCompleteAll = function() {
// console.info('onCompleteAll');
};
// console.info('uploader', uploader);
$scope.addService = function() {
console.log($scope.service);
$http.post(ldh+'admin/services/store',$scope.service).success(function(response,status){
$scope.service ={};
$scope.service.apply;
$scope.getServices();
if($scope.service.id)
ngNotify.set('Your successfully updated '+$scope.service.name+'');
else
ngNotify.set('Your successfully added '+$scope.service.name+'');
console.log(response);
}).error(function(error){
console.log(error);
});
}
$scope.editService = function($c){
console.log('service edited');
$http.post(ldh+'admin/services/edit',$c).success(function(response,status){
$scope.service.name = response.name; // item name populate
$scope.service.id = response.id;
$scope.service.code = response.code;
$scope.service.description = response.description;
$scope.service.discount = response.discount;
$scope.service.image = response.image;
var addons = new Array();
angular.forEach(response.serviceAddons, function(add){
addons.push(add.id);
});
$scope.service.saddons = addons;
console.log(response);
}).error(function(error){
console.log(error);
});
}
$scope.statusService = function($c){
console.log('service status');
$http.post(ldh+'admin/services/status',$c).success(function(response,status){
ngNotify.set('status successfully changed.');
console.log(response);
$scope.getServices();
}).error(function(error){
console.log(error);
});
}
$scope.heading = ' Items ';
$scope.services = [];
$scope.getServices = function(){
$http.get(ldh+'admin/services/lists').success(function(response,status){
$scope.services = response;
$scope.services.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
}
$scope.getServices();
$scope.addons = [];
$http.get(ldh+'admin/addon/listsz').success(function(response,status){
$scope.addons = response;
$scope.addons.apply;
}).error(function(error){
console.log(error);
});
}]);
/* Start AddonController */
colorAdminApp.controller('AddonController',['$scope','$http','pagination','FileUploader','ngNotify','NgTableParams',function($scope,$http,$pagination,FileUploader,ngNotify, NgTableParams){
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add Addon ';
$scope.addon = {name:'',id:'',image:'',price:'', description:''};
console.log(angular.array);
var uploader = $scope.uploader = new FileUploader({
url: ldh+'admin/addon/upload/',
data: $scope.addon.name
});
uploader.filters.push({
name: 'imageFilter',
fn: function(item , options) {
var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|';
return '|jpg|png|jpeg|bmp|gif|'.indexOf(type) !== -1;
}
});
uploader.onAfterAddingFile = function(fileItem) {
$scope.addon.image = uploader.queue[0].file.name;
$scope.addon.apply;
/// console.log($scope.addon.image);
};
uploader.onBeforeUploadItem = function(item) {
//console.info('onBeforeUploadItem', item);
//$scope.addon.image = '';
//$scope.addon.apply;
};
$scope.addAddon = function(){
// console.log($scope.addon);
$http.post(ldh+'admin/addon/store',$scope.addon).success(function(response,status){
$scope.addon.apply;
$scope.getAddons();
if($scope.addon.id)
ngNotify.set('Your successfully updated '+$scope.addon.name+'',{html:true});
else
ngNotify.set('Your successfully added '+$scope.addon.name+'',{html:true});
$scope.addon ={};
$scope.addon.apply;
}).error(function(error){
console.log(error);
});
}
$scope.editAddon = function($c){
// console.log('item edited');
$http.post(ldh+'admin/addon/edit',$c).success(function(response,status){
$scope.addon.name = response.name; // addon name populate
$scope.addon.id = response.id;
$scope.addon.price = response.price;
$scope.addon.description = response.description;
$scope.addon.image = response.image;
//console.log(response);
}).error(function(error){
console.log(error);
});
}
$scope.statusAddon = function($c){
////console.log('item status');
$http.post(ldh+'admin/addon/status',$c).success(function(response,status){
ngNotify.set('status successfully changed.');
//console.log(response);
$scope.getAddons();
}).error(function(error){
console.log(error);
});
}
$scope.heading = ' Addons ';
$scope.addons = [];
$scope.getAddons = function(){
$http.get(ldh+'admin/addon/lists').success(function(response,status){
$scope.addons = response;
$scope.addons.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
}
$scope.getAddons();
}]);
/*--- CustomerListController ---- */
colorAdminApp.controller('CustomerListController',['$scope','$http','pagination','ngNotify','NgTableParams',function($scope,$http,$pagination,ngNotify, NgTableParams){
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add Customer ';
$scope.customer = {firstname:'',id:''};
$scope.areas =[];
$http.get(ldh+'admin/areas/listsz').success(function(response,status){
$scope.areas = response;
$scope.areas.apply;
}).error(function(error){
console.log(error);
});
$scope.apartments = [];
$http.get(ldh+'admin/apartments/listsz').success(function(response,status){
$scope.apartments = response;
console.log(response);
$scope.apartments.apply;
}).error(function(error){
console.log(error);
});
$scope.addCustomer = function(){
console.log('Customer form submited');
$http.post(ldh+'admin/customers/customerstore',$scope.customer).success(function(response,status){
$scope.getCustomers();
if($scope.customer.id)
ngNotify.set('Your successfully updated '+$scope.customer.name+'',{html:true});
else
ngNotify.set('Your successfully added '+$scope.customer.name+'',{html:true});
$scope.customer ={};
$scope.customer.apply;
console.log(status);
}).error(function(error){
console.log(error);
});
}
$scope.editCustomer = function($a){
$http.put(ldh+'admin/customers/customeredit',$a).success(function(response,status){
$scope.customer.firstname = response.firstname; // customer name populate
$scope.customer.lastname = response.lastname;
$scope.customer.email = response.email;
$scope.customer.mobile = response.mobile;
$scope.customer.address = response.address;
$scope.customer.id = response.id;
$scope.customer.area = response.area_id.id;
}).error(function(error){
console.log(error);
});
}
$scope.statusCustomer = function($a){
$http.post(ldh+'admin/customers/status',$a).success(function(response,status){
$scope.getCustomers();
ngNotify.set('Status successfully changed.');
}).error(function(error){
console.log(error);
});
}
$scope.heading1 = ' Customers List ';
$scope.customers = [];
$scope.getCustomers = function(){
$http.get(ldh+'admin/customers/customerlists').success(function(response,status){
$scope.customers = response;
console.log(response);
$scope.customers.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
}
$scope.getCustomers();
}]);
/*--- CustomerAptListController ---- */
colorAdminApp.controller('CustomerAptListController',['$scope','$http','pagination','ngNotify','NgTableParams',function($scope,$http,$pagination,ngNotify, NgTableParams){
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add Customer ';
$scope.customer = {firstname:'',lastname:'',email:'',subType:'',id:'',mobile:'',refid:''};
$scope.subtypes = ["owner","tenant"];
$scope.areas =[];
$http.get(ldh+'admin/areas/listsz').success(function(response,status){
$scope.areas = response;
$scope.areas.apply;
}).error(function(error){
console.log(error);
});
$scope.apartments = [];
$http.get(ldh+'admin/apartments/listsz').success(function(response,status){
$scope.apartments = response;
console.log(response);
$scope.apartments.apply;
}).error(function(error){
console.log(error);
});
$scope.blocks = [];
$scope.getBlocks = function(){
$aprt = $scope.customer.apartment;
$http.post(ldh+'admin/blocks/lists',$aprt).success(function(response,status){
console.log(response);
$scope.blocks = response;
$scope.blocks.apply;
}).error(function(error){
console.log(error);
});
}
$scope.flats = [];
$scope.getFlats = function(){
$block = $scope.customer.block;
$http.post(ldh+'admin/flats/lists',$block).success(function(response,status){
console.log(response);
$scope.flats = response;
$scope.flats.apply;
}).error(function(error){
console.log(error);
});
}
$scope.addAptCustomer = function(){
console.log('Customer form submited');
$http.post(ldh+'admin/customers/aptstore',$scope.customer).success(function(response,status){
$scope.getCustomers();
if($scope.customer.id)
ngNotify.set('Your successfully updated '+$scope.customer.name+'',{html:true});
else
ngNotify.set('Your successfully added '+$scope.customer.name+'',{html:true});
$scope.customer ={};
$scope.customer.apply;
console.log(status);
}).error(function(error){
console.log(error);
});
}
$scope.editAptCustomer = function($a){
$http.put(ldh+'admin/customers/aptedit',$a).success(function(response,status){
$scope.getBlocks();
$scope.getFlats();
$scope.customer.firstname = response.firstname; // customer name populate
$scope.customer.lastname = response.lastname;
$scope.customer.email = response.email;
$scope.customer.mobile = response.mobile;
$scope.customer.id = response.id;
$scope.customer.apartment = response.apt_id.id;
$scope.customer.block = response.block_id.id;
$scope.customer.flat = response.flat_id.id;
}).error(function(error){
console.log(error);
});
}
$scope.statusCustomer = function($a){
$http.post(ldh+'admin/customers/status',$a).success(function(response,status){
$scope.getCustomers();
ngNotify.set('Status successfully changed.');
}).error(function(error){
console.log(error);
});
}
$scope.heading1 = ' Customers List ';
$scope.customers = [];
$scope.getCustomers = function(){
$http.get(ldh+'admin/customers/aptlists').success(function(response,status){
$scope.customers = response;
// console.log(response);
$scope.customers.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
}
$scope.getCustomers();
}]);
/*--- SettingsController ---- */
colorAdminApp.controller('SettingsController',['$scope','$http','pagination','ngNotify','NgTableParams',function($scope,$http,$pagination,ngNotify, NgTableParams){
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Settings ';
$scope.settings = {refpoints:''};
$scope.addSettings = function(){
console.log('Ref Points Entered');
$http.post(ldh+'admin/settings/store',$scope.settings).success(function(response,status){
$scope.getSettings();
console.log(response);
}).error(function(error){
console.log(error);
});
}
$scope.addCustomer = function(){
console.log('Settings changed');
$http.post(ldh+'admin/settings/store',$scope.settings).success(function(response,status){
$scope.getSettings();
if($scope.settings.id)
ngNotify.set('Your successfully updated '+$scope.settings.name+'',{html:true});
else
ngNotify.set('Your successfully added '+$scope.settings.name+'',{html:true});
$scope.settings ={};
$scope.settings.apply;
console.log(status);
}).error(function(error){
console.log(error);
});
}
$scope.editCustomer = function($a){
$http.put(ldh+'admin/settings/edit',$a).success(function(response,status){
$scope.settings.id = response.id;
}).error(function(error){
console.log(error);
});
}
$scope.statusSettings = function($a){
$http.post(ldh+'admin/settings/status',$a).success(function(response,status){
$scope.getSettings();
ngNotify.set('Status successfully changed.');
}).error(function(error){
console.log(error);
});
}
$scope.settings = [];
$scope.getSettings = function(){
$http.get(ldh+'admin/settings/lists').success(function(response,status){
$scope.settings = response;
console.log(response);
$scope.settings.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
}
$scope.getSettings();
}]);
/*********************************************************/
/*********** FacultyController ************************/
/*********************************************************/
colorAdminApp.controller('FacultyController',['$scope','$http','ls','ngNotify','NgTableParams',function($scope,$http,$ls,ngNotify,NgTableParams ){
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add Faculty ';
$scope.faculty = {id:'',firstname:'',lastname:'',email:'',mobile:'',designation:'',status:'',apartment:''};
$scope.froles = ["admin","supervisor","watchmen"];
$scope.areas =[];
$http.get(ldh+'admin/areas/listsz').success(function(response,status){
$scope.areas = response;
$scope.areas.apply;
}).error(function(error){
console.log(error);
});
$scope.apartments = [];
$http.get(ldh+'admin/apartments/listsz').success(function(response,status){
$scope.apartments = response;
console.log(response);
$scope.apartments.apply;
}).error(function(error){
console.log(error);
});
$scope.addFaculty = function(){
$http.post(ldh+'ams/faculty/store',$scope.faculty).success(function(response,status){
$scope.getFaculties();
if($scope.faculty.id)
ngNotify.set('Your successfully updated '+$scope.faculty.name+'');
else
ngNotify.set('Your successfully added '+$scope.faculty.name+'');
$scope.faculty ={};
$scope.faculty.apply;
console.log(status);
}).error(function(error){
console.log(error);
});
}
$scope.editFaculty = function($a){
$http.put(ldh+'ams/faculty/edit',$a).success(function(response,status){
$scope.faculty.firstname = response.firstname; // faculty name populate
$scope.faculty.lastname = response.lastname;
$scope.faculty.email = response.email;
$scope.faculty.mobile = response.mobile;
$scope.faculty.id = response.id;
$scope.faculty.role = response.designation;
$scope.faculty.apartment = response.apt_id.id;
}).error(function(error){
console.log(error);
});
}
$scope.statusFaculty = function($a){
$http.post(ldh+'ams/faculty/status',$a).success(function(response,status){
$scope.getFaculties();
ngNotify.set('Status successfully changed.');
}).error(function(error){
console.log(error);
});
}
$scope.heading1 = ' Faculties List ';
$scope.faculties = [];
$scope.getFaculties = function(){
$http.get(ldh+'ams/faculty/lists').success(function(response,status){
$scope.faculties = response;
$scope.faculties.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
}
$scope.getFaculties();
}]);
/***************************************************************/
/************** VECHICLE REGISTRATION *****************/
/***************************************************************/
colorAdminApp.controller('VehicleController',['$scope','$http','pagination','ngNotify','NgTableParams', '$filter', function($scope,$http,$pagination,ngNotify, NgTableParams, $filter){
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.heading = 'Add Vehicle ';
$scope.vehicle = {vtype:'',customerId:'',brand:'',regno:'',rfid:''};
$scope.apartments = [];
$http.get(ldh+'admin/apartments/listsz').success(function(response,status){
$scope.apartments = response;
console.log(response);
$scope.apartments.apply;
}).error(function(error){
console.log(error);
});
$scope.blocks = [];
$scope.getBlocks = function($aprt){
$http.post(ldh+'admin/blocks/listsz',$aprt).success(function(response,status){
console.log(response);
$scope.blocks = response;
$scope.blocks.apply;
}).error(function(error){
console.log(error);
});
}
$scope.flats = [];
$scope.getFlats = function($block){
//$block = $scope.vehicle.block;
$http.post(ldh+'admin/flats/listsz',$block).success(function(response,status){
console.log(response);
$scope.flats = response;
$scope.flats.apply;
}).error(function(error){
console.log(error);
});
}
$scope.customers = [];
$scope.getCustomers = function($flat){
return $http.post(ldh+'admin/flats/customers',$flat).success(function(response,status){
console.log(response);
$scope.customers = response;
$scope.customers.apply;
}).error(function(error){
console.log(error);
});
}
$scope.addVehicle = function(){
console.log('Customer form submited');
$http.post(ldh+'ams/vehicle/store',$scope.vehicle).success(function(response,status){
$scope.getVehicles();
if($scope.vehicle.id)
ngNotify.set('Your successfully updated '+$scope.vehicle.name+'',{html:true});
else
ngNotify.set('Your successfully added '+$scope.vehicle.name+'',{html:true});
$scope.vehicle ={};
$scope.vehicle.apply;
console.log(status);
}).error(function(error){
console.log(error);
});
}
$scope.editVehicle = function($a){
$http.put(ldh+'ams/vehicle/edit',$a).success(function(response,status){
$scope.vehicle.rfid = response.rfid; // vehicle name populate
$scope.vehicle.regno = response.regNumber;
$scope.vehicle.vtype = response.vtype;
$scope.vehicle.brand = response.make;
$scope.vehicle.id = response.id;
$scope.vehicle.apartment = response.apt_id.id;
$scope.getBlocks(response.apt_id.id);
$scope.vehicle.block = response.block_id.id;
$scope.getFlats(response.block_id.id);
$scope.vehicle.flat = response.flat_id.id;
$scope.getCustomers(response.flat_id.id).then(function () {
$scope.vehicle.customerId = $filter('filter')($scope.customers, {customerId: response.cust_id.id})[0];
});
console.log($filter('filter')($scope.customers, {customerId: response.cust_id.id})[0]);
console.log($scope.vehicle.customerId);
console.log(response);
}).error(function(error){
console.log(error);
});
}
$scope.statusVehicle = function($a){
$http.post(ldh+'ams/vehicle/status',$a).success(function(response,status){
$scope.getVehicles();
ngNotify.set('Status successfully changed.');
}).error(function(error){
console.log(error);
});
}
$scope.heading1 = ' Vechickes List ';
$scope.vehicles = [];
$scope.getVehicles = function(){
$http.get(ldh+'ams/vehicle/lists').success(function(response,status){
$scope.vehicles = response;
// console.log(response);
$scope.vehicles.apply;
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
}
$scope.getVehicles();
}]);
/******************************************************/
/************ VISITORS FUNCTION ********************/
/******************************************************/
colorAdminApp.controller('VisitorController',['$scope','$http','NgTableParams',function($scope,$http,NgTableParams){
$scope.visitors = [];
$http.get(ldh+'ams/visitor/listsz').success(function(response,status,header,config){
console.log(response);
console.log(status);
console.log(header);
console.log(config);
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response});
}).error(function(error){
console.log(error);
});
}]);
colorAdminApp.controller('ApprovedVisitorsController',['$scope','$http','NgTableParams', function($scope,$http,NgTableParams){
}]);
/*--- customerEnquiryController ---- */
colorAdminApp.controller('customerEnquiryController',['$scope','$http','ls','ngNotify',function($scope,$http,$ls,ngNotify){
'use strict';
$scope.customer = {'mobile':''};
$scope.checkExist = function(){
$http.post(ldh+'admin/customers/getbymobile',$scope.customer.mobile).success(function(response,status){
if(!response.id){
ngNotify.set('customer not exist in our database, please add as new customer');
}
$scope.customer.customerId = response.id;
$scope.customer.firstname = response.firstname;
$scope.customer.lastname = response.lastname;
$scope.customer.email = response.email;
$scope.customer.mobile = response.mobile;
$scope.customer.firstname = response.firstname;
$scope.customer.type = response.type;
$scope.customer.address = response.address;
$scope.customer.apply;
}).error(function(error){
console.log(error);
});
};
}]);
/*******************************************************************/
/********************* PlaceOrderController ***********************/
/*******************************************************************/
colorAdminApp.controller('PlaceOrderController',['$scope','$rootScope' ,'$http','ls','ngNotify','$stateParams','$state', function($scope,$rootScope,$http,$ls,ngNotify, $stateParams,$state){
'use strict';
$scope.heading = ' Place Order Form';
$scope.subtotal =0;
var orderSaved=false;
$scope.placeorder = {id:'',customerId:'', orderId:'',service:'', itemtype:'', pitem:'', icount:'', addons:[]};
$scope.mainorder = { customerId:'', temporders:[], orderDate:'', adminDiscount:'', addressId:'',totalAmount:'' };
$scope.mainorderStack = { customerId:'', temporders:[], orderDate:'', adminDiscount:'', addressId:'',totalAmount:'' };
$scope.sitems = {customerId:'',serviceId:'',itemTypeId:''};
$scope.epo = false;
$('#datepicker-default').datepicker({
todayHighlight: true,
format: 'dd/MM/yyyy'
});
$('#datepicker-default').on("changeDate", function() {
$scope.mainorder.orderDate = $('#datepicker-default').val()
});
$scope.getPreOrder = function($customerId){
if($customerId!=''){
$scope.placeorder.customerId = $customerId;
}
console.log($scope.placeorder);
$http.post(ldh+'admin/orders/getpreorder',$scope.placeorder).success(function(response,status){
$scope.temporders = response;
$scope.mainorder.temporders = response;
$scope.subtotal=0;
angular.forEach($scope.temporders,function(val,key){
$scope.subtotal += val.cost;
})
}).error(function(error){
console.log(error);
});
};
if($stateParams.id){
$scope.customerId = $stateParams.id;
$scope.placeorder.customerId = $stateParams.id;
$scope.mainorder.customerId = $stateParams.id;
$scope.sitems.customerId = $stateParams.id;
$scope.getPreOrder($stateParams.id);
}else{
$scope.orderId = $stateParams.orderid;
$scope.placeorder.orderId = $stateParams.orderid;
$scope.placeorder.apply;
// console.log($scope.orderId);
$http.post(ldh+'admin/orders/editMainOrder', $scope.orderId).success(function(response,status){
console.log(response);
$scope.customerId = response.customerId;
$scope.sitems.customerId = response.customerId;
$scope.mainorder.customerId = response.customerId;
$scope.placeorder.customerId = response.customerId;
$scope.mainorder.addressId = response.addressId;
$scope.mainorder.adminDiscount = response.adminDiscount;
$scope.mainorder.discountAmount = response.discountAmount;
$scope.mainorder.orderDate = response.orderDate;
$scope.mainorder.orderId = response.orderId;
$scope.mainorder.apply;
$scope.getPreOrder(response.customerId);
$scope.getAddress();
}).error(function(error){
console.log(error);
});
};
$scope.addresses = [];
$scope.getAddress = function(){
//console.log($scope.customerId);
$http.post(ldh+'admin/customers/getaddress', $scope.customerId).success(function(response,status){
$scope.addresses = response;
$scope.addresses.apply;
}).error(function(error){
console.log(error);
});
}
if($scope.customerId){
$scope.getAddress();
}
$scope.sitems.serviceId = $scope.placeorder.service;
$scope.sitems.itemTypeId = $scope.placeorder.itemtype;
$scope.services = [];
$scope.itemTypes = [];
$scope.services = $ls.getServices().then(function(data){
$scope.services = data.data;
$scope.services.apply;
});
$scope.itemTypes = $ls.getItemTypes().then(function(data){
$scope.itemTypes = data.data;
$scope.itemTypes.apply;
});
$scope.items = [];
$scope.addons = [];
$scope.$watch('placeorder.service',function(n,o){
$scope.placeorder.apply;
$scope.sitems.serviceId = n;
if(!$scope.epo){
$scope.placeorder.itemtype='';
$scope.placeorder.pitem='';
}
$scope.sitems.apply;
});
$scope.$watch('placeorder.itemtype',function(p,q){
$scope.sitems.itemTypeId = q;
$scope.sitems.apply;
});
$scope.getServiceItems = function($it){
$scope.sitems.itemTypeId = $it;
$scope.sitems.apply;
return $http.post(ldh+'admin/orders/getserviceitems',$scope.sitems).then(function(response){
$scope.items = response.data.items;
$scope.items.apply;
$scope.addons = response.data.addons;
$scope.addons.apply;
});
};
$scope.savePreOrder = function(){
$scope.epo ='';
$scope.epo.apply;
$scope.placeorder.addons = $scope.addons;
var quantityExceeded = false;
var existingItem = false;
/*angular.forEach($scope.temporders,function(val, key){
if($scope.placeorder.service === val.service_id.id && $scope.placeorder.itemtype === val.item_id.id && $scope.placeorder.pitem === val.item_id.id){
existingItem = true;
}
});*/
if(existingItem){
ngNotify.set("Item already exists. Please add a different item", {type: 'error',duration: 5000});
}else{
angular.forEach($scope.addons,function(val,key){
if(val.selected){
if(val.quantity > $scope.placeorder.icount){
quantityExceeded=true;
}
}
});
if(quantityExceeded){
ngNotify.set("Please make sure that the addons count doesn't exceed the actual count", {type: 'error',duration: 5000});
}else{
$http.post(ldh+'admin/orders/savepreorder',$scope.placeorder).success(function(response,status){
$scope.mainorderStack.temporders.push(angular.copy($scope.placeorder));
console.log(response);
if($scope.placeorder.orderId)
ngNotify.set('Your successfully added/updated ');
else
ngNotify.set('Your successfully added ');
$scope.getPreOrder($scope.placeorder.customerId);
var tplaceorder = {id:'', customerId:$scope.placeorder.customerId,service:'', itemtype:'', pitem:'', icount:'', addons:[]};
$scope.placeorder = tplaceorder;
}).error(function(error){
console.log(error);
});
}
}
}
$scope.editOrderItem = function($toid ,to, index){
$scope.epo = true;
/*$scope.placeorder.service = to.service_id.id;
$scope.placeorder.pitem = to.item_id.id;
$scope.placeorder.icount = to.icount;
//$scope.placeorder.customerId = to.customerId;
//$scope.placeorder.orderId = to.orderId;
$scope.items = to.items;
$scope.placeorder.pitem = to.pitem;
$scope.addons = to.addons;
*/
$http.post(ldh+'admin/orders/editorderitem',$toid).then(function(response,status){
console.log(response.data);
$scope.placeorder = response.data;
$scope.placeorder.customerId = response.data.customerId;
$scope.placeorder.orderId = response.data.orderId;
$scope.items = response.data.items;
$scope.addons = response.data.addons;
});
};
$scope.temporders =[];
$scope.discountChange = function(n){
$scope.mainorder.discountAmount = Math.round($scope.mainorder.totalAmount*(n/100));
};
$scope.saveMainOrder = function(){
orderSaved=true;
if($scope.mainorder.addressId == '' || !$scope.mainorder.addressId){
ngNotify.set('Please select one address', {type: 'error',duration: 5000});
}else{
var orderDate = new Date($scope.mainorder.orderDate)
orderDate.setHours(new Date().getHours())
orderDate.setMinutes(new Date().getMinutes())
orderDate.setSeconds(new Date().getSeconds())
$scope.mainorder.orderDate = orderDate;
$http.post(ldh+'admin/orders/saveorder',$scope.mainorder).success(function(response,status){
console.log(response);
ngNotify.set(' main order completed..... ');
$state.go('app.placeorders');
}).error(function(error){
console.log(error);
});
}
};
$scope.deleteOrderItem = function(id){
$http.post(ldh+'admin/orders/trashtemporder',id).success(function(response,status){
ngNotify.set(' order item moved to trashed... ');
console.log(response);
$scope.getPreOrder(response.customerId);
}).error(function(error){
console.log(error);
});
};
$scope.clearCartItems = function(){
$http.post(ldh+'store-tash-temp-orders',$scope.placeorder).success(function(response,status){
ngNotify.set(' order item moved to trashed... ');
$scope.getPreOrder(response.customerId);
}).error(function(error){
console.log(error);
});
}
$scope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams){
console.log('from controller stateChangeStart')
if(!orderSaved){
var confirmExit = window.confirm('Are you sure you want to exit from this page?');
if(confirmExit){
$scope.clearCartItems();
}else{
event.preventDefault();
}
}
});
}]);
/*******************************************************************/
/***************** Edit PlaceOrderController **********************/
/*******************************************************************/
colorAdminApp.controller('EditPlaceOrderController',['$scope','$http','ls','ngNotify','$stateParams', '$filter', function($scope,$http,$ls,ngNotify, $stateParams,$filter){
'use strict';
$scope.id = $stateParams.id;
$scope.placeorder = [];
// $scope.placeorder = [{ orderId:'', orderDate:'',adminDiscount:'',service:{} , itemtype:[],pitem:[],quantity:[],addons:[],addressId:'',customerId:'', addonFlag:[]}];
$('#datepicker-default').datepicker({
todayHighlight: true
});
$scope.previousOrder = {};
$scope.getOrder = function(){
$http.post(ldh+'admin/orders/getorder',$scope.id).then(function(response,status){
$scope.placeorder.orderId = response.data.orderId;
$scope.$watch('placeorder', function () {
console.log($scope.placeorder);
}, true);
console.log(response.data.orderId);
$scope.placeorder.adminDiscount = response.adminDiscount;
$scope.placeorder.apply;
if(response.data.orderId){
$scope.orderId = response.data.orderId;
$http.post(ldh+'admin/orders/getordersummary',$scope).success(function(response,status){
console.log(JSON.stringify(response));
initPlaceOrderArray(response.length);
getItems(response);
console.log(JSON.stringify(response));
$scope.previousOrder = response;
console.log(response);
}).error(function(error){
console.log(error);
});
}else{
console.log('else');
}
});
};
function initPlaceOrderArray (length) {
var baseObject = { orderId:'', orderDate:'',adminDiscount:'',service:{} , itemtype:[],pitem:[],quantity:[],addons:[],addressId:'',customerId:'', addonFlag:[]};
for(var i=0; i<length; i++){
$scope.placeorder.push(baseObject)
}
}
function getItems (data) {
angular.forEach(data, function (each, key) {
// if(each.addons.length > 0) {
// $scope.placeorder['addonFlag'][key] = true;
// }
$scope.getAddons(each.serviceId, key, function (res) {
$scope.addons[res.index] = res.data;
//$scope.placeorder['addons'][res.index]['addon'] = [];
// $scope.placeorder['addons'][res.index]['addon'] = true;
//$scope.placeorder['addons'][res.index]['addon'][res.index];
});
$scope.getServiceItems(each.itemTypeId, key, function (res) {
$scope.items[res.index] = res.data;
});
})
}
/* $scope.getOrderSummary = function(){
$http.post(ldh+'admin/orders/getordersummary',$scope.placeorder.orderId).success(function(response,status){
console.log(response);
}).error(function(error){
console.log(error);
});
};*/
$scope.getOrder();
$scope.addresses = [];
$scope.getAddress = function(){
$http.post(ldh+'admin/customers/getaddress', $scope.customerId).success(function(response,status){
console.log(response);
$scope.addresses = response;
$scope.addresses.apply;
}).error(function(error){
console.log(error);
});
}
if($scope.customerId){
$scope.getAddress();
}
$scope.n =1;
$scope.poitems = [1];
$scope.placeorder.customerId = $scope.customerId;
$scope.addNewChoice = function() {
// $scope.n = $scope.n +1;
// $scope.poitems.push($scope.n);
$scope.previousOrder.push({});
};
$scope.getServiceAddons = function (serviceId, index) {
$scope.getAddons(serviceId, index, function (res) {
$scope.addons[res.index] = res.data;
//$scope.placeorder['addons'][res.index]['addon'] = [];
// $scope.placeorder['addons'][res.index]['addon'] = true;
//$scope.placeorder['addons'][res.index]['addon'][res.index];
});
}
$scope.getItems = function (itemId, index) {
$scope.getServiceItems(itemId, index, function (res) {
$scope.items[res.index] = res.data;
});
}
$scope.removeChoice = function($i) {
$scope.poitems.pop($i);
};
console.log('test 4');
$scope.heading = ' Place Order Form';
$scope.catalogs = [];
$scope.catalogitem = {id:'',catalog:'',service:'',itemtype:'',item:'',price:'',discount:''};
$scope.services = [];
$scope.itemTypes = [];
$scope.services = $ls.getServices().then(function(data){
$scope.services = data.data;
console.log(data.data);
$scope.services.apply;
});
$scope.catalogs = $ls.getCatalogs().then(function(data){
$scope.catalogs = data.data;
$scope.catalogs.apply;
});
$scope.itemTypes = $ls.getItemTypes().then(function(data){
$scope.itemTypes = data.data;
$scope.itemTypes.apply;
});
$scope.items = [];
$scope.addons = [];
$scope.initModelFilter = function (name, value, index) {
$scope.placeorder[index]['service'] = $filter('filter')($scope.services, {id : value})[0];
}
// $scope.getAddons = function($s,$ai){
// $scope.addons[$ai] = $ls.getServiceAddons($s).then(function(data){
// $scope.addons[$ai] = data.data;
// $scope.addons[$ai].apply;
// });
// }
// $scope.getServiceItems = function($s,$i){
// $scope.items[$i] = $ls.getServiceItems($s).then(function(data){
// $scope.items[$i] = data.data;
// $scope.items[$i].apply;
// });
// }
$scope.getAddons = function($s, $ai, callback){
$ls.getServiceAddons($s).then(function(data){
callback({'data': data.data, index: $ai});
});
}
$scope.getServiceItems = function($s,$i, callback){
$ls.getServiceItems($s).then(function(data){
callback({'data': data.data, index: $i});
});
}
$scope.saveOrder = function(){
console.log('save');
/*$http.post(ldh+'admin/orders/saveorder',$scope.placeorder).success(function(response,status){
$scope.placeorder = {};
ngNotify.set('Order Successfully placed...');
}).error(function(error){
console.log(error);
}); */
}
}]);
/** PlaceOrdersController */
colorAdminApp.controller('PlaceOrdersController',['$scope','$state','$http','NgTableParams', function($scope, $state,$http,NgTableParams){
$scope.order = { orderId:'', customerId:''};
$scope.placeOrders =[];
$scope.curPage = 0;
$scope.pageSize = 5;
$scope.pagination =0;
$scope.payment = {oid:'',totalAmount:'',balanceAmount:'',payingAmount:''} ;
$scope.showModal = false;
$('#datepicker-default').datepicker({
todayHighlight: true
});
$scope.toggleModal = function($o, $t,$paidAmount){
$scope.payment.oid = $o;
$scope.payment.totalAmount = $t;
$scope.payment.paidAmount = $paidAmount;
$scope.payment.balanceAmount = $t - $paidAmount;
$scope.payment.payingAmount =0;
$scope.showModal = !$scope.showModal;
};
/*** Make Payment **/
$scope.makePayment = function(){
$scope.showModal = false;
$http.post(ldh+'admin/orders/makepayment',$scope.payment).then(function(response,status){
$scope.getOrdersList();
});
}
/*** end make payment ***/
$scope.getOrdersList = function(){
var cbsLocal = localStorage.getItem('laundry_admin_user_obj');
var localObj = $.parseJSON(cbsLocal);
var areaId =localObj.employee.areaId;
$http.post(ldh+'admin/orders/orderslist',areaId).then(function(response,status){
$scope.tableParams = new NgTableParams({ count: 5, sorting: { id: "dsc" } }, { counts: [5, 10, 25], dataset: response.data});
});
}
$scope.applyGlobalSearch = function() {
$scope.tableParams.filter({ $: $scope.search });
}
$scope.goToOrderSummary=function(orderId){
console.log(orderId);
$state.go('app.orderdetails',{orderId:orderId},{})
};
$scope.orderSummaryPrint = function($o,$c){
$scope.order.orderId = $o;
$scope.order.customerName = $c.firstname+' '+$c.lastname;
$scope.order.userType = $c.type;
$scope.order.apartmentAddress = $c.address;
$http.post(ldh+'store-order-receipt',$scope.order).success(function(response,status){
console.log(response);
$scope.ordersummary = response;
}).error(function(error){
console.log(error);
});
}
$scope.orderStatus = function($o){
console.log('order status');
$http.post(ldh+'admin/orders/orderidstatus',$o).success(function(response,status){
$scope.getOrdersList();
}).error(function(error){
console.log(error);
});
}
$scope.getOrdersList();
}]);
colorAdminApp.controller('PrintOrderController',['$scope','$http','$stateParams','$state', function($scope,$http, $stateParams,$state){
'use strict';
var orderId = $stateParams.porderid;
$scope.order = {};
$scope.orderSummaryPrint = function($o){
$scope.order.orderId = $o;
// $scope.order.customerName = $c.firstname+' '+$c.lastname;
// $scope.order.userType = $c.type;
// $scope.order.apartmentAddress = $c.address;
$http.post(ldh+'store-order-receipt',$scope.order).success(function(response,status){
console.log(response);
$scope.ordersummary = response;
}).error(function(error){
console.log(error);
});
};
$scope.orderSummaryPrint(orderId);
}])
.controller('OrdersRecordController', function($scope,$http){
$scope.record = {};
$scope.ordersRecord = function(){
$http.get(ldh+'admin-order-records').success(function(response,status){
$scope.record = response;
$scope.record.apply;
console.log(response);
}).error(function(error){
console(error);
});
}
$scope.ordersRecord();
$('#datepicker-default').datepicker({
todayHighlight: true
});
});
colorAdminApp.controller('OrderDetailsController',
['$rootScope','$scope','$stateParams','$http','$location','ngNotify',
function($rootScope,$scope,$stateParams,$http,$location,ngNotify){
console.log('OrderDetailsController');
var orderId = $stateParams.orderId;
function getWholeOrderDetails(){
$http.post(ldh+'store-process-order-details', {orderId:orderId})
.success(function(response,status){
$scope.ordersDetails = [];
angular.forEach(response,function(val,key){
if(val.proceItems.items && val.proceItems.items.length > 0){
angular.forEach(val.proceItems.items,function(val2,key2){
$scope.ordersDetails.push(val2)
})
}
})
console.log($scope.ordersDetails)
}).error(function(error){
console.log(error);
});
}
getWholeOrderDetails();
$scope.submitOrder=function(order){
console.log(order);
if(!order.inBarCode || (order.inBarCode != order.inBarCodeIp)){
ngNotify.set('Please make sure in barcode and out barcode are same', {type: 'error',duration: 5000});
}else{
var obj= {
"processId":order.id,
"outBarCode":order.inBarCodeIp
};
$http.post(ldh+'store-order-ready-for-deliver', obj)
.success(function(response,status){
console.log(response);
}).error(function(error){
console.log(error);
});
}
};
}]);
colorAdminApp.controller('ProcessOrderController',
['$rootScope','$scope','$stateParams','$http','$location','ngNotify',
function($rootScope,$scope,$stateParams,$http,$location,ngNotify){
console.log('ProcessOrderController');
var orderId = $stateParams.orderId ;
function getOrderDetails(){
$http.post(ldh+'admin/orders/mainOrderItems', orderId)
.success(function(response,status){
$scope.ordersList = response;
}).error(function(error){
console.log(error);
});
}
getOrderDetails();
$scope.viewProcessDetils=function(item, type){
$scope.itemSelectedType = type;
$scope.selectedOrder = item;
console.log(item)
$http.post(ldh+'store-pre-process-order', {"placeOrderId":item.id, "status":item.status})
.success(function(response,status){
$scope.processOrderDetails=response;
console.log(response,status)
}).error(function(error){
console.log(error);
});
}
$scope.submitOrderDetails=function(){
console.log('submitted',$scope.processOrderDetails);
var addOnCountsOriginal = {};
var addOnCounts = {};
var typeKeys;
validation = true;
angular.forEach($scope.processOrderDetails.processItems,function(val,key){
angular.forEach(val.addons,function(val2,key2){
if(val2.selected){
if(Object.keys(addOnCounts).indexOf(val2.name) >= 0){
addOnCounts[val2.name] = (addOnCounts[val2.name] + 1)
}else{
addOnCounts[val2.name] = 1;
}
}
})
});
angular.forEach($scope.processOrderDetails.pacount,function(val,key){
addOnCountsOriginal[val.key] = val.value;
});
typeKeys = Object.keys(addOnCountsOriginal);
console.log(addOnCounts, addOnCountsOriginal, typeKeys);
angular.forEach(typeKeys,function(val,key){
if(addOnCountsOriginal[val] !== addOnCounts[val]){
validation = false;
}
});
if(validation){
$http.post(ldh+'store-process-order', $scope.processOrderDetails)
.success(function(response,status){
console.log(response,status)
if(status == 200){
$scope.processOrderDetails = [];
$scope.itemSelectedType = null;
ngNotify.set(response.message);
getOrderDetails();
}
}).error(function(error){
console.log(error);
});
}else{
ngNotify.set('Please make sure that the addons count is equal to the actual addons count', {type: 'error',duration: 5000});
}
};
}]);
/*--- TakeOrderController ---- */
var app = angular.module('angularjs-starter', []);
app.controller('TakeOrderController', function($scope) {
$scope.choices = [{id: 'choice1'}];
$scope.addNewChoice = function() {
var newItemNo = $scope.choices.length+1;
$scope.choices.push({'id':'choice'+newItemNo});
};
$scope.removeChoice = function() {
if($scope.choices.length>=2){
var lastItem = $scope.choices.length-1;
$scope.choices.splice(lastItem);
};
};
});
/* -------------------------------
End Custom Part
------------------------------- */
/* -------------------------------
1.0 CONTROLLER - App
------------------------------- */
colorAdminApp.controller('appController', ['$rootScope', '$scope', function($rootScope, $scope) {
$scope.$on('$includeContentLoaded', function() {
App.initComponent();
});
$scope.$on('$viewContentLoaded', function() {
App.initComponent();
App.initLocalStorage();
});
$scope.$on('$stateChangeStart', function() {
// reset layout setting
$rootScope.setting.layout.pageSidebarMinified = false;
$rootScope.setting.layout.pageFixedFooter = false;
$rootScope.setting.layout.pageRightSidebar = false;
$rootScope.setting.layout.pageTwoSidebar = false;
$rootScope.setting.layout.pageTopMenu = false;
$rootScope.setting.layout.pageBoxedLayout = false;
$rootScope.setting.layout.pageWithoutSidebar = false;
$rootScope.setting.layout.pageContentFullHeight = false;
$rootScope.setting.layout.pageContentFullWidth = false;
$rootScope.setting.layout.paceTop = false;
$rootScope.setting.layout.pageLanguageBar = false;
$rootScope.setting.layout.pageSidebarTransparent = false;
$rootScope.setting.layout.pageWideSidebar = false;
$rootScope.setting.layout.pageLightSidebar = false;
$rootScope.setting.layout.pageFooter = false;
$rootScope.setting.layout.pageMegaMenu = false;
$rootScope.setting.layout.pageWithoutHeader = false;
$rootScope.setting.layout.pageBgWhite = false;
App.scrollTop();
$('.pace .pace-progress').addClass('hide');
$('.pace').removeClass('pace-inactive');
});
$scope.$on('$stateChangeSuccess', function() {
Pace.restart();
App.initPageLoad();
App.initSidebarSelection();
App.initLocalStorage();
App.initSidebarMobileSelection();
});
$scope.$on('$stateNotFound', function() {
Pace.stop();
});
$scope.$on('$stateChangeError', function() {
Pace.stop();
});
}]);
/* -------------------------------
2.0 CONTROLLER - Sidebar
------------------------------- */
colorAdminApp.controller('sidebarController', function($scope, $rootScope, $state) {
App.initSidebar();
});
/* -------------------------------
3.0 CONTROLLER - Right Sidebar
------------------------------- */
colorAdminApp.controller('rightSidebarController', function($scope, $rootScope, $state) {
var getRandomValue = function() {
var value = [];
for (var i = 0; i<= 19; i++) {
value.push(Math.floor((Math.random() * 10) + 1));
}
return value;
};
$('.knob').knob();
var blue = '#348fe2', green = '#00acac', purple = '#727cb6', red = '#ff5b57';
var options = { height: '50px', width: '100%', fillColor: 'transparent', type: 'bar', barWidth: 8, barColor: green };
var value = getRandomValue();
$('#sidebar-sparkline-1').sparkline(value, options);
value = getRandomValue();
options.barColor = blue;
$('#sidebar-sparkline-2').sparkline(value, options);
value = getRandomValue();
options.barColor = purple;
$('#sidebar-sparkline-3').sparkline(value, options);
value = getRandomValue();
options.barColor = red;
$('#sidebar-sparkline-4').sparkline(value, options);
});
/* -------------------------------
4.0 CONTROLLER - Header
------------------------------- */
colorAdminApp.controller('headerController', function($scope, $rootScope, $state) {
$scope.logout=function(){
console.log('logout');
localStorage.removeItem('laundry_admin_user_obj');
$state.go('login');
}
});
/* -------------------------------
5.0 CONTROLLER - Top Menu
------------------------------- */
colorAdminApp.controller('topMenuController', function($scope, $rootScope, $state) {
setTimeout(function() {
App.initTopMenu();
}, 0);
});
/* -------------------------------
6.0 CONTROLLER - Page Loader
------------------------------- */
colorAdminApp.controller('pageLoaderController', function($scope, $rootScope, $state) {
App.initPageLoad();
});
/* -------------------------------
7.0 CONTROLLER - Theme Panel
------------------------------- */
colorAdminApp.controller('themePanelController', function($scope, $rootScope, $state) {
App.initThemePanel();
});
/* -------------------------------
8.0 CONTROLLER - Dashboard v1
------------------------------- */
colorAdminApp.controller('dashboardController', function($scope, $rootScope, $state) {
/* Vector Map
------------------------- */
$('#world-map').vectorMap({
map: 'world_mill_en',
scaleColors: ['#e74c3c', '#0071a4'],
normalizeFunction: 'polynomial',
hoverOpacity: 0.5,
hoverColor: false,
markerStyle: {
initial: {
fill: '#4cabc7',
stroke: 'transparent',
r: 3
}
},
regionStyle: {
initial: {
fill: 'rgb(97,109,125)',
"fill-opacity": 1,
stroke: 'none',
"stroke-width": 0.4,
"stroke-opacity": 1
},
hover: { "fill-opacity": 0.8 },
selected: { fill: 'yellow' }
},
focusOn: { x: 0.5, y: 0.5, scale: 0 },
backgroundColor: '#2d353c',
markers: [
{latLng: [41.90, 12.45], name: 'Vatican City'},
{latLng: [43.73, 7.41], name: 'Monaco'},
{latLng: [-0.52, 166.93], name: 'Nauru'},
{latLng: [-8.51, 179.21], name: 'Tuvalu'},
{latLng: [43.93, 12.46], name: 'San Marino'},
{latLng: [47.14, 9.52], name: 'Liechtenstein'},
{latLng: [7.11, 171.06], name: 'Marshall Islands'},
{latLng: [17.3, -62.73], name: 'Saint Kitts and Nevis'},
{latLng: [3.2, 73.22], name: 'Maldives'},
{latLng: [35.88, 14.5], name: 'Malta'},
{latLng: [12.05, -61.75], name: 'Grenada'},
{latLng: [13.16, -61.23], name: 'Saint Vincent and the Grenadines'},
{latLng: [13.16, -59.55], name: 'Barbados'},
{latLng: [17.11, -61.85], name: 'Antigua and Barbuda'},
{latLng: [-4.61, 55.45], name: 'Seychelles'},
{latLng: [7.35, 134.46], name: 'Palau'},
{latLng: [42.5, 1.51], name: 'Andorra'},
{latLng: [14.01, -60.98], name: 'Saint Lucia'},
{latLng: [6.91, 158.18], name: 'Federated States of Micronesia'},
{latLng: [1.3, 103.8], name: 'Singapore'},
{latLng: [1.46, 173.03], name: 'Kiribati'},
{latLng: [-21.13, -175.2], name: 'Tonga'},
{latLng: [15.3, -61.38], name: 'Dominica'},
{latLng: [-20.2, 57.5], name: 'Mauritius'},
{latLng: [26.02, 50.55], name: 'Bahrain'},
{latLng: [0.33, 6.73], name: 'São Tomé and Príncipe'}
]
});
/* Line Chart
------------------------- */
var data1 = [
[1, 40], [2, 50], [3, 60], [4, 60], [5, 60], [6, 65], [7, 75], [8, 90], [9, 100], [10, 105],
[11, 110], [12, 110], [13, 120], [14, 130], [15, 135],[16, 145], [17, 132], [18, 123], [19, 135], [20, 150]
];
var data2 = [
[1, 10], [2, 6], [3, 10], [4, 12], [5, 18], [6, 20], [7, 25], [8, 23], [9, 24], [10, 25],
[11, 18], [12, 30], [13, 25], [14, 25], [15, 30], [16, 27], [17, 20], [18, 18], [19, 31], [20, 23]
];
var xLabel = [
[1,''],[2,''],[3,'May 15'],[4,''],[5,''],[6,'May 19'],[7,''],[8,''],[9,'May 22'],[10,''],
[11,''],[12,'May 25'],[13,''],[14,''],[15,'May 28'],[16,''],[17,''],[18,'May 31'],[19,''],[20,'']
];
$.plot($("#interactive-chart"), [{
data: data1,
label: "Page Views",
color: blue,
lines: { show: true, fill:false, lineWidth: 2 },
points: { show: true, radius: 3, fillColor: '#fff' },
shadowSize: 0
}, {
data: data2,
label: 'Visitors',
color: green,
lines: { show: true, fill:false, lineWidth: 2 },
points: { show: true, radius: 3, fillColor: '#fff' },
shadowSize: 0
}], {
xaxis: { ticks:xLabel, tickDecimals: 0, tickColor: '#ddd' },
yaxis: { ticks: 10, tickColor: '#ddd', min: 0, max: 200 },
grid: {
hoverable: true,
clickable: true,
tickColor: "#ddd",
borderWidth: 1,
backgroundColor: '#fff',
borderColor: '#ddd'
},
legend: {
labelBoxBorderColor: '#ddd',
margin: 10,
noColumns: 1,
show: true
}
});
var previousPoint = null;
$("#interactive-chart").bind("plothover", function (event, pos, item) {
$("#x").text(pos.x.toFixed(2));
$("#y").text(pos.y.toFixed(2));
if (item) {
if (previousPoint !== item.dataIndex) {
previousPoint = item.dataIndex;
$("#tooltip").remove();
var y = item.datapoint[1].toFixed(2);
var content = item.series.label + " " + y;
$('<div id="tooltip" class="flot-tooltip">' + content + '</div>').css({ top: item.pageY - 45, left: item.pageX - 55 }).appendTo("body").fadeIn(200);
}
} else {
$("#tooltip").remove();
previousPoint = null;
}
event.preventDefault();
});
/* Donut Chart
------------------------- */
var donutData = [
{ label: "Chrome", data: 35, color: purpleDark},
{ label: "Firefox", data: 30, color: purple},
{ label: "Safari", data: 15, color: purpleLight},
{ label: "Opera", data: 10, color: blue},
{ label: "IE", data: 5, color: blueDark}
];
$.plot('#donut-chart', donutData, {
series: {
pie: {
innerRadius: 0.5,
show: true,
label: { show: true }
}
},
legend: { show: true }
});
/* Sparkline
------------------------- */
var options = {
height: '50px',
width: '100%',
fillColor: 'transparent',
lineWidth: 2,
spotRadius: '4',
highlightLineColor: blue,
highlightSpotColor: blue,
spotColor: false,
minSpotColor: false,
maxSpotColor: false
};
function renderDashboardSparkline() {
var value = [50,30,45,40,50,20,35,40,50,70,90,40];
options.type = 'line';
options.height = '23px';
options.lineColor = red;
options.highlightLineColor = red;
options.highlightSpotColor = red;
var countWidth = $('#sparkline-unique-visitor').width();
if (countWidth >= 200) {
options.width = '200px';
} else {
options.width = '100%';
}
$('#sparkline-unique-visitor').sparkline(value, options);
options.lineColor = orange;
options.highlightLineColor = orange;
options.highlightSpotColor = orange;
$('#sparkline-bounce-rate').sparkline(value, options);
options.lineColor = green;
options.highlightLineColor = green;
options.highlightSpotColor = green;
$('#sparkline-total-page-views').sparkline(value, options);
options.lineColor = blue;
options.highlightLineColor = blue;
options.highlightSpotColor = blue;
$('#sparkline-avg-time-on-site').sparkline(value, options);
options.lineColor = grey;
options.highlightLineColor = grey;
options.highlightSpotColor = grey;
$('#sparkline-new-visits').sparkline(value, options);
options.lineColor = dark;
options.highlightLineColor = dark;
options.highlightSpotColor = grey;
$('#sparkline-return-visitors').sparkline(value, options);
}
renderDashboardSparkline();
$(window).on('resize', function() {
$('#sparkline-unique-visitor').empty();
$('#sparkline-bounce-rate').empty();
$('#sparkline-total-page-views').empty();
$('#sparkline-avg-time-on-site').empty();
$('#sparkline-new-visits').empty();
$('#sparkline-return-visitors').empty();
renderDashboardSparkline();
});
/* Datepicker
------------------------- */
$('#datepicker-inline').datepicker({ todayHighlight: true });
/* Todolist
------------------------- */
$('[data-click=todolist]').click(function() {
var targetList = $(this).closest('li');
if ($(targetList).hasClass('active')) {
$(targetList).removeClass('active');
} else {
$(targetList).addClass('active');
}
});
/* Gritter Notification
------------------------- */
$(window).load(function() {
setTimeout(function() {
$.gritter.add({
title: 'Welcome back, Admin!',
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus lacus ut lectus rutrum placerat.',
image: 'assets/img/user-2.jpg',
sticky: true,
time: '',
class_name: 'my-sticky-class'
});
}, 1000);
});
});
/* -------------------------------
9.0 CONTROLLER - Dashboard v2
------------------------------- */
colorAdminApp.controller('dashboardV2Controller', function($scope, $rootScope, $state) {
/* Line Chart
------------------------- */
var green = '#0D888B';
var greenLight = '#00ACAC';
var blue = '#3273B1';
var blueLight = '#348FE2';
var blackTransparent = 'rgba(0,0,0,0.6)';
var whiteTransparent = 'rgba(255,255,255,0.4)';
var month = [];
month[0] = "January";
month[1] = "February";
month[2] = "March";
month[3] = "April";
month[4] = "May";
month[5] = "Jun";
month[6] = "July";
month[7] = "August";
month[8] = "September";
month[9] = "October";
month[10] = "November";
month[11] = "December";
Morris.Line({
element: 'visitors-line-chart',
data: [
{x: '2014-02-01', y: 60, z: 30},
{x: '2014-03-01', y: 70, z: 40},
{x: '2014-04-01', y: 40, z: 10},
{x: '2014-05-01', y: 100, z: 70},
{x: '2014-06-01', y: 40, z: 10},
{x: '2014-07-01', y: 80, z: 50},
{x: '2014-08-01', y: 70, z: 40}
],
xkey: 'x',
ykeys: ['y', 'z'],
xLabelFormat: function(x) {
x = month[x.getMonth()];
return x.toString();
},
labels: ['Page Views', 'Unique Visitors'],
lineColors: [green, blue],
pointFillColors: [greenLight, blueLight],
lineWidth: '2px',
pointStrokeColors: [blackTransparent, blackTransparent],
resize: true,
gridTextFamily: 'Open Sans',
gridTextColor: whiteTransparent,
gridTextWeight: 'normal',
gridTextSize: '11px',
gridLineColor: 'rgba(0,0,0,0.5)',
hideHover: 'auto',
});
/* Donut Chart
------------------------- */
var green = '#00acac';
var blue = '#348fe2';
Morris.Donut({
element: 'visitors-donut-chart',
data: [
{label: "New Visitors", value: 900},
{label: "Return Visitors", value: 1200}
],
colors: [green, blue],
labelFamily: 'Open Sans',
labelColor: 'rgba(255,255,255,0.4)',
labelTextSize: '12px',
backgroundColor: '#242a30'
});
/* Vector Map
------------------------- */
map = new jvm.WorldMap({
map: 'world_merc_en',
scaleColors: ['#e74c3c', '#0071a4'],
container: $('#visitors-map'),
normalizeFunction: 'linear',
hoverOpacity: 0.5,
hoverColor: false,
markerStyle: {
initial: {
fill: '#4cabc7',
stroke: 'transparent',
r: 3
}
},
regions: [{ attribute: 'fill' }],
regionStyle: {
initial: {
fill: 'rgb(97,109,125)',
"fill-opacity": 1,
stroke: 'none',
"stroke-width": 0.4,
"stroke-opacity": 1
},
hover: { "fill-opacity": 0.8 },
selected: { fill: 'yellow' }
},
series: {
regions: [{
values: {
IN:'#00acac',
US:'#00acac',
KR:'#00acac'
}
}]
},
focusOn: { x: 0.5, y: 0.5, scale: 2 },
backgroundColor: '#2d353c'
});
/* Calendar
------------------------- */
var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var dayNames = ["S", "M", "T", "W", "T", "F", "S"];
var now = new Date(),
month = now.getMonth() + 1,
year = now.getFullYear();
var events = [[
'2/' + month + '/' + year,
'Popover Title',
'#',
'#00acac',
'Some contents here'
], [
'5/' + month + '/' + year,
'Tooltip with link',
'http://www.seantheme.com/color-admin-v1.3',
'#2d353c'
], [
'18/' + month + '/' + year,
'Popover with HTML Content',
'#',
'#2d353c',
'Some contents here <div class="text-right"><a href="http://www.google.com">view more >>></a></div>'
], [
'28/' + month + '/' + year,
'Color Admin V1.3 Launched',
'http://www.seantheme.com/color-admin-v1.3',
'#2d353c',
]];
var calendarTarget = $('#schedule-calendar');
$(calendarTarget).calendar({
months: monthNames,
days: dayNames,
events: events,
popover_options:{
placement: 'top',
html: true
}
});
$(calendarTarget).find('td.event').each(function() {
var backgroundColor = $(this).css('background-color');
$(this).removeAttr('style');
$(this).find('a').css('background-color', backgroundColor);
});
$(calendarTarget).find('.icon-arrow-left, .icon-arrow-right').parent().on('click', function() {
$(calendarTarget).find('td.event').each(function() {
var backgroundColor = $(this).css('background-color');
$(this).removeAttr('style');
$(this).find('a').css('background-color', backgroundColor);
});
});
/* Gritter Notification
------------------------- */
setTimeout(function() {
$.gritter.add({
title: 'Welcome back, Admin!',
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus lacus ut lectus rutrum placerat.',
image: 'assets/img/user-14.jpg',
sticky: true,
time: '',
class_name: 'my-sticky-class'
});
}, 1000);
});
/* -------------------------------
10.0 CONTROLLER - Email Inbox v1
------------------------------- */
colorAdminApp.controller('emailInboxController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageContentFullWidth = true;
/* Email Select All
------------------------- */
$('[data-click=email-select-all]').click(function(e) {
e.preventDefault();
if ($(this).closest('tr').hasClass('active')) {
$('.table-email tr').removeClass('active');
} else {
$('.table-email tr').addClass('active');
}
});
/* Email Select Single
------------------------- */
$('[data-click=email-select-single]').click(function(e) {
e.preventDefault();
var targetRow = $(this).closest('tr');
if ($(targetRow).hasClass('active')) {
$(targetRow).removeClass('active');
} else {
$(targetRow).addClass('active');
}
});
/* Email Remove
------------------------- */
$('[data-click=email-remove]').click(function(e) {
e.preventDefault();
var targetRow = $(this).closest('tr');
$(targetRow).fadeOut().remove();
});
/* Email Highlight
------------------------- */
$('[data-click=email-highlight]').click(function(e) {
e.preventDefault();
if ($(this).hasClass('text-danger')) {
$(this).removeClass('text-danger');
} else {
$(this).addClass('text-danger');
}
});
});
/* -------------------------------
11.0 CONTROLLER - Email Inbox v2
------------------------------- */
colorAdminApp.controller('emailInboxV2Controller', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageContentFullWidth = true;
/* Email Checkbox
------------------------- */
$('[data-checked=email-checkbox]').live('click', function() {
var targetLabel = $(this).closest('label');
var targetEmailList = $(this).closest('li');
if ($(this).prop('checked')) {
$(targetLabel).addClass('active');
$(targetEmailList).addClass('selected');
} else {
$(targetLabel).removeClass('active');
$(targetEmailList).removeClass('selected');
}
if ($('[data-checked=email-checkbox]:checked').length !== 0) {
$('[data-email-action]').removeClass('hide');
} else {
$('[data-email-action]').addClass('hide');
}
});
/* Email Action
------------------------- */
$('[data-email-action]').live('click', function() {
var targetEmailList = '[data-checked=email-checkbox]:checked';
if ($(targetEmailList).length !== 0) {
$(targetEmailList).closest('li').slideToggle(function() {
$(this).remove();
if ($('[data-checked=email-checkbox]:checked').length !== 0) {
$('[data-email-action]').removeClass('hide');
} else {
$('[data-email-action]').addClass('hide');
}
});
}
});
});
/* -------------------------------
12.0 CONTROLLER - Email Compose
------------------------------- */
colorAdminApp.controller('emailComposeController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageContentFullWidth = true;
/* jQuery TagIt
------------------------- */
$('#email-to').tagit({
availableTags: ["c++", "java", "php", "javascript", "ruby", "python", "c"]
});
/* WYSIHTML5
------------------------- */
$('#wysihtml5').wysihtml5();
});
/* -------------------------------
13.0 CONTROLLER - Email Detail
------------------------------- */
colorAdminApp.controller('emailDetailController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageContentFullWidth = true;
});
/* -------------------------------
14.0 CONTROLLER - UI Modal & Notifications
------------------------------- */
colorAdminApp.controller('uiModalNotificationController', function($scope, $rootScope, $state) {
/* Gritter Notification
------------------------- */
$('#add-sticky').click( function() {
$.gritter.add({
title: 'This is a sticky notice!',
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tempus lacus ut lectus rutrum placerat. ',
image: 'assets/img/user-2.jpg',
sticky: true,
time: '',
class_name: 'my-sticky-class'
});
return false;
});
$('#add-regular').click( function() {
$.gritter.add({
title: 'This is a regular notice!',
text: 'This will fade out after a certain amount of time. Sed tempus lacus ut lectus rutrum placerat. ',
image: 'assets/img/user-3.jpg',
sticky: false,
time: ''
});
return false;
});
$('#add-max').click( function() {
$.gritter.add({
title: 'This is a notice with a max of 3 on screen at one time!',
text: 'This will fade out after a certain amount of time. Sed tempus lacus ut lectus rutrum placerat. ',
sticky: false,
image: 'assets/img/user-4.jpg',
before_open: function() {
if($('.gritter-item-wrapper').length === 3) {
return false;
}
}
});
return false;
});
$('#add-without-image').click(function(){
$.gritter.add({
title: 'This is a notice without an image!',
text: 'This will fade out after a certain amount of time.'
});
return false;
});
$('#add-gritter-light').click(function(){
$.gritter.add({
title: 'This is a light notification',
text: 'Just add a "gritter-light" class_name to your $.gritter.add or globally to $.gritter.options.class_name',
class_name: 'gritter-light'
});
return false;
});
$('#add-with-callbacks').click(function(){
$.gritter.add({
title: 'This is a notice with callbacks!',
text: 'The callback is...',
before_open: function(){
alert('I am called before it opens');
},
after_open: function(e){
alert("I am called after it opens: \nI am passed the jQuery object for the created Gritter element...\n" + e);
},
before_close: function(manual_close) {
var manually = (manual_close) ? 'The "X" was clicked to close me!' : '';
alert("I am called before it closes: I am passed the jQuery object for the Gritter element... \n" + manually);
},
after_close: function(manual_close){
var manually = (manual_close) ? 'The "X" was clicked to close me!' : '';
alert('I am called after it closes. ' + manually);
}
});
return false;
});
$('#add-sticky-with-callbacks').click(function(){
$.gritter.add({
title: 'This is a sticky notice with callbacks!',
text: 'Sticky sticky notice.. sticky sticky notice...',
sticky: true,
before_open: function(){
alert('I am a sticky called before it opens');
},
after_open: function(e){
alert("I am a sticky called after it opens: \nI am passed the jQuery object for the created Gritter element...\n" + e);
},
before_close: function(e){
alert("I am a sticky called before it closes: I am passed the jQuery object for the Gritter element... \n" + e);
},
after_close: function(){
alert('I am a sticky called after it closes');
}
});
return false;
});
$("#remove-all").click(function(){
$.gritter.removeAll();
return false;
});
$("#remove-all-with-callbacks").click(function(){
$.gritter.removeAll({
before_close: function(e){
alert("I am called before all notifications are closed. I am passed the jQuery object containing all of Gritter notifications.\n" + e);
},
after_close: function(){
alert('I am called after everything has been closed.');
}
});
return false;
});
});
/* -------------------------------
15.0 CONTROLLER - UI Tree
------------------------------- */
colorAdminApp.controller('uiTreeController', function($scope, $rootScope, $state) {
$('#jstree-default').jstree({
"core": {
"themes": {
"responsive": false
}
},
"types": {
"default": {
"icon": "fa fa-folder text-warning fa-lg"
},
"file": {
"icon": "fa fa-file text-inverse fa-lg"
}
},
"plugins": ["types"]
});
$('#jstree-default').on('select_node.jstree', function(e,data) {
var link = $('#' + data.selected).find('a');
if (link.attr("href") != "#" && link.attr("href") != "javascript:;" && link.attr("href") != "") {
if (link.attr("target") == "_blank") {
link.attr("href").target = "_blank";
}
document.location.href = link.attr("href");
return false;
}
});
$('#jstree-checkable').jstree({
'plugins': ["wholerow", "checkbox", "types"],
'core': {
"themes": {
"responsive": false
},
'data': [{
"text": "Same but with checkboxes",
"children": [{
"text": "initially selected",
"state": { "selected": true }
}, {
"text": "Folder 1"
}, {
"text": "Folder 2"
}, {
"text": "Folder 3"
}, {
"text": "initially open",
"icon": "fa fa-folder fa-lg",
"state": {
"opened": true
},
"children": [{
"text": "Another node"
}, {
"text": "disabled node",
"state": {
"disabled": true
}
}]
}, {
"text": "custom icon",
"icon": "fa fa-cloud-download fa-lg text-inverse"
}, {
"text": "disabled node",
"state": {
"disabled": true
}
}
]},
"Root node 2"
]},
"types": {
"default": {
"icon": "fa fa-folder text-primary fa-lg"
},
"file": {
"icon": "fa fa-file text-success fa-lg"
}
}
});
$("#jstree-drag-and-drop").jstree({
"core": {
"themes": {
"responsive": false
},
"check_callback": true,
'data': [{
"text": "Parent Node",
"children": [{
"text": "Initially selected",
"state": {
"selected": true
}
}, {
"text": "Folder 1"
}, {
"text": "Folder 2"
}, {
"text": "Folder 3"
}, {
"text": "Initially open",
"icon": "fa fa-folder text-success fa-lg",
"state": {
"opened": true
},
"children": [
{"text": "Disabled node", "disabled": true},
{"text": "Another node"}
]
}, {
"text": "Another Custom Icon",
"icon": "fa fa-cog text-inverse fa-lg"
}, {
"text": "Disabled Node",
"state": {
"disabled": true
}
}, {
"text": "Sub Nodes",
"icon": "fa fa-folder text-danger fa-lg",
"children": [
{"text": "Item 1", "icon": "fa fa-file fa-lg"},
{"text": "Item 2", "icon": "fa fa-file fa-lg"},
{"text": "Item 3", "icon": "fa fa-file fa-lg"},
{"text": "Item 4", "icon": "fa fa-file fa-lg"},
{"text": "Item 5", "icon": "fa fa-file fa-lg"}
]
}]
},
"Another Node"
]
},
"types": {
"default": {
"icon": "fa fa-folder text-warning fa-lg"
},
"file": {
"icon": "fa fa-file text-warning fa-lg"
}
},
"state": { "key": "demo2" },
"plugins": [ "contextmenu", "dnd", "state", "types" ]
});
$('#jstree-ajax').jstree({
"core": {
"themes": { "responsive": false },
"check_callback": true,
'data': {
'url': function (node) {
return node.id === '#' ? 'assets/plugins/jstree/demo/data_root.json': 'assets/plugins/jstree/demo/' + node.original.file;
},
'data': function (node) {
return { 'id': node.id };
},
"dataType": "json"
}
},
"types": {
"default": { "icon": "fa fa-folder text-warning fa-lg" },
"file": { "icon": "fa fa-file text-warning fa-lg" }
},
"plugins": [ "dnd", "state", "types" ]
});
});
/* -------------------------------
16.0 CONTROLLER - UI Language Bar
------------------------------- */
colorAdminApp.controller('uiLanguageBarIconController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageLanguageBar = true;
});
/* -------------------------------
17.0 CONTROLLER - Form Plugins
------------------------------- */
colorAdminApp.controller('formPluginsController', function($scope, $rootScope, $state) {
/* Datepicker
------------------------- */
$('#datepicker-default').datepicker({
todayHighlight: true
});
$('#datepicker-inline').datepicker({
todayHighlight: true
});
$('.input-daterange').datepicker({
todayHighlight: true
});
$('#datepicker-disabled-past').datepicker({
todayHighlight: true
});
$('#datepicker-autoClose').datepicker({
todayHighlight: true,
autoclose: true
});
/* Ion Range Slider
------------------------- */
$('#default_rangeSlider').ionRangeSlider({
min: 0,
max: 5000,
type: 'double',
prefix: "$",
maxPostfix: "+",
prettify: false,
hasGrid: true
});
$('#customRange_rangeSlider').ionRangeSlider({
min: 1000,
max: 100000,
from: 30000,
to: 90000,
type: 'double',
step: 500,
postfix: " €",
hasGrid: true
});
$('#customValue_rangeSlider').ionRangeSlider({
values: [
'January', 'February', 'March',
'April', 'May', 'June',
'July', 'August', 'September',
'October', 'November', 'December'
],
type: 'single',
hasGrid: true
});
/* Masked Input
------------------------- */
$("#masked-input-date").mask("99/99/9999");
$("#masked-input-phone").mask("(999) 999-9999");
$("#masked-input-tid").mask("99-9999999");
$("#masked-input-ssn").mask("999-99-9999");
$("#masked-input-pno").mask("aaa-9999-a");
$("#masked-input-pkey").mask("a*-999-a999");
/* Colorpicker
------------------------- */
$('#colorpicker').colorpicker({format: 'hex'});
$('#colorpicker-prepend').colorpicker({format: 'hex'});
$('#colorpicker-rgba').colorpicker();
/* Timepicker
------------------------- */
$('#timepicker').timepicker();
/* Password Indicator
------------------------- */
$('#password-indicator-default').passwordStrength();
$('#password-indicator-visible').passwordStrength({targetDiv: '#passwordStrengthDiv2'});
/* jQuery Autocomplete
------------------------- */
var availableTags = [
'ActionScript',
'AppleScript',
'Asp',
'BASIC',
'C',
'C++',
'Clojure',
'COBOL',
'ColdFusion',
'Erlang',
'Fortran',
'Groovy',
'Haskell',
'Java',
'JavaScript',
'Lisp',
'Perl',
'PHP',
'Python',
'Ruby',
'Scala',
'Scheme'
];
$('#jquery-autocomplete').autocomplete({
source: availableTags
});
/* Combobox
------------------------- */
$('.combobox').combobox();
/* Bootstrap TagsInput
------------------------- */
$('.bootstrap-tagsinput input').focus(function() {
$(this).closest('.bootstrap-tagsinput').addClass('bootstrap-tagsinput-focus');
});
$('.bootstrap-tagsinput input').focusout(function() {
$(this).closest('.bootstrap-tagsinput').removeClass('bootstrap-tagsinput-focus');
});
/* Selectpicker
------------------------- */
$('.selectpicker').selectpicker('render');
/* jQuery Tagit
------------------------- */
$('#jquery-tagIt-default').tagit({
availableTags: ["c++", "java", "php", "javascript", "ruby", "python", "c"]
});
$('#jquery-tagIt-inverse').tagit({
availableTags: ["c++", "java", "php", "javascript", "ruby", "python", "c"]
});
$('#jquery-tagIt-white').tagit({
availableTags: ["c++", "java", "php", "javascript", "ruby", "python", "c"]
});
$('#jquery-tagIt-primary').tagit({
availableTags: ["c++", "java", "php", "javascript", "ruby", "python", "c"]
});
$('#jquery-tagIt-info').tagit({
availableTags: ["c++", "java", "php", "javascript", "ruby", "python", "c"]
});
$('#jquery-tagIt-success').tagit({
availableTags: ["c++", "java", "php", "javascript", "ruby", "python", "c"]
});
$('#jquery-tagIt-warning').tagit({
availableTags: ["c++", "java", "php", "javascript", "ruby", "python", "c"]
});
$('#jquery-tagIt-danger').tagit({
availableTags: ["c++", "java", "php", "javascript", "ruby", "python", "c"]
});
/* Date Range Picker
------------------------- */
$('#default-daterange').daterangepicker({
opens: 'right',
format: 'MM/DD/YYYY',
separator: ' to ',
startDate: moment().subtract('days', 29),
endDate: moment(),
minDate: '01/01/2012',
maxDate: '12/31/2018',
},
function (start, end) {
$('#default-daterange input').val(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
});
$('#advance-daterange span').html(moment().subtract('days', 29).format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
$('#advance-daterange').daterangepicker({
format: 'MM/DD/YYYY',
startDate: moment().subtract(29, 'days'),
endDate: moment(),
minDate: '01/01/2012',
maxDate: '12/31/2015',
dateLimit: { days: 60 },
showDropdowns: true,
showWeekNumbers: true,
timePicker: false,
timePickerIncrement: 1,
timePicker12Hour: true,
ranges: {
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
},
opens: 'right',
drops: 'down',
buttonClasses: ['btn', 'btn-sm'],
applyClass: 'btn-primary',
cancelClass: 'btn-default',
separator: ' to ',
locale: {
applyLabel: 'Submit',
cancelLabel: 'Cancel',
fromLabel: 'From',
toLabel: 'To',
customRangeLabel: 'Custom',
daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr','Sa'],
monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
firstDay: 1
}
}, function(start, end, label) {
$('#advance-daterange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
});
/* Select2
------------------------- */
$(".default-select2").select2();
$(".multiple-select2").select2({ placeholder: "Select a state" });
/* DateTimepicker
------------------------- */
$('#datetimepicker1').datetimepicker();
$('#datetimepicker2').datetimepicker({
format: 'LT'
});
$('#datetimepicker3').datetimepicker();
$('#datetimepicker4').datetimepicker();
$("#datetimepicker3").on("dp.change", function (e) {
$('#datetimepicker4').data("DateTimePicker").minDate(e.date);
});
$("#datetimepicker4").on("dp.change", function (e) {
$('#datetimepicker3').data("DateTimePicker").maxDate(e.date);
});
});
/* -------------------------------
18.0 CONTROLLER - Form Slider + Switcher
------------------------------- */
colorAdminApp.controller('formSliderSwitcherController', function($scope, $rootScope, $state) {
var green = '#00acac',
red = '#ff5b57',
blue = '#348fe2',
purple = '#727cb6',
orange = '#f59c1a',
black = '#2d353c';
if ($('[data-render=switchery]').length !== 0) {
$('[data-render=switchery]').each(function() {
var themeColor = green;
if ($(this).attr('data-theme')) {
switch ($(this).attr('data-theme')) {
case 'red':
themeColor = red;
break;
case 'blue':
themeColor = blue;
break;
case 'purple':
themeColor = purple;
break;
case 'orange':
themeColor = orange;
break;
case 'black':
themeColor = black;
break;
}
}
var option = {};
option.color = themeColor;
option.secondaryColor = ($(this).attr('data-secondary-color')) ? $(this).attr('data-secondary-color') : '#dfdfdf';
option.className = ($(this).attr('data-classname')) ? $(this).attr('data-classname') : 'switchery';
option.disabled = ($(this).attr('data-disabled')) ? true : false;
option.disabledOpacity = ($(this).attr('data-disabled-opacity')) ? $(this).attr('data-disabled-opacity') : 0.5;
option.speed = ($(this).attr('data-speed')) ? $(this).attr('data-speed') : '0.5s';
var switchery = new Switchery(this, option);
});
}
$('[data-click="check-switchery-state"]').live('click', function() {
alert($('[data-id="switchery-state"]').prop('checked'));
});
$('[data-change="check-switchery-state-text"]').live('change', function() {
$('[data-id="switchery-state-text"]').text($(this).prop('checked'));
});
if ($('[data-render="powerange-slider"]').length !== 0) {
$('[data-render="powerange-slider"]').each(function() {
var option = {};
option.decimal = ($(this).attr('data-decimal')) ? $(this).attr('data-decimal') : false;
option.disable = ($(this).attr('data-disable')) ? $(this).attr('data-disable') : false;
option.disableOpacity = ($(this).attr('data-disable-opacity')) ? $(this).attr('data-disable-opacity') : 0.5;
option.hideRange = ($(this).attr('data-hide-range')) ? $(this).attr('data-hide-range') : false;
option.klass = ($(this).attr('data-class')) ? $(this).attr('data-class') : '';
option.min = ($(this).attr('data-min')) ? $(this).attr('data-min') : 0;
option.max = ($(this).attr('data-max')) ? $(this).attr('data-max') : 100;
option.start = ($(this).attr('data-start')) ? $(this).attr('data-start') : null;
option.step = ($(this).attr('data-step')) ? $(this).attr('data-step') : null;
option.vertical = ($(this).attr('data-vertical')) ? $(this).attr('data-vertical') : false;
if ($(this).attr('data-height')) {
$(this).closest('.slider-wrapper').height($(this).attr('data-height'));
}
var switchery = new Switchery(this, option);
var powerange = new Powerange(this, option);
});
}
});
/* -------------------------------
19.0 CONTROLLER - Form Validation
------------------------------- */
colorAdminApp.controller('formValidationController', function($scope, $rootScope, $state) {
$scope.submitForm = function(form) {
if (!form.$valid) {
$('form[name="'+ form.$name +'"] *').tooltip('destroy');
angular.forEach(form.$error, function(field) {
angular.forEach(field, function(errorField) {
errorField.$setTouched();
var targetContainer = 'form[name="'+ form.$name +'"] [name="'+ errorField.$name +'"]';
var targetMessage = (errorField.$error.required) ? 'This is required' : '';
targetMessage = (errorField.$error.email) ? 'Invalid email' : targetMessage;
targetMessage = (errorField.$error.url) ? 'Invalid website url' : targetMessage;
targetMessage = (errorField.$error.number) ? 'Only number is allowed' : targetMessage;
targetMessage = (errorField.$name == 'alphabets') ? 'Only alphabets is allowed' : targetMessage;
targetMessage = (errorField.$error.minlength) ? 'You must provide at least 20 characters for this field' : targetMessage;
targetMessage = (errorField.$error.maxlength) ? 'You must not exceed the maximum of 200 characters for this field' : targetMessage;
$(targetContainer).first().tooltip({
placement: 'top',
trigger: 'normal',
title: targetMessage,
container: 'body',
animation: false
});
$(targetContainer).first().tooltip('show');
});
});
}
};
});
/* -------------------------------
20.0 CONTROLLER - Table Manage Default
------------------------------- */
colorAdminApp.controller('tableManageDefaultController', function($scope, $rootScope, $state) {
if ($('#data-table').length !== 0) {
$('#data-table').DataTable({
responsive: true
});
}
});
/* -------------------------------
21.0 CONTROLLER - Table Manage Autofill
------------------------------- */
colorAdminApp.controller('tableManageAutofillController', function($scope, $rootScope, $state) {
if ($('#data-table').length !== 0) {
$('#data-table').DataTable({
autoFill: true,
responsive: true
});
}
});
/* -------------------------------
22.0 CONTROLLER - Table Manage Buttons
------------------------------- */
colorAdminApp.controller('tableManageButtonsController', function($scope, $rootScope, $state) {
if ($('#data-table').length !== 0) {
$('#data-table').DataTable({
dom: 'Bfrtip',
buttons: [
{ extend: 'copy', className: 'btn-sm' },
{ extend: 'csv', className: 'btn-sm' },
{ extend: 'excel', className: 'btn-sm' },
{ extend: 'pdf', className: 'btn-sm' },
{ extend: 'print', className: 'btn-sm' }
],
responsive: true
});
}
});
/* -------------------------------
23.0 CONTROLLER - Table Manage ColReorder
------------------------------- */
colorAdminApp.controller('tableManageColReorderController', function($scope, $rootScope, $state) {
if ($('#data-table').length !== 0) {
$('#data-table').DataTable({
colReorder: true,
responsive: true
});
}
});
/* -------------------------------
24.0 CONTROLLER - Table Manage Fixed Columns
------------------------------- */
colorAdminApp.controller('tableManageFixedColumnsController', function($scope, $rootScope, $state) {
if ($('#data-table').length !== 0) {
$('#data-table').DataTable({
scrollY: 300,
scrollX: true,
scrollCollapse: true,
paging: false,
fixedColumns: true,
responsive: true
});
}
});
/* -------------------------------
25.0 CONTROLLER - Table Manage Fixed Header
------------------------------- */
colorAdminApp.controller('tableManageFixedHeaderController', function($scope, $rootScope, $state) {
if ($('#data-table').length !== 0) {
$('#data-table').DataTable({
lengthMenu: [20, 40, 60],
fixedHeader: {
header: true,
headerOffset: $('#header').height()
},
responsive: true
});
}
});
/* -------------------------------
26.0 CONTROLLER - Table Manage KeyTable
------------------------------- */
colorAdminApp.controller('tableManageKeyTableController', function($scope, $rootScope, $state) {
if ($('#data-table').length !== 0) {
$('#data-table').DataTable({
scrollY: 300,
paging: false,
autoWidth: true,
keys: true,
responsive: true
});
}
});
/* -------------------------------
27.0 CONTROLLER - Table Manage Responsive
------------------------------- */
colorAdminApp.controller('tableManageResponsiveController', function($scope, $rootScope, $state) {
});
/* -------------------------------
28.0 CONTROLLER - Table Manage RowReorder
------------------------------- */
colorAdminApp.controller('tableManageRowReorderController', function($scope, $rootScope, $state) {
if ($('#data-table').length !== 0) {
$('#data-table').DataTable({
responsive: true,
rowReorder: true
});
}
});
/* -------------------------------
29.0 CONTROLLER - Table Manage Scroller
------------------------------- */
colorAdminApp.controller('tableManageScrollerController', function($scope, $rootScope, $state) {
if ($('#data-table').length !== 0) {
$('#data-table').DataTable({
ajax: "assets/plugins/DataTables/json/scroller-demo.json",
deferRender: true,
scrollY: 300,
scrollCollapse: true,
scroller: true,
responsive: true
});
}
});
/* -------------------------------
30.0 CONTROLLER - Table Manage Select
------------------------------- */
colorAdminApp.controller('tableManageSelectController', function($scope, $rootScope, $state) {
if ($('#data-table').length !== 0) {
$('#data-table').DataTable({
select: true,
responsive: true
});
}
});
/* -------------------------------
31.0 CONTROLLER - Table Manage Extension Combination
------------------------------- */
colorAdminApp.controller('tableManageCombineController', function($scope, $rootScope, $state) {
if ($('#data-table').length !== 0) {
$('#data-table').DataTable({
dom: 'lBfrtip',
buttons: [
{ extend: 'copy', className: 'btn-sm' },
{ extend: 'csv', className: 'btn-sm' },
{ extend: 'excel', className: 'btn-sm' },
{ extend: 'pdf', className: 'btn-sm' },
{ extend: 'print', className: 'btn-sm' }
],
responsive: true,
autoFill: true,
colReorder: true,
keys: true,
rowReorder: true,
select: true
});
}
});
/* -------------------------------
32.0 CONTROLLER - Flot Chart
------------------------------- */
colorAdminApp.controller('chartFlotController', function($scope, $rootScope, $state) {
/* Basic Chart
------------------------- */
var d1 = [], d2 = [], d3 = [];
for (var x = 0; x < Math.PI * 2; x += 0.25) {
d1.push([x, Math.sin(x)]);
d2.push([x, Math.cos(x)]);
var z = x - 0.15;
d3.push([z, Math.tan(z)]);
}
var basicChartData = [
{ label: "data 1", data: d1, color: purple, shadowSize: 0 },
{ label: "data 2", data: d2, color: green, shadowSize: 0 },
{ label: "data 3", data: d3, color: dark, shadowSize: 0 }
];
var basicChartOptions = {
series: {
lines: { show: true },
points: { show: false }
},
xaxis: {
tickColor: '#ddd'
},
yaxis: {
min: -2,
max: 2,
tickColor: '#ddd'
},
grid: {
borderColor: '#ddd',
borderWidth: 1
}
}
this.basicChartData = basicChartData;
this.basicChartOptions = basicChartOptions;
/* Stacked Chart
------------------------- */
var d1 = [], d2 = [], d3 = [], d4 = [], d5 = [], d6 = [];
for (var a = 0; a <= 5; a += 1) {
d1.push([a, parseInt(Math.random() * 5)]);
d2.push([a, parseInt(Math.random() * 5 + 5)]);
d3.push([a, parseInt(Math.random() * 5 + 5)]);
d4.push([a, parseInt(Math.random() * 5 + 5)]);
d5.push([a, parseInt(Math.random() * 5 + 5)]);
d6.push([a, parseInt(Math.random() * 5 + 5)]);
}
var ticksLabel = [[0, "Monday"], [1, "Tuesday"], [2, "Wednesday"], [3, "Thursday"], [4, "Friday"], [5, "Saturday"]];
var stackedChartOptions = {
xaxis: { tickColor: 'transparent', ticks: ticksLabel},
yaxis: { tickColor: '#ddd', ticksLength: 10},
grid: { hoverable: true, tickColor: "#ccc", borderWidth: 0, borderColor: 'rgba(0,0,0,0.2)' },
series: {
stack: true,
lines: { show: false, fill: false, steps: false },
bars: { show: true, barWidth: 0.5, align: 'center', fillColor: null },
highlightColor: 'rgba(0,0,0,0.8)'
},
legend: { show: true, labelBoxBorderColor: '#ccc', position: 'ne', noColumns: 1 }
};
var stackedChartData = [
{ data:d1, color: purpleDark, label: 'China', bars: { fillColor: purpleDark } },
{ data:d2, color: purple, label: 'Russia', bars: { fillColor: purple } },
{ data:d3, color: purpleLight, label: 'Canada', bars: { fillColor: purpleLight } },
{ data:d4, color: blueDark, label: 'Japan', bars: { fillColor: blueDark } },
{ data:d5, color: blue, label: 'USA', bars: { fillColor: blue } },
{ data:d6, color: blueLight, label: 'Others', bars: { fillColor: blueLight } }
];
var previousXValue = null;
var previousYValue = null;
$("#stacked-chart").bind("plothover", function (event, pos, item) {
if (item) {
var y = item.datapoint[1] - item.datapoint[2];
if (previousXValue != item.series.label || y != previousYValue) {
previousXValue = item.series.label;
previousYValue = y;
$("#tooltip").remove();
$('<div id="tooltip" class="flot-tooltip">' + item.series.label + '</div>').css({ top: item.pageY, left: item.pageX + 35 }).appendTo("body").fadeIn(200);
}
} else {
$("#tooltip").remove();
previousXValue = null;
previousYValue = null;
}
});
this.stackedChartOptions = stackedChartOptions;
this.stackedChartData = stackedChartData;
/* Tracking Chart
------------------------- */
var sin = [], cos = [];
for (var i = 0; i < 14; i += 0.1) {
sin.push([i, Math.sin(i)]);
cos.push([i, Math.cos(i)]);
}
var trackingChartData = [
{ data: sin, label: "Series1", color: dark, shadowSize: 0},
{ data: cos, label: "Series2", color: red, shadowSize: 0}
];
var trackingChartOptions = {
series: { lines: { show: true } },
crosshair: { mode: "x", color: grey },
grid: { hoverable: true, autoHighlight: false, borderColor: '#ccc', borderWidth: 0 },
xaxis: { tickLength: 0 },
yaxis: { tickColor: '#ddd' },
legend: {
labelBoxBorderColor: '#ddd',
backgroundOpacity: 0.4,
color:'#fff',
show: true
}
};
this.trackingChartData = trackingChartData;
this.trackingChartOptions = trackingChartOptions;
/* Bar Chart
------------------------- */
var barChartData = [{
data: [ ["January", 10], ["February", 8], ["March", 4], ["April", 13], ["May", 17], ["June", 9] ],
color: purple
}];
var barChartOptions = {
series: {
bars: {
show: true, barWidth: 0.4, align: 'center', fill: true, fillColor: purple, zero: true
}
},
xaxis: { mode: "categories", tickColor: '#ddd', tickLength: 0 },
grid: { borderWidth: 0 }
};
this.barChartData = barChartData;
this.barChartOptions = barChartOptions;
/* Pie Chart
------------------------- */
var pieChartData = [];
var series = 3;
var colorArray = [purple, dark, grey];
for (var i=0; i<series; i++) {
pieChartData[i] = { label: "Series"+(i+1), data: Math.floor(Math.random()*100)+1, color: colorArray[i] };
}
var pieChartOptions = {
series: {
pie: {
show: true
}
},
grid: { hoverable: true, clickable: true },
legend: { labelBoxBorderColor: '#ddd', backgroundColor: 'none' }
};
this.pieChartData = pieChartData;
this.pieChartOptions = pieChartOptions;
/* Donut Chart
------------------------- */
var donutChartData = [];
var donutChartOptions = {
series: {
pie: {
innerRadius: 0.5,
show: true,
combine: { color: '#999', threshold: 0.1 }
}
},
grid:{ borderWidth:0, hoverable: true, clickable: true },
legend: { show: false }
};
var colorArray = [dark, green, purple];
var nameArray = ['Unique Visitor', 'Bounce Rate', 'Total Page Views', 'Avg Time On Site'];
var dataArray = [20,14,12,31];
for( var i = 0; i<3; i++) {
donutChartData[i] = { label: nameArray[i], data: dataArray[i], color: colorArray[i] };
}
this.donutChartData = donutChartData;
this.donutChartOptions = donutChartOptions;
/* Interactive Chart
------------------------- */
var interactiveChartOptions = {
xaxis: { tickColor: '#ddd',tickSize: 2 },
yaxis: { tickColor: '#ddd', tickSize: 20 },
grid: { hoverable: true, clickable: true, tickColor: "#ccc", borderWidth: 1, borderColor: '#ddd' },
legend: { labelBoxBorderColor: '#ddd', margin: 0, noColumns: 1, show: true }
};
var d1 = [[0, 42], [1, 53], [2,66], [3, 60], [4, 68], [5, 66], [6,71],[7, 75], [8, 69], [9,70], [10, 68], [11, 72], [12, 78], [13, 86]];
var d2 = [[0, 12], [1, 26], [2,13], [3, 18], [4, 35], [5, 23], [6, 18],[7, 35], [8, 24], [9,14], [10, 14], [11, 29], [12, 30], [13, 43]];
var interactiveChartData = [{
data: d1,
label: "Page Views",
color: purple,
lines: { show: true, fill:false, lineWidth: 2 },
points: { show: false, radius: 5, fillColor: '#fff' },
shadowSize: 0
}, {
data: d2,
label: 'Visitors',
color: green,
lines: { show: true, fill:false, lineWidth: 2, fillColor: '' },
points: { show: false, radius: 3, fillColor: '#fff' },
shadowSize: 0
}];
this.interactiveChartOptions = interactiveChartOptions;
this.interactiveChartData = interactiveChartData;
var previousPoint = null;
$("#interactive-chart").bind("plothover", function (event, pos, item) {
$("#x").text(pos.x.toFixed(2));
$("#y").text(pos.y.toFixed(2));
if (item) {
if (previousPoint !== item.dataIndex) {
previousPoint = item.dataIndex;
$("#tooltip").remove();
var y = item.datapoint[1].toFixed(2);
var content = item.series.label + " " + y;
$('<div id="tooltip" class="flot-tooltip">' + content + '</div>').css({ top: item.pageY - 45, left: item.pageX - 55 }).appendTo("body").fadeIn(200);
}
} else {
$("#tooltip").remove();
previousPoint = null;
}
event.preventDefault();
});
/* Live Updated Chart
------------------------- */
function update() {
plot.setData([ getRandomData() ]);
plot.draw();
setTimeout(update, updateInterval);
}
function getRandomData() {
if (data.length > 0) {
data = data.slice(1);
}
while (data.length < totalPoints) {
var prev = data.length > 0 ? data[data.length - 1] : 50;
var y = prev + Math.random() * 10 - 5;
y = (y < 0) ? 0 : y;
y = (y > 100) ? 100 : y;
data.push(y);
}
var res = [];
for (var i = 0; i < data.length; ++i) {
res.push([i, data[i]]);
}
return res;
}
var data = [], totalPoints = 150;
var updateInterval = 1000;
$("#updateInterval").val(updateInterval).change(function () {
var v = $(this).val();
if (v && !isNaN(+v)) {
updateInterval = +v;
updateInterval = (updateInterval < 1) ? 1 : updateInterval;
updateInterval = (updateInterval > 2000) ? 2000 : updateInterval;
$(this).val("" + updateInterval);
}
});
var options = {
series: { shadowSize: 0, color: purple, lines: { show: true, fill:true } }, // drawing is faster without shadows
yaxis: { min: 0, max: 100, tickColor: '#ddd' },
xaxis: { show: true, tickColor: '#ddd' },
grid: { borderWidth: 1, borderColor: '#ddd' }
};
var plot = $.plot($("#live-updated-chart"), [ getRandomData() ], options);
update();
});
/* -------------------------------
33.0 CONTROLLER - Morris Chart
------------------------------- */
colorAdminApp.controller('chartMorrisController', function($scope, $rootScope, $state) {
/* Morris Line Chart
------------------------- */
var tax_data = [
{"period": "2011 Q3", "licensed": 3407, "sorned": 660},
{"period": "2011 Q2", "licensed": 3351, "sorned": 629},
{"period": "2011 Q1", "licensed": 3269, "sorned": 618},
{"period": "2010 Q4", "licensed": 3246, "sorned": 661},
{"period": "2009 Q4", "licensed": 3171, "sorned": 676},
{"period": "2008 Q4", "licensed": 3155, "sorned": 681},
{"period": "2007 Q4", "licensed": 3226, "sorned": 620},
{"period": "2006 Q4", "licensed": 3245, "sorned": null},
{"period": "2005 Q4", "licensed": 3289, "sorned": null}
];
Morris.Line({
element: 'morris-line-chart',
data: tax_data,
xkey: 'period',
ykeys: ['licensed', 'sorned'],
labels: ['Licensed', 'Off the road'],
resize: true,
lineColors: [dark, blue]
});
/* Morris Bar Chart
------------------------- */
Morris.Bar({
element: 'morris-bar-chart',
data: [
{device: 'iPhone', geekbench: 136},
{device: 'iPhone 3G', geekbench: 137},
{device: 'iPhone 3GS', geekbench: 275},
{device: 'iPhone 4', geekbench: 380},
{device: 'iPhone 4S', geekbench: 655},
{device: 'iPhone 5', geekbench: 1571}
],
xkey: 'device',
ykeys: ['geekbench'],
labels: ['Geekbench'],
barRatio: 0.4,
xLabelAngle: 35,
hideHover: 'auto',
resize: true,
barColors: [dark]
});
/* Morris Area Chart
------------------------- */
Morris.Area({
element: 'morris-area-chart',
data: [
{period: '2010 Q1', iphone: 2666, ipad: null, itouch: 2647},
{period: '2010 Q2', iphone: 2778, ipad: 2294, itouch: 2441},
{period: '2010 Q3', iphone: 4912, ipad: 1969, itouch: 2501},
{period: '2010 Q4', iphone: 3767, ipad: 3597, itouch: 5689},
{period: '2011 Q1', iphone: 6810, ipad: 1914, itouch: 2293},
{period: '2011 Q2', iphone: 5670, ipad: 4293, itouch: 1881},
{period: '2011 Q3', iphone: 4820, ipad: 3795, itouch: 1588},
{period: '2011 Q4', iphone: 15073, ipad: 5967, itouch: 5175},
{period: '2012 Q1', iphone: 10687, ipad: 4460, itouch: 2028},
{period: '2012 Q2', iphone: 8432, ipad: 5713, itouch: 1791}
],
xkey: 'period',
ykeys: ['iphone', 'ipad', 'itouch'],
labels: ['iPhone', 'iPad', 'iPod Touch'],
pointSize: 2,
hideHover: 'auto',
resize: true,
lineColors: [red, orange, dark]
});
/* Morris Area Chart
------------------------- */
Morris.Donut({
element: 'morris-donut-chart',
data: [
{label: 'Jam', value: 25 },
{label: 'Frosted', value: 40 },
{label: 'Custard', value: 25 },
{label: 'Sugar', value: 10 }
],
formatter: function (y) { return y + "%" },
resize: true,
colors: [dark, orange, red, grey]
});
});
/* -------------------------------
34.0 CONTROLLER - Chart JS
------------------------------- */
colorAdminApp.controller('chartJsController', function($scope, $rootScope, $state) {
// white
var white = 'rgba(255,255,255,1.0)';
var fillBlack = 'rgba(45, 53, 60, 0.6)';
var fillBlackLight = 'rgba(45, 53, 60, 0.2)';
var strokeBlack = 'rgba(45, 53, 60, 0.8)';
var highlightFillBlack = 'rgba(45, 53, 60, 0.8)';
var highlightStrokeBlack = 'rgba(45, 53, 60, 1)';
// blue
var fillBlue = 'rgba(52, 143, 226, 0.6)';
var fillBlueLight = 'rgba(52, 143, 226, 0.2)';
var strokeBlue = 'rgba(52, 143, 226, 0.8)';
var highlightFillBlue = 'rgba(52, 143, 226, 0.8)';
var highlightStrokeBlue = 'rgba(52, 143, 226, 1)';
// grey
var fillGrey = 'rgba(182, 194, 201, 0.6)';
var fillGreyLight = 'rgba(182, 194, 201, 0.2)';
var strokeGrey = 'rgba(182, 194, 201, 0.8)';
var highlightFillGrey = 'rgba(182, 194, 201, 0.8)';
var highlightStrokeGrey = 'rgba(182, 194, 201, 1)';
// green
var fillGreen = 'rgba(0, 172, 172, 0.6)';
var fillGreenLight = 'rgba(0, 172, 172, 0.2)';
var strokeGreen = 'rgba(0, 172, 172, 0.8)';
var highlightFillGreen = 'rgba(0, 172, 172, 0.8)';
var highlightStrokeGreen = 'rgba(0, 172, 172, 1)';
// purple
var fillPurple = 'rgba(114, 124, 182, 0.6)';
var fillPurpleLight = 'rgba(114, 124, 182, 0.2)';
var strokePurple = 'rgba(114, 124, 182, 0.8)';
var highlightFillPurple = 'rgba(114, 124, 182, 0.8)';
var highlightStrokePurple = 'rgba(114, 124, 182, 1)';
/* ChartJS Bar Chart
------------------------- */
var randomScalingFactor = function() {
return Math.round(Math.random()*100)
};
var barChartData = {
labels : ['January','February','March','April','May','June','July'],
datasets : [{
fillColor : fillBlackLight,
strokeColor : strokeBlack,
highlightFill: highlightFillBlack,
highlightStroke: highlightStrokeBlack,
data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
}, {
fillColor : fillBlueLight,
strokeColor : strokeBlue,
highlightFill: highlightFillBlue,
highlightStroke: highlightStrokeBlue,
data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
}]
};
this.barChartData = barChartData;
/* ChartJS Doughnut Chart
------------------------- */
var doughnutChartData = [
{ value: 300, color: fillGrey, highlight: highlightFillGrey, label: 'Grey' },
{ value: 50, color: fillGreen, highlight: highlightFillGreen, label: 'Green' },
{ value: 100, color: fillBlue, highlight: highlightFillBlue, label: 'Blue' },
{ value: 40, color: fillPurple, highlight: highlightFillPurple, label: 'Purple' },
{ value: 120, color: fillBlack, highlight: highlightFillBlack, label: 'Black' }
];
this.doughnutChartData = doughnutChartData;
/* ChartJS Line Chart
------------------------- */
var lineChartData = {
labels : ['January','February','March','April','May','June','July'],
datasets : [{
label: 'My First dataset',
fillColor : fillBlackLight,
strokeColor : strokeBlack,
pointColor : strokeBlack,
pointStrokeColor : white,
pointHighlightFill : white,
pointHighlightStroke : strokeBlack,
data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
}, {
label: 'My Second dataset',
fillColor : 'rgba(52,143,226,0.2)',
strokeColor : 'rgba(52,143,226,1)',
pointColor : 'rgba(52,143,226,1)',
pointStrokeColor : '#fff',
pointHighlightFill : '#fff',
pointHighlightStroke : 'rgba(52,143,226,1)',
data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]
}]
};
this.lineChartData = lineChartData;
/* ChartJS Pie Chart
------------------------- */
var pieChartData = [
{ value: 300, color: strokePurple, highlight: highlightStrokePurple, label: 'Purple' },
{ value: 50, color: strokeBlue, highlight: highlightStrokeBlue, label: 'Blue' },
{ value: 100, color: strokeGreen, highlight: highlightStrokeGreen, label: 'Green' },
{ value: 40, color: strokeGrey, highlight: highlightStrokeGrey, label: 'Grey' },
{ value: 120, color: strokeBlack, highlight: highlightStrokeBlack, label: 'Black' }
];
this.pieChartData = pieChartData;
/* ChartJS Polar Chart
------------------------- */
var polarChartData = [
{ value: 300, color: strokePurple, highlight: highlightStrokePurple, label: 'Purple' },
{ value: 50, color: strokeBlue, highlight: highlightStrokeBlue, label: 'Blue' },
{ value: 100, color: strokeGreen, highlight: highlightStrokeGreen, label: 'Green' },
{ value: 40, color: strokeGrey, highlight: highlightStrokeGrey, label: 'Grey' },
{ value: 120, color: strokeBlack, highlight: highlightStrokeBlack, label: 'Black' }
];
this.polarChartData = polarChartData;
/* ChartJS Radar Chart
------------------------- */
var radarChartData = {
labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'],
datasets: [{
label: 'My First dataset',
fillColor: 'rgba(45,53,60,0.2)',
strokeColor: 'rgba(45,53,60,1)',
pointColor: 'rgba(45,53,60,1)',
pointStrokeColor: '#fff',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(45,53,60,1)',
data: [65,59,90,81,56,55,40]
}, {
label: 'My Second dataset',
fillColor: 'rgba(52,143,226,0.2)',
strokeColor: 'rgba(52,143,226,1)',
pointColor: 'rgba(52,143,226,1)',
pointStrokeColor: '#fff',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(52,143,226,1)',
data: [28,48,40,19,96,27,100]
}]
};
this.radarChartData = radarChartData;
/* ChartJS Chart Options
------------------------- */
var chartOptions = {
animation: true,
animationSteps: 60,
animationEasing: 'easeOutQuart',
showScale: true,
scaleOverride: false,
scaleSteps: null,
scaleStepWidth: null,
scaleStartValue: null,
scaleLineColor: 'rgba(0,0,0,.1)',
scaleLineWidth: 1,
scaleShowLabels: true,
scaleLabel: '<%=value%>',
scaleIntegersOnly: true,
scaleBeginAtZero: false,
scaleFontFamily: '"Open Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif',
scaleFontSize: 12,
scaleFontStyle: 'normal',
scaleFontColor: '#707478',
responsive: true,
maintainAspectRatio: true,
showTooltips: true,
customTooltips: false,
tooltipEvents: ['mousemove', 'touchstart', 'touchmove'],
tooltipFillColor: 'rgba(0,0,0,0.8)',
tooltipFontFamily: '"Open Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif',
tooltipFontSize: 12,
tooltipFontStyle: 'normal',
tooltipFontColor: '#ccc',
tooltipTitleFontFamily: '"Open Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif',
tooltipTitleFontSize: 12,
tooltipTitleFontStyle: 'bold',
tooltipTitleFontColor: '#fff',
tooltipYPadding: 10,
tooltipXPadding: 10,
tooltipCaretSize: 8,
tooltipCornerRadius: 3,
tooltipXOffset: 10,
tooltipTemplate: '<%if (label){%><%=label%>: <%}%><%= value %>',
multiTooltipTemplate: '<%= value %>',
onAnimationProgress: function(){},
onAnimationComplete: function(){}
}
this.chartOptions = chartOptions;
});
/* -------------------------------
35.0 CONTROLLER - Chart d3
------------------------------- */
colorAdminApp.controller('chartD3Controller', function($scope, $rootScope, $state) {
/* d3 Line Chart
------------------------- */
nv.addGraph(function() {
var sin = [], cos = [];
for (var i = 0; i < 100; i++) {
sin.push({x: i, y: Math.sin(i/10) });
cos.push({x: i, y: .5 * Math.cos(i/10)});
}
var lineChartData = [
{ values: sin, key: 'Sine Wave', color: green },
{ values: cos, key: 'Cosine Wave', color: blue }
];
var lineChart = nv.models.lineChart().options({ transitionDuration: 300, useInteractiveGuideline: true });
lineChart.xAxis.axisLabel('Time (s)').tickFormat(d3.format(',.1f'));
lineChart.yAxis.axisLabel('Voltage (v)').tickFormat(function(d) {
if (d == null) {
return 'N/A';
}
return d3.format(',.2f')(d);
});
d3.select('#nv-line-chart').append('svg').datum(lineChartData).call(lineChart);
nv.utils.windowResize(lineChart.update);
return lineChart;
});
/* d3 Bar Chart
------------------------- */
nv.addGraph(function() {
var barChartData = [{
key: 'Cumulative Return',
values: [
{ 'label' : 'A', 'value' : 29, 'color' : red },
{ 'label' : 'B', 'value' : 15, 'color' : orange },
{ 'label' : 'C', 'value' : 32, 'color' : green },
{ 'label' : 'D', 'value' : 196, 'color' : aqua },
{ 'label' : 'E', 'value' : 44, 'color' : blue },
{ 'label' : 'F', 'value' : 98, 'color' : purple },
{ 'label' : 'G', 'value' : 13, 'color' : grey },
{ 'label' : 'H', 'value' : 5, 'color' : dark }
]
}];
var barChart = nv.models.discreteBarChart()
.x(function(d) { return d.label })
.y(function(d) { return d.value })
.showValues(true)
.duration(250);
barChart.yAxis.axisLabel("Total Sales");
barChart.xAxis.axisLabel('Product');
d3.select('#nv-bar-chart').append('svg').datum(barChartData).call(barChart);
nv.utils.windowResize(barChart.update);
return barChart;
});
/* d3 Pie Chart
------------------------- */
nv.addGraph(function() {
var pieChartData = [
{ 'label': 'One', 'value' : 29, 'color': red },
{ 'label': 'Two', 'value' : 12, 'color': orange },
{ 'label': 'Three', 'value' : 32, 'color': green },
{ 'label': 'Four', 'value' : 196, 'color': aqua },
{ 'label': 'Five', 'value' : 17, 'color': blue },
{ 'label': 'Six', 'value' : 98, 'color': purple },
{ 'label': 'Seven', 'value' : 13, 'color': grey },
{ 'label': 'Eight', 'value' : 5, 'color': dark }
];
var pieChart = nv.models.pieChart()
.x(function(d) { return d.label })
.y(function(d) { return d.value })
.showLabels(true)
.labelThreshold(.05);
d3.select('#nv-pie-chart').append('svg').datum(pieChartData).transition().duration(350).call(pieChart);
return pieChart;
});
/* d3 Donut Chart
------------------------- */
nv.addGraph(function() {
var donutChartData = [
{ 'label': 'One', 'value' : 29, 'color': red },
{ 'label': 'Two', 'value' : 12, 'color': orange },
{ 'label': 'Three', 'value' : 32, 'color': green },
{ 'label': 'Four', 'value' : 196, 'color': aqua },
{ 'label': 'Five', 'value' : 17, 'color': blue },
{ 'label': 'Six', 'value' : 98, 'color': purple },
{ 'label': 'Seven', 'value' : 13, 'color': grey },
{ 'label': 'Eight', 'value' : 5, 'color': dark }
];
var chart = nv.models.pieChart()
.x(function(d) { return d.label })
.y(function(d) { return d.value })
.showLabels(true)
.labelThreshold(.05)
.labelType("percent")
.donut(true)
.donutRatio(0.35);
d3.select('#nv-donut-chart').append('svg')
.datum(donutChartData)
.transition().duration(350)
.call(chart);
return chart;
});
/* d3 Stacked Area Chart
------------------------- */
nv.addGraph(function() {
var stackedAreaChartData = [{
'key' : 'Financials',
'color' : red,
'values' : [ [ 1138683600000 , 13.356778764352] , [ 1141102800000 , 13.611196863271] , [ 1143781200000 , 6.895903006119] , [ 1146369600000 , 6.9939633271352] , [ 1149048000000 , 6.7241510257675] , [ 1151640000000 , 5.5611293669516] , [ 1154318400000 , 5.6086488714041] , [ 1156996800000 , 5.4962849907033] , [ 1159588800000 , 6.9193153169279] , [ 1162270800000 , 7.0016334389777] , [ 1164862800000 , 6.7865422443273] , [ 1167541200000 , 9.0006454225383] , [ 1170219600000 , 9.2233916171431] , [ 1172638800000 , 8.8929316009479] , [ 1175313600000 , 10.345937520404] , [ 1177905600000 , 10.075914677026] , [ 1180584000000 , 10.089006188111] , [ 1183176000000 , 10.598330295008] , [ 1185854400000 , 9.968954653301] , [ 1188532800000 , 9.7740580198146] , [ 1191124800000 , 10.558483060626] , [ 1193803200000 , 9.9314651823603] , [ 1196398800000 , 9.3997715873769] , [ 1199077200000 , 8.4086493387262] , [ 1201755600000 , 8.9698309085926] , [ 1204261200000 , 8.2778357995396] , [ 1206936000000 , 8.8585045600123] , [ 1209528000000 , 8.7013756413322] , [ 1212206400000 , 7.7933605469443] , [ 1214798400000 , 7.0236183483064] , [ 1217476800000 , 6.9873088186829] , [ 1220155200000 , 6.8031713070097] , [ 1222747200000 , 6.6869531315723] , [ 1225425600000 , 6.138256993963] , [ 1228021200000 , 5.6434994016354] , [ 1230699600000 , 5.495220262512] , [ 1233378000000 , 4.6885326869846] , [ 1235797200000 , 4.4524349883438] , [ 1238472000000 , 5.6766520778185] , [ 1241064000000 , 5.7675774480752] , [ 1243742400000 , 5.7882863168337] , [ 1246334400000 , 7.2666010034924] , [ 1249012800000 , 7.519182132226] , [ 1251691200000 , 7.849651451445] , [ 1254283200000 , 10.383992037985] , [ 1256961600000 , 9.0653691861818] , [ 1259557200000 , 9.6705248324159] , [ 1262235600000 , 10.856380561349] , [ 1264914000000 , 11.27452370892] , [ 1267333200000 , 11.754156529088] , [ 1270008000000 , 8.2870811422456] , [ 1272600000000 , 8.0210264360699] , [ 1275278400000 , 7.5375074474865] , [ 1277870400000 , 8.3419527338039] , [ 1280548800000 , 9.4197471818443] , [ 1283227200000 , 8.7321733185797] , [ 1285819200000 , 9.6627062648126] , [ 1288497600000 , 10.187962234549] , [ 1291093200000 , 9.8144201733476] , [ 1293771600000 , 10.275723361713] , [ 1296450000000 , 16.796066079353] , [ 1298869200000 , 17.543254984075] , [ 1301544000000 , 16.673660675084] , [ 1304136000000 , 17.963944353609] , [ 1306814400000 , 16.637740867211] , [ 1309406400000 , 15.84857094609] , [ 1312084800000 , 14.767303362182] , [ 1314763200000 , 24.778452182432] , [ 1317355200000 , 18.370353229999] , [ 1320033600000 , 15.2531374291] , [ 1322629200000 , 14.989600840649] , [ 1325307600000 , 16.052539160125] , [ 1327986000000 , 16.424390322793] , [ 1330491600000 , 17.884020741105] , [ 1333166400000 , 7.1424929577921] , [ 1335758400000 , 7.8076213051482] , [ 1338436800000 , 7.2462684949232]]
}, {
'key' : 'Health Care',
'color' : orange,
'values' : [ [ 1138683600000 , 14.212410956029] , [ 1141102800000 , 13.973193618249] , [ 1143781200000 , 15.218233920665] , [ 1146369600000 , 14.38210972745] , [ 1149048000000 , 13.894310878491] , [ 1151640000000 , 15.593086090032] , [ 1154318400000 , 16.244839695188] , [ 1156996800000 , 16.017088850646] , [ 1159588800000 , 14.183951830055] , [ 1162270800000 , 14.148523245697] , [ 1164862800000 , 13.424326059972] , [ 1167541200000 , 12.974450435753] , [ 1170219600000 , 13.23247041802] , [ 1172638800000 , 13.318762655574] , [ 1175313600000 , 15.961407746104] , [ 1177905600000 , 16.287714639805] , [ 1180584000000 , 16.246590583889] , [ 1183176000000 , 17.564505594809] , [ 1185854400000 , 17.872725373165] , [ 1188532800000 , 18.018998508757] , [ 1191124800000 , 15.584518016603] , [ 1193803200000 , 15.480850647181] , [ 1196398800000 , 15.699120036984] , [ 1199077200000 , 19.184281817226] , [ 1201755600000 , 19.691226605207] , [ 1204261200000 , 18.982314051295] , [ 1206936000000 , 18.707820309008] , [ 1209528000000 , 17.459630929761] , [ 1212206400000 , 16.500616076782] , [ 1214798400000 , 18.086324003979] , [ 1217476800000 , 18.929464156258] , [ 1220155200000 , 18.233728682084] , [ 1222747200000 , 16.315776297325] , [ 1225425600000 , 14.63289219025] , [ 1228021200000 , 14.667835024478] , [ 1230699600000 , 13.946993947308] , [ 1233378000000 , 14.394304684397] , [ 1235797200000 , 13.724462792967] , [ 1238472000000 , 10.930879035806] , [ 1241064000000 , 9.8339915513708] , [ 1243742400000 , 10.053858541872] , [ 1246334400000 , 11.786998438287] , [ 1249012800000 , 11.780994901769] , [ 1251691200000 , 11.305889670276] , [ 1254283200000 , 10.918452290083] , [ 1256961600000 , 9.6811395055706] , [ 1259557200000 , 10.971529744038] , [ 1262235600000 , 13.330210480209] , [ 1264914000000 , 14.592637568961] , [ 1267333200000 , 14.605329141157] , [ 1270008000000 , 13.936853794037] , [ 1272600000000 , 12.189480759072] , [ 1275278400000 , 11.676151385046] , [ 1277870400000 , 13.058852800017] , [ 1280548800000 , 13.62891543203] , [ 1283227200000 , 13.811107569918] , [ 1285819200000 , 13.786494560787] , [ 1288497600000 , 14.04516285753] , [ 1291093200000 , 13.697412447288] , [ 1293771600000 , 13.677681376221] , [ 1296450000000 , 19.961511864531] , [ 1298869200000 , 21.049198298158] , [ 1301544000000 , 22.687631094008] , [ 1304136000000 , 25.469010617433] , [ 1306814400000 , 24.883799437121] , [ 1309406400000 , 24.203843814248] , [ 1312084800000 , 22.138760964038] , [ 1314763200000 , 16.034636966228] , [ 1317355200000 , 15.394958944556] , [ 1320033600000 , 12.625642461969] , [ 1322629200000 , 12.973735699739] , [ 1325307600000 , 15.786018336149] , [ 1327986000000 , 15.227368020134] , [ 1330491600000 , 15.899752650734] , [ 1333166400000 , 18.994731295388] , [ 1335758400000 , 18.450055817702] , [ 1338436800000 , 17.863719889669]]
}, {
'key' : 'Information Technology',
'color' : dark,
'values' : [ [ 1138683600000 , 13.242301508051] , [ 1141102800000 , 12.863536342042] , [ 1143781200000 , 21.034044171629] , [ 1146369600000 , 21.419084618803] , [ 1149048000000 , 21.142678863691] , [ 1151640000000 , 26.568489677529] , [ 1154318400000 , 24.839144939905] , [ 1156996800000 , 25.456187462167] , [ 1159588800000 , 26.350164502826] , [ 1162270800000 , 26.47833320519] , [ 1164862800000 , 26.425979547847] , [ 1167541200000 , 28.191461582256] , [ 1170219600000 , 28.930307448808] , [ 1172638800000 , 29.521413891117] , [ 1175313600000 , 28.188285966466] , [ 1177905600000 , 27.704619625832] , [ 1180584000000 , 27.490862424829] , [ 1183176000000 , 28.770679721286] , [ 1185854400000 , 29.060480671449] , [ 1188532800000 , 28.240998844973] , [ 1191124800000 , 33.004893194127] , [ 1193803200000 , 34.075180359928] , [ 1196398800000 , 32.548560664833] , [ 1199077200000 , 30.629727432728] , [ 1201755600000 , 28.642858788159] , [ 1204261200000 , 27.973575227842] , [ 1206936000000 , 27.393351882726] , [ 1209528000000 , 28.476095288523] , [ 1212206400000 , 29.29667866426] , [ 1214798400000 , 29.222333802896] , [ 1217476800000 , 28.092966093843] , [ 1220155200000 , 28.107159262922] , [ 1222747200000 , 25.482974832098] , [ 1225425600000 , 21.208115993834] , [ 1228021200000 , 20.295043095268] , [ 1230699600000 , 15.925754618401] , [ 1233378000000 , 17.162864628346] , [ 1235797200000 , 17.084345773174] , [ 1238472000000 , 22.246007102281] , [ 1241064000000 , 24.530543998509] , [ 1243742400000 , 25.084184918242] , [ 1246334400000 , 16.606166527358] , [ 1249012800000 , 17.239620011628] , [ 1251691200000 , 17.336739127379] , [ 1254283200000 , 25.478492475753] , [ 1256961600000 , 23.017152085245] , [ 1259557200000 , 25.617745423683] , [ 1262235600000 , 24.061133998642] , [ 1264914000000 , 23.223933318644] , [ 1267333200000 , 24.425887263937] , [ 1270008000000 , 35.501471156693] , [ 1272600000000 , 33.775013878676] , [ 1275278400000 , 30.417993630285] , [ 1277870400000 , 30.023598978467] , [ 1280548800000 , 33.327519522436] , [ 1283227200000 , 31.963388450371] , [ 1285819200000 , 30.498967232092] , [ 1288497600000 , 32.403696817912] , [ 1291093200000 , 31.47736071922] , [ 1293771600000 , 31.53259666241] , [ 1296450000000 , 41.760282761548] , [ 1298869200000 , 45.605771243237] , [ 1301544000000 , 39.986557966215] , [ 1304136000000 , 43.846330510051] , [ 1306814400000 , 39.857316881857] , [ 1309406400000 , 37.675127768208] , [ 1312084800000 , 35.775077970313] , [ 1314763200000 , 48.631009702577] , [ 1317355200000 , 42.830831754505] , [ 1320033600000 , 35.611502589362] , [ 1322629200000 , 35.320136981738] , [ 1325307600000 , 31.564136901516] , [ 1327986000000 , 32.074407502433] , [ 1330491600000 , 35.053013769976] , [ 1333166400000 , 26.434568573937] , [ 1335758400000 , 25.305617871002] , [ 1338436800000 , 24.520919418236]]
}];
var stackedAreaChart = nv.models.stackedAreaChart()
.useInteractiveGuideline(true)
.x(function(d) { return d[0] })
.y(function(d) { return d[1] })
.controlLabels({stacked: 'Stacked'})
.showControls(false)
.duration(300);
stackedAreaChart.xAxis.tickFormat(function(d) { return d3.time.format('%x')(new Date(d)) });
stackedAreaChart.yAxis.tickFormat(d3.format(',.4f'));
d3.select('#nv-stacked-area-chart')
.append('svg')
.datum(stackedAreaChartData)
.transition().duration(1000)
.call(stackedAreaChart)
.each('start', function() {
setTimeout(function() {
d3.selectAll('#nv-stacked-area-chart *').each(function() {
if(this.__transition__)
this.__transition__.duration = 1;
})
}, 0)
});
nv.utils.windowResize(stackedAreaChart.update);
return stackedAreaChart;
});
/* d3 Stacked Bar Chart
------------------------- */
var stackedBarChartData = [{
key: 'Stream 1',
'color' : red,
values: [
{ x:1, y: 10}, { x:2, y: 15}, { x:3, y: 16}, { x:4, y: 20}, { x:5, y: 57}, { x:6, y: 42}, { x:7, y: 12}, { x:8, y: 65}, { x:9, y: 34}, { x:10, y: 52},
{ x:11, y: 23}, { x:12, y: 12}, { x:13, y: 22}, { x:14, y: 22}, { x:15, y: 48}, { x:16, y: 54}, { x:17, y: 32}, { x:18, y: 13}, { x:19, y: 21}, { x:20, y: 12}
]
},{
key: 'Stream 2',
'color' : orange,
values: [
{ x:1, y: 10}, { x:2, y: 15}, { x:3, y: 16}, { x:4, y: 45}, { x:5, y: 67}, { x:6, y: 34}, { x:7, y: 43}, { x:8, y: 65}, { x:9, y: 32}, { x:10, y: 12},
{ x:11, y: 43}, { x:12, y: 45}, { x:13, y: 32}, { x:14, y: 32}, { x:15, y: 38}, { x:16, y: 64}, { x:17, y: 42}, { x:18, y: 23}, { x:19, y: 31}, { x:20, y: 22}
]
},{
key: 'Stream 2',
'color' : dark,
values: [
{ x:1, y: 20}, { x:2, y: 25}, { x:3, y: 26}, { x:4, y: 30}, { x:5, y: 57}, { x:6, y: 52}, { x:7, y: 22}, { x:8, y: 75}, { x:9, y: 44}, { x:10, y: 62},
{ x:11, y: 35}, { x:12, y: 15}, { x:13, y: 25}, { x:14, y: 25}, { x:15, y: 45}, { x:16, y: 55}, { x:17, y: 35}, { x:18, y: 15}, { x:19, y: 25}, { x:20, y: 15}
]
}];
nv.addGraph({
generate: function() {
var stackedBarChart = nv.models.multiBarChart()
.stacked(true)
.showControls(false);
var svg = d3.select('#nv-stacked-bar-chart').append('svg').datum(stackedBarChartData);
svg.transition().duration(0).call(stackedBarChart);
return stackedBarChart;
}
});
});
/* -------------------------------
36.0 CONTROLLER - Calendar
------------------------------- */
colorAdminApp.controller('calendarController', function($scope, $rootScope, $state) {
var buttonSetting = {left: 'today prev,next ', center: 'title', right: 'month,agendaWeek,agendaDay'};
var date = new Date();
var m = date.getMonth();
var y = date.getFullYear();
var calendar = $('#calendar').fullCalendar({
header: buttonSetting,
selectable: true,
selectHelper: true,
droppable: true,
drop: function(date, allDay) { // this function is called when something is dropped
// retrieve the dropped element's stored Event Object
var originalEventObject = $(this).data('eventObject');
// we need to copy it, so that multiple events don't have a reference to the same object
var copiedEventObject = $.extend({}, originalEventObject);
// assign it the date that was reported
copiedEventObject.start = date;
copiedEventObject.allDay = allDay;
// render the event on the calendar
// the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
$('#calendar').fullCalendar('renderEvent', copiedEventObject, true);
// is the "remove after drop" checkbox checked?
if ($('#drop-remove').is(':checked')) {
// if so, remove the element from the "Draggable Events" list
$(this).remove();
}
},
select: function(start, end, allDay) {
var title = prompt('Event Title:');
if (title) {
calendar.fullCalendar('renderEvent',
{
title: title,
start: start,
end: end,
allDay: allDay
},
true // make the event "stick"
);
}
calendar.fullCalendar('unselect');
},
eventRender: function(event, element, calEvent) {
var mediaObject = (event.media) ? event.media : '';
var description = (event.description) ? event.description : '';
element.find(".fc-event-title").after($("<span class=\"fc-event-icons\"></span>").html(mediaObject));
element.find(".fc-event-title").append('<small>'+ description +'</small>');
},
editable: true,
events: [
{
title: 'Event',
start: new Date(y, m, 0),
end: new Date(y, m, 1),
className: 'bg-purple',
media: '<i class="fa fa-trophy"></i>',
description: 'Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.'
},
{
title: 'Daily Meeting',
start: new Date(y, m, 10),
end: new Date(y, m, 12),
allDay: false,
className: 'bg-blue',
media: '<i class="fa fa-users"></i>',
description: 'Lorem ipsum dolor sit amet adipiscing elit.'
},
{
title: 'Click for Google',
start: new Date(y, m, 15),
end: new Date(y, m, 17),
url: 'http://google.com/',
className: 'bg-green',
media: '<i class="fa fa-google-plus"></i>',
description: 'Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.'
}
]
});
/* initialize the external events
-----------------------------------------------------------------*/
$('#external-events .external-event').each(function() {
var eventObject = {
title: $.trim($(this).attr('data-title')),
className: $(this).attr('data-bg'),
media: $(this).attr('data-media'),
description: $(this).attr('data-desc')
};
$(this).data('eventObject', eventObject);
$(this).draggable({
zIndex: 999,
revert: true,
revertDuration: 0
});
});
});
/* -------------------------------
37.0 CONTROLLER - Vector Map
------------------------------- */
colorAdminApp.controller('mapVectorController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageContentFullWidth = true;
$rootScope.setting.layout.pageContentInverseMode = true;
var wHeight = $(window).height();
$('#world-map').css('height', wHeight);
$('#world-map').vectorMap({
map: 'world_mill_en',
scaleColors: ['#e74c3c', '#0071a4'],
normalizeFunction: 'polynomial',
hoverOpacity: 0.5,
hoverColor: false,
markerStyle: {
initial: {
fill: '#4cabc7',
stroke: 'transparent',
r: 3
}
},
regionStyle: {
initial: {
fill: 'rgb(97,109,125)',
"fill-opacity": 1,
stroke: 'none',
"stroke-width": 0.4,
"stroke-opacity": 1
},
hover: { "fill-opacity": 0.8 },
selected: { fill: 'yellow' }
},
focusOn: { x: 0.5, y: 0.5, scale: 2 },
backgroundColor: '#242a30',
markers: [
{latLng: [41.90, 12.45], name: 'Vatican City'},
{latLng: [43.73, 7.41], name: 'Monaco'},
{latLng: [-0.52, 166.93], name: 'Nauru'},
{latLng: [-8.51, 179.21], name: 'Tuvalu'},
{latLng: [43.93, 12.46], name: 'San Marino'},
{latLng: [47.14, 9.52], name: 'Liechtenstein'},
{latLng: [7.11, 171.06], name: 'Marshall Islands'},
{latLng: [17.3, -62.73], name: 'Saint Kitts and Nevis'},
{latLng: [3.2, 73.22], name: 'Maldives'},
{latLng: [35.88, 14.5], name: 'Malta'},
{latLng: [12.05, -61.75], name: 'Grenada'},
{latLng: [13.16, -61.23], name: 'Saint Vincent and the Grenadines'},
{latLng: [13.16, -59.55], name: 'Barbados'},
{latLng: [17.11, -61.85], name: 'Antigua and Barbuda'},
{latLng: [-4.61, 55.45], name: 'Seychelles'},
{latLng: [7.35, 134.46], name: 'Palau'},
{latLng: [42.5, 1.51], name: 'Andorra'},
{latLng: [14.01, -60.98], name: 'Saint Lucia'},
{latLng: [6.91, 158.18], name: 'Federated States of Micronesia'},
{latLng: [1.3, 103.8], name: 'Singapore'},
{latLng: [1.46, 173.03], name: 'Kiribati'},
{latLng: [-21.13, -175.2], name: 'Tonga'},
{latLng: [15.3, -61.38], name: 'Dominica'},
{latLng: [-20.2, 57.5], name: 'Mauritius'},
{latLng: [26.02, 50.55], name: 'Bahrain'},
{latLng: [0.33, 6.73], name: 'São Tomé and Príncipe'}
]
});
});
/* -------------------------------
38.0 CONTROLLER - Google Map
------------------------------- */
function handleGoogleMapLoaded() {
$(window).trigger('googleMapLoaded');
}
colorAdminApp.controller('mapGoogleController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageContentFullWidth = true;
var mapDefault;
function initialize() {
var mapOptions = {
zoom: 6,
center: new google.maps.LatLng(-33.397, 145.644),
mapTypeId: google.maps.MapTypeId.ROADMAP,
disableDefaultUI: true,
};
mapDefault = new google.maps.Map(document.getElementById('google-map-default'), mapOptions);
}
$(window).unbind('googleMapLoaded');
$(window).bind('googleMapLoaded', initialize);
$.getScript("http://maps.google.com/maps/api/js?sensor=false&callback=handleGoogleMapLoaded");
$(window).resize(function() {
google.maps.event.trigger(mapDefault, "resize");
});
var defaultMapStyles = [];
var flatMapStyles = [{"stylers":[{"visibility":"off"}]},{"featureType":"road","stylers":[{"visibility":"on"},{"color":"#ffffff"}]},{"featureType":"road.arterial","stylers":[{"visibility":"on"},{"color":"#fee379"}]},{"featureType":"road.highway","stylers":[{"visibility":"on"},{"color":"#fee379"}]},{"featureType":"landscape","stylers":[{"visibility":"on"},{"color":"#f3f4f4"}]},{"featureType":"water","stylers":[{"visibility":"on"},{"color":"#7fc8ed"}]},{},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#83cead"}]},{"elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"landscape.man_made","elementType":"geometry","stylers":[{"weight":0.9},{"visibility":"off"}]}];
var turquoiseWaterStyles = [{"featureType":"landscape.natural","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#e0efef"}]},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"hue":"#1900ff"},{"color":"#c0e8e8"}]},{"featureType":"landscape.man_made","elementType":"geometry.fill"},{"featureType":"road","elementType":"geometry","stylers":[{"lightness":100},{"visibility":"simplified"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"water","stylers":[{"color":"#7dcdcd"}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"visibility":"on"},{"lightness":700}]}];
var icyBlueStyles = [{"stylers":[{"hue":"#2c3e50"},{"saturation":250}]},{"featureType":"road","elementType":"geometry","stylers":[{"lightness":50},{"visibility":"simplified"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"off"}]}];
var oldDryMudStyles = [{"featureType":"landscape","stylers":[{"hue":"#FFAD00"},{"saturation":50.2},{"lightness":-34.8},{"gamma":1}]},{"featureType":"road.highway","stylers":[{"hue":"#FFAD00"},{"saturation":-19.8},{"lightness":-1.8},{"gamma":1}]},{"featureType":"road.arterial","stylers":[{"hue":"#FFAD00"},{"saturation":72.4},{"lightness":-32.6},{"gamma":1}]},{"featureType":"road.local","stylers":[{"hue":"#FFAD00"},{"saturation":74.4},{"lightness":-18},{"gamma":1}]},{"featureType":"water","stylers":[{"hue":"#00FFA6"},{"saturation":-63.2},{"lightness":38},{"gamma":1}]},{"featureType":"poi","stylers":[{"hue":"#FFC300"},{"saturation":54.2},{"lightness":-14.4},{"gamma":1}]}];
var cobaltStyles = [{"featureType":"all","elementType":"all","stylers":[{"invert_lightness":true},{"saturation":10},{"lightness":10},{"gamma":0.8},{"hue":"#293036"}]},{"featureType":"water","stylers":[{"visibility":"on"},{"color":"#293036"}]}];
var darkRedStyles = [{"featureType":"all","elementType":"all","stylers":[{"invert_lightness":true},{"saturation":10},{"lightness":10},{"gamma":0.8},{"hue":"#000000"}]},{"featureType":"water","stylers":[{"visibility":"on"},{"color":"#293036"}]}];
$('[data-map-theme]').click(function() {
var targetTheme = $(this).attr('data-map-theme');
var targetLi = $(this).closest('li');
var targetText = $(this).text();
var inverseContentMode = false;
$('#map-theme-selection li').not(targetLi).removeClass('active');
$('#map-theme-text').text(targetText);
$(targetLi).addClass('active');
switch(targetTheme) {
case 'flat':
mapDefault.setOptions({styles: flatMapStyles});
break;
case 'turquoise-water':
mapDefault.setOptions({styles: turquoiseWaterStyles});
break;
case 'icy-blue':
mapDefault.setOptions({styles: icyBlueStyles});
break;
case 'cobalt':
mapDefault.setOptions({styles: cobaltStyles});
inverseContentMode = true;
break;
case 'old-dry-mud':
mapDefault.setOptions({styles: oldDryMudStyles});
break;
case 'dark-red':
mapDefault.setOptions({styles: darkRedStyles});
inverseContentMode = true;
break;
default:
mapDefault.setOptions({styles: defaultMapStyles});
break;
}
if (inverseContentMode === true) {
$('#content').addClass('content-inverse-mode');
} else {
$('#content').removeClass('content-inverse-mode');
}
});
});
/* -------------------------------
39.0 CONTROLLER - Gallery V1
------------------------------- */
colorAdminApp.controller('galleryController', function($scope, $rootScope, $state) {
function calculateDivider() {
var dividerValue = 4;
if ($(this).width() <= 480) {
dividerValue = 1;
} else if ($(this).width() <= 767) {
dividerValue = 2;
} else if ($(this).width() <= 980) {
dividerValue = 3;
}
return dividerValue;
}
var container = $('#gallery');
var dividerValue = calculateDivider();
var containerWidth = $(container).width() - 20;
var columnWidth = containerWidth / dividerValue;
$(container).isotope({
resizable: true,
masonry: {
columnWidth: columnWidth
}
});
$(window).smartresize(function() {
var dividerValue = calculateDivider();
var containerWidth = $(container).width() - 20;
var columnWidth = containerWidth / dividerValue;
$(container).isotope({
masonry: {
columnWidth: columnWidth
}
});
});
var $optionSets = $('#options .gallery-option-set'),
$optionLinks = $optionSets.find('a');
$optionLinks.click( function(){
var $this = $(this);
if ($this.hasClass('active')) {
return false;
}
var $optionSet = $this.parents('.gallery-option-set');
$optionSet.find('.active').removeClass('active');
$this.addClass('active');
var options = {};
var key = $optionSet.attr('data-option-key');
var value = $this.attr('data-option-value');
value = value === 'false' ? false : value;
options[ key ] = value;
$(container).isotope( options );
return false;
});
});
/* -------------------------------
40.0 CONTROLLER - Gallery V2
------------------------------- */
colorAdminApp.controller('galleryV2Controller', function($scope, $rootScope, $state) {
$('.superbox').SuperBox();
});
/* -------------------------------
41.0 CONTROLLER - Page with Footer
------------------------------- */
colorAdminApp.controller('pageWithFooterController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageFooter = true;
});
/* -------------------------------
42.0 CONTROLLER - Page without Sidebar
------------------------------- */
colorAdminApp.controller('pageWithoutSidebarController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageWithoutSidebar = true;
});
/* -------------------------------
43.0 CONTROLLER - Page with Right Sidebar
------------------------------- */
colorAdminApp.controller('pageWithRightSidebarController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageRightSidebar = true;
});
/* -------------------------------
44.0 CONTROLLER - Page with Minified Sidebar
------------------------------- */
colorAdminApp.controller('pageWithMinifiedSidebarController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageSidebarMinified = true;
});
/* -------------------------------
45.0 CONTROLLER - Page with Two Sidebar
------------------------------- */
colorAdminApp.controller('pageWithTwoSidebarController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageTwoSidebar = true;
});
/* -------------------------------
46.0 CONTROLLER - Full Height Content
------------------------------- */
colorAdminApp.controller('pageFullHeightContentController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageContentFullHeight = true;
$rootScope.setting.layout.pageContentFullWidth = true;
});
/* -------------------------------
47.0 CONTROLLER - Page with Wide Sidebar
------------------------------- */
colorAdminApp.controller('pageWithWideSidebarController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageWideSidebar = true;
});
/* -------------------------------
48.0 CONTROLLER - Page with Light Sidebar
------------------------------- */
colorAdminApp.controller('pageWithLightSidebarController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageLightSidebar = true;
});
/* -------------------------------
49.0 CONTROLLER - Page with Mega Menu
------------------------------- */
colorAdminApp.controller('pageWithMegaMenuController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageMegaMenu = true;
});
/* -------------------------------
50.0 CONTROLLER - Page with Top Menu
------------------------------- */
colorAdminApp.controller('pageWithTopMenuController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageTopMenu = true;
$rootScope.setting.layout.pageWithoutSidebar = true;
});
/* -------------------------------
51.0 CONTROLLER - Page with Boxed Layout
------------------------------- */
colorAdminApp.controller('pageWithBoxedLayoutController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageBoxedLayout = true;
});
/* -------------------------------
52.0 CONTROLLER - Page with Mixed Menu
------------------------------- */
colorAdminApp.controller('pageWithMixedMenuController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageTopMenu = true;
});
/* -------------------------------
53.0 CONTROLLER - Page Boxed Layout with Mixed Menu
------------------------------- */
colorAdminApp.controller('pageBoxedLayoutWithMixedMenuController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageBoxedLayout = true;
$rootScope.setting.layout.pageTopMenu = true;
});
/* -------------------------------
54.0 CONTROLLER - Page with Transparent Sidebar
------------------------------- */
colorAdminApp.controller('pageWithTransparentSidebarController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageSidebarTransparent = true;
});
/* -------------------------------
55.0 CONTROLLER - Timeline
------------------------------- */
colorAdminApp.controller('extraTimelineController', function($scope, $rootScope, $state) {
var mapDefault;
function initialize() {
var mapOptions = {
zoom: 6,
center: new google.maps.LatLng(-33.397, 145.644),
mapTypeId: google.maps.MapTypeId.ROADMAP,
disableDefaultUI: true,
};
mapDefault = new google.maps.Map(document.getElementById('google-map'), mapOptions);
}
$(window).unbind('googleMapLoaded');
$(window).bind('googleMapLoaded', initialize);
$.getScript("http://maps.google.com/maps/api/js?sensor=false&callback=handleGoogleMapLoaded");
$(window).resize(function() {
google.maps.event.trigger(mapDefault, "resize");
});
});
/* -------------------------------
56.0 CONTROLLER - Coming Soon
------------------------------- */
colorAdminApp.controller('comingSoonController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageWithoutHeader = true;
$rootScope.setting.layout.pageBgWhite = true;
$rootScope.setting.layout.paceTop = true;
var newYear = new Date();
newYear = new Date(newYear.getFullYear() + 1, 1 - 1, 1);
$('#timer').countdown({until: newYear});
});
/* -------------------------------
57.0 CONTROLLER - 404 Error
------------------------------- */
colorAdminApp.controller('errorController', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageWithoutHeader = true;
$rootScope.setting.layout.paceTop = true;
});
/* -------------------------------
58.0 CONTROLLER - Login V1
------------------------------- */
colorAdminApp.controller('loginV1Controller', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageWithoutHeader = true;
$rootScope.setting.layout.paceTop = true;
$scope.submitForm = function(form) {
$state.go('app.dashboard.v2');
};
});
/* -------------------------------
59.0 CONTROLLER - Login V2
------------------------------- */
colorAdminApp.controller('loginV2Controller', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageWithoutHeader = true;
$rootScope.setting.layout.paceTop = true;
$scope.submitForm = function(form) {
$state.go('app.dashboard.v2');
};
$('[data-click="change-bg"]').click(function() {
var targetImage = '[data-id="login-cover-image"]';
var targetImageSrc = $(this).find('img').attr('src');
var targetImageHtml = '<img src="'+ targetImageSrc +'" data-id="login-cover-image" />';
$('.login-cover-image').prepend(targetImageHtml);
$(targetImage).not('[src="'+ targetImageSrc +'"]').fadeOut('slow', function() {
$(this).remove();
});
$('[data-click="change-bg"]').closest('li').removeClass('active');
$(this).closest('li').addClass('active');
});
});
/* -------------------------------
60.0 CONTROLLER - Login V3
------------------------------- */
colorAdminApp.controller('loginV3Controller', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageWithoutHeader = true;
$rootScope.setting.layout.paceTop = true;
$rootScope.setting.layout.pageBgWhite = true;
$scope.submitForm = function(form) {
$state.go('app.dashboard.v2');
};
});
/* -------------------------------
61.0 CONTROLLER - Register V3
------------------------------- */
colorAdminApp.controller('registerV3Controller', function($scope, $rootScope, $state) {
$rootScope.setting.layout.pageWithoutHeader = true;
$rootScope.setting.layout.paceTop = true;
$rootScope.setting.layout.pageBgWhite = true;
$scope.submitForm = function(form) {
$state.go('app.dashboard.v2');
};
});
|
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.0.0-rc1-master-325d83e
*/
goog.provide('ng.material.components.card');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.card
*
* @description
* Card components.
*/
angular.module('material.components.card', [
'material.core'
])
.directive('mdCard', mdCardDirective);
/**
* @ngdoc directive
* @name mdCard
* @module material.components.card
*
* @restrict E
*
* @description
* The `<md-card>` directive is a container element used within `<md-content>` containers.
*
* An image included as a direct descendant will fill the card's width, while the `<md-card-content>`
* container will wrap text content and provide padding. An `<md-card-footer>` element can be
* optionally included to put content flush against the bottom edge of the card.
*
* Action buttons can be included in an element with the `.md-actions` class, also used in `md-dialog`.
* You can then position buttons using layout attributes.
*
* Cards have constant width and variable heights; where the maximum height is limited to what can
* fit within a single view on a platform, but it can temporarily expand as needed.
*
* @usage
* ### Card with optional footer
* <hljs lang="html">
* <md-card>
* <img src="card-image.png" class="md-card-image" alt="image caption">
* <md-card-content>
* <h2>Card headline</h2>
* <p>Card content</p>
* </md-card-content>
* <md-card-footer>
* Card footer
* </md-card-footer>
* </md-card>
* </hljs>
*
* ### Card with actions
* <hljs lang="html">
* <md-card>
* <img src="card-image.png" class="md-card-image" alt="image caption">
* <md-card-content>
* <h2>Card headline</h2>
* <p>Card content</p>
* </md-card-content>
* <div class="md-actions" layout="row" layout-align="end center">
* <md-button>Action 1</md-button>
* <md-button>Action 2</md-button>
* </div>
* </md-card>
* </hljs>
*
*/
function mdCardDirective($mdTheming) {
return {
restrict: 'E',
link: function($scope, $element, $attr) {
$mdTheming($element);
}
};
}
mdCardDirective.$inject = ["$mdTheming"];
ng.material.components.card = angular.module("material.components.card");
|
import { w3cwebsocket } from 'websocket'
import { eth, contracts } from 'decentraland-eth'
import { env } from 'decentraland-commons'
// @nacho hack: eth-connect expects to have window defined
global.window = {}
const providers = require('eth-connect')
const HDWalletProvider = require('truffle-hdwallet-provider')
export const PROVIDER_TYPES = {
websocket: 'websocket',
http: 'http',
hdWallet: 'hdWallet'
}
let isLoaded = false
export let contractsData // { ContractName: { address, eventNames: [] } }
export let contractNames // [ContractName, ...]
export let contractAddresses // ContractName: address
export let eventNames // eventName: eventName
export async function connectEth(options = {}) {
if (!isLoaded) loadContracts()
const contractsToConnect = []
for (const contractName in contractsData) {
const contract = contractsData[contractName]
if (!contracts[contractName]) {
throw new Error(`Contract ${contractName} does not exist`)
}
contractsToConnect.push(new contracts[contractName](contract.address))
}
let provider
switch (options.providerType) {
case PROVIDER_TYPES.websocket: {
const websocketURL = env.get('WEB_SOCKET_RPC_URL')
if (!websocketURL) {
throw new Error(
'You need to set the WEB_SOCKET_RPC_URL env var to connect via websockets'
)
}
provider = new providers.WebSocketProvider(websocketURL, {
WebSocketConstructor: w3cwebsocket
})
await provider.connection
break
}
case PROVIDER_TYPES.hdWallet: {
provider = new HDWalletProvider(
env.get('HDWALLET_MNEMONIC').replace(/,/g, ' '),
env.get('RPC_URL'),
env.get('HDWALLET_INDEX', 0)
)
break
}
case PROVIDER_TYPES.http:
default:
provider = env.get('RPC_URL')
break
}
await eth.connect({
contracts: contractsToConnect,
provider
})
return contractsData
}
export function loadContracts() {
contractsData = Object.freeze({
MANAToken: {
address: getEnvAddress('MANA_TOKEN_CONTRACT_ADDRESS'),
eventNames: ['Approval']
},
LegacyMarketplace: {
address: getEnvAddress('LEGACY_MARKETPLACE_CONTRACT_ADDRESS'),
eventNames: ['AuctionCreated', 'AuctionSuccessful', 'AuctionCancelled']
},
Marketplace: {
address: getEnvAddress('MARKETPLACE_CONTRACT_ADDRESS'),
eventNames: ['OrderCreated', 'OrderSuccessful', 'OrderCancelled']
},
LANDRegistry: {
address: getEnvAddress('LAND_REGISTRY_CONTRACT_ADDRESS'),
eventNames: [
'Update',
'Transfer',
'UpdateOperator',
'UpdateManager',
'Approval',
'ApprovalForAll'
],
count: { Transfer: 3 }
},
EstateRegistry: {
address: getEnvAddress('ESTATE_REGISTRY_CONTRACT_ADDRESS'),
eventNames: [
'CreateEstate',
'AddLand',
'RemoveLand',
'Transfer',
'Update',
'UpdateOperator',
'Approval',
'ApprovalForAll',
'UpdateManager'
]
},
LANDAuction: {
address: getEnvAddress('LAND_AUCTION_CONTRACT_ADDRESS'),
eventNames: ['BidSuccessful']
},
MortgageHelper: {
address: getEnvAddress('MORTGAGE_HELPER_CONTRACT_ADDRESS'),
eventNames: ['NewMortgage']
},
MortgageManager: {
address: getEnvAddress('MORTGAGE_MANAGER_CONTRACT_ADDRESS'),
eventNames: [
'CanceledMortgage',
'StartedMortgage',
'PaidMortgage',
'DefaultedMortgage'
]
},
RCNEngine: {
address: getEnvAddress('RCN_ENGINE_CONTRACT_ADDRESS'),
eventNames: ['PartialPayment', 'TotalPayment']
},
DecentralandInvite: {
address: getEnvAddress('DECENTRALAND_INVITE_CONTRACT_ADDRESS'),
eventNames: ['Transfer']
},
ERC721Bid: {
address: getEnvAddress('ERC721_BID_CONTRACT_ADDRESS'),
eventNames: ['BidCreated', 'BidAccepted', 'BidCancelled']
},
AvatarNameRegistry: {
address: getEnvAddress('AVATAR_NAME_REGISTRY_CONTRACT_ADDRESS'),
eventNames: ['Register', 'MetadataChanged']
}
})
contractNames = Object.keys(contractsData)
contractAddresses = contractNames.reduce(
(contractAddresses, contractName) => ({
...contractAddresses,
[contractName]: contractsData[contractName].address
}),
{}
)
eventNames = contractNames.reduce((eventNames, contractName) => {
contractsData[contractName].eventNames.forEach(
eventName => (eventNames[eventName] = eventName)
)
return eventNames
}, {})
isLoaded = true
}
function getEnvAddress(name) {
const value = env.get(name)
if (!value) {
throw new Error(`Could not find env ${name}`)
}
return value.toLowerCase()
}
export function getCountOfEvents(contractName, eventName) {
if (!contractsData[contractName].count) {
return 1
}
const types = contractsData[contractName].count
return types[eventName] || 1
}
|
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
var _this = this;
Object.defineProperty(exports, "__esModule", { value: true });
exports.curry = function (fn) {
if (fn.length === 0) {
return fn;
}
var recursion = function (accum) { return function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var temp = accum.concat(args);
if (fn.length <= temp.length) {
return fn.apply(void 0, temp);
}
return recursion(temp);
}; };
return recursion([]);
};
exports.sleep = function (ms) {
if (ms === void 0) { ms = 500; }
return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2, new Promise(function (resolve) {
setTimeout(function () { return resolve(); }, ms);
})];
});
});
};
exports.reduceSlideWindow = function (fn, init, kernel, stride, arrayData) {
var recursion = function (accum, start) {
if (arrayData.length < start + kernel) {
return accum;
}
var curr = arrayData.slice(start, start + kernel);
return recursion(fn(accum, curr), start + stride);
};
return recursion(init, 0);
};
exports.reduceChunk = exports.curry(function (fn, init, chunkSize, data) {
return exports.reduceSlideWindow(fn, init, chunkSize, 1, data);
});
exports.reduceSplit = exports.curry(function (fn, init, kernel, data) {
return exports.reduceSlideWindow(fn, init, kernel, kernel, data);
});
exports.reduceAsync = exports.curry(function (fn, init, data) { return __awaiter(_this, void 0, void 0, function () {
var recursion;
var _this = this;
return __generator(this, function (_a) {
recursion = function (accum, rest) { return __awaiter(_this, void 0, void 0, function () {
var head, tail, result;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (data.length === 0) {
return [2, accum];
}
head = rest[0], tail = rest.slice(1);
return [4, fn(accum, head)];
case 1:
result = _a.sent();
return [2, recursion(result, tail)];
}
});
}); };
return [2, recursion(init, data)];
});
}); });
exports.reduceObject = function (fn, initialValue, obj) {
var keys = Object.keys(obj);
return keys.reduce(function (accum, key) { return fn(accum, [key, obj[key]]); }, initialValue);
};
//# sourceMappingURL=index.js.map
|
/*****************************************************
* Copyright (c) 2019, GaraheSoft
* <support@garahesoft.com> All rights reserved.
*
* These are collections of microservices, for trading
* operations to cryptocurrency exchanges.
* Supported exchanges:
* -yobit.io
******************************************************/
var querystring = require('querystring');
var https = require('https');
var http = require('http');
var request = require('request');
var crypto = require('crypto');
var Fs = require('fs')
var db = require ("./db.js");
function connectToDb(invoker) {
if (db === undefined
|| !db.hasOwnProperty('client')
|| db.client === null
|| db.status === "disconnected") {
db.connect();
console.log("DB connection invoked by: " + invoker);
}
}connectToDb("initial");
//Consts
const APPFEE = 0.000; //Put the fee you want to charge for your app here
const RETRYLIMIT = 10; //The number of times to retry on failed operations
//Env variables
//process.env.UV_THREADPOOL_SIZE = 128;
var tapiConfig = {
//put extra configurations for tapi calls here
}
require('seneca')({
timeout: 60000
})
.add(
{cmd: "exWallAddr"},
function(message, done) {
var ret = {to: null}
var depositAddrParams = {
coinName: message.crypto,
need_new: 0
}
callYobitTapi(tapiConfig, 'GetDepositAddress', depositAddrParams, function(depositaddrresp) {
if (depositaddrresp
&& depositaddrresp.success
&& depositaddrresp.success == 1
&& depositaddrresp.return.address) {
ret.to = depositaddrresp.return.address;
}
done(null, ret);
});
}
)
.add(
{cmd: "exRate"},
function(message, done) {
var ret = {};
if (message && message.pair) {
var pair = encodeURIComponent(message.pair.toLowerCase());
var messageparam = {
host: "yobit.io",
endpoint: "/api/3/ticker/" + pair,
protocol: "https"
}
callRESt(messageparam, "POST", null, function(response) {
var firstObj;
for(var key in response) {
if(response.hasOwnProperty(key)) {
firstObj = response[key];
break;
}
}
if (firstObj && firstObj.buy)
ret.usdrate = firstObj.buy;
done(null, ret);
});
} else {
console.error("Invalid contents for message");
done(null, ret);
}
}
)
.add(
{cmd: "exFee"},
function(message, done) {
var ret = {appfee: APPFEE};
if (message && message.pair) {
var messageparam = {
host: "yobit.io",
endpoint: "/api/2/" + encodeURIComponent(message.pair.toLowerCase()) + "/fee",
protocol: "https"
}
callRESt(messageparam, "POST", null, function(response) {
if (response && response.fee_seller) {
ret.percentagefee = response.fee_seller / 100;
}
done(null, ret);
});
} else {
console.error("Invalid contents for message");
done(null, ret);
}
}
)
.add(
{cmd: "paymentServiceFee"},
function(message, done) {
var ret = {
PAYEER: {
descfee: "5%",
numfee: 0.05,
numaddendum: 0
},
advcash: {
descfee: "2%",
numfee: 0.02,
numaddendum: 0
},
visamaster: {
descfee: "5% + 6 USD [2300 USD max charge]",
numfee: 0.05,
numaddendum: 6
},
BTC: {
descfee: "0.0012 BTC",
numfee: 0.00120000,
numaddendum: 0
},
ETH: {
descfee: "0.005 ETH",
numfee: 0.00500000,
numaddendum: 0
},
DOGE: {
descfee: "100 DOGE",
numfee: 100.00000000,
numaddendum: 0
},
WAVES: {
descfee: "0.002 WAVES",
numfee: 0.00200000,
numaddendum: 0
}
};
done (null, ret);
}
)
.add(
{cmd: "isTokenSupported"},
function(message, done) {
var ret = {supported: false};
if (message
&& message.token
&& message.destcrypto) {
var messageparam = {
host: "yobit.io",
endpoint: "/api/3/info",
protocol: "https"
}
callRESt(messageparam, "POST", null, function(response) {
var pair = message.token.toLowerCase() + "_" + message.destcrypto.toLowerCase();
if (response && response.pairs)
ret.supported = pair in response.pairs;
done(null, ret);
});
} else {
console.error("Invalid contents for message");
done(null, ret);
}
}
)
.add(
{cmd: "executeEx"},
function(message, done) {
//message format
//crypto: eth/tokenname,
//destcrypto: coinname,
//amount: <amount>,
//txhash: hash,
//exrate: rate,
//appfee: fee,
//exchangefee: fee,
//withdrawdestination: destination,
//withdrawmode: mode
var ret = {status: "fail"};
if (message
&& message.txhash
&& message.crypto
&& message.amount
&& message.destcrypto
&& message.exrate
&& message.appfee
&& message.exchangefee
&& message.withdrawmode
&& message.withdrawdestination
&& db.status == "connected") {
db.client.query("INSERT INTO transactions(txhash,srccoin,srcamount,exchangerate,destcoin,destamount,appfee,exchangefee,withdrawamount,mysavings,destmode,destaddress,withdrawstatus) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)",
[message.txhash,message.crypto,message.amount,message.exrate,message.destcrypto,0,message.appfee,message.exchangefee,0,0,message.withdrawmode,message.withdrawdestination,'none'],
function(err, result) {
if (err) {
console.error(err);
db.client.end();
db.client = null;
db.status = "disconnected";
connectToDb("executeEx");
done(null, ret);
return;
}
});
message['getinforetrylimit'] = 0;
tradeWithdraw(message);
ret.status = 'pending';
done(null, ret);
} else {
console.error("Invalid contents for message or is not connected to database");
done(null, ret);
}
}
)
.add(
{cmd: "getTWStatus"},
function(message, done) {
var ret = {withdrawstatus: "none"};
if (message && message.txhash) {
db.client.query("SELECT withdrawstatus FROM transactions WHERE txhash='" + message.txhash + "'",
function(err, result, fields) {
if (err) {
console.error(err);
db.client.end();
db.client = null;
db.status = "disconnected";
connectToDb("getTWStatus");
done(null, ret);
return;
}
done (null, result[0]);
});
} else {
console.error("Invalid contents for message");
done(null, ret);
}
}
)
.add(
{cmd: "getTransferStatus"},
function(message, done) {
var ret = {status: 'none'};
if (message && message.txhash) {
var messageparam = {
host: "etherscan.io",
endpoint: "/tx/" + message.txhash,
protocol: "https",
headers: {'Content-Type': "text/html"}
}
callRESt(messageparam, "POST", null, function(response) {
if (response && response.data) {
if (response.data.indexOf('Success') > -1)
ret.status = 'success'
}
done (null, ret);
});
} else {
console.error("Invalid contents for message");
done(null, ret);
}
}
)
.listen({
type: 'http',
port: '10101',
host: '139.162.25.42',
protocol: 'https',
serverOptions : {
key : Fs.readFileSync('ssl/dbangko.com.key', 'utf8'),
cert : Fs.readFileSync('ssl/dbangko.com.crt', 'utf8')
}
})
var tradeWithdraw = function(message) {
callYobitTapi(tapiConfig, 'getInfo', null, function(inforesp) {
if (inforesp
&& inforesp.success
&& inforesp.success == 1
&& inforesp.return.funds
&& inforesp.return.funds[message.crypto.toLowerCase()]
&& inforesp.return.funds[message.crypto.toLowerCase()] >= message.amount) {
db.client.query("UPDATE transactions SET withdrawstatus=? WHERE txhash=?",
['pending',message.txhash],
function(err, result) {
if (err) {
console.error(err);
db.client.end();
db.client = null;
db.status = "disconnected";
connectToDb("getInfo(pending)");
return;
}
});
//Get the updated exchange rate before executing the trade
var pair = encodeURIComponent(message.crypto.toLowerCase() + '_' + message.destcrypto.toLowerCase());
var exrateparam = {
host: "yobit.io",
endpoint: "/api/3/ticker/" + pair,
protocol: "https"
}
callRESt(exrateparam, "POST", null, function(exrateresp) {
var firstObj;
for(var key in exrateresp) {
if(exrateresp.hasOwnProperty(key)) {
firstObj = exrateresp[key];
break;
}
}
if (firstObj && firstObj.buy) {
message['pair'] = pair;
message['newrate'] = firstObj.buy;
message['exwdraw'] = true;
message['orderinforetrylimit'] = 0;
tradeSell(message);
}
});
} else {
console.error("The deposited amount hasn't arrived yet, requerying...");
if (message.getinforetrylimit < RETRYLIMIT) { //limit the retries
setTimeout(function() {
tradeWithdraw(message);
}, 4000);
++message.getinforetrylimit;
} else {
console.error("The deposited amount hasn't arrived yet, requery retry limit is reached");
message.getinforetrylimit = 0;
db.client.query("UPDATE transactions SET withdrawstatus=? WHERE txhash=?",
['rpending',message.txhash],
function(err, result) {
if (err) {
console.error(err);
db.client.end();
db.client = null;
db.status = "disconnected";
connectToDb("getInfo(rpending)");
return;
}
});
}
}
});
}
var tradeSell = function(message) {
var tradeParams = {
pair: message.pair,
type: 'sell',
rate: message.newrate,
amount: message.amount
}
callYobitTapi(tapiConfig, 'Trade', tradeParams, function(traderesp) {
if (traderesp
&& traderesp.success
&& traderesp.success == 1) {
db.client.query("UPDATE transactions SET withdrawstatus=? WHERE txhash=?",
['tsuccess',message.txhash],
function(err, result) {
if (err) {
console.error(err);
db.client.end();
db.client = null;
db.status = "disconnected";
connectToDb("Trade(tsuccess)");
return;
}
});
var orderInfoParams = {order_id: traderesp.return.order_id}
if (message.exwdraw)
withdraw(message, orderInfoParams);
} else {
console.error("Sell trade of " + message.amount + " " + message.pair + " failed");
console.error(traderesp.error);
db.client.query("UPDATE transactions SET withdrawstatus=? WHERE txhash=?",
['tfail',message.txhash],
function(err, result) {
if (err) {
console.error(err);
db.client.end();
db.client = null;
db.status = "disconnected";
connectToDb("Trade(tfail)");
return;
}
});
}
});
}
var withdraw = function(message, orderInfoParams) {
callYobitTapi(tapiConfig, 'OrderInfo', orderInfoParams, function(orderinforesp) {
if (orderinforesp
&& orderinforesp.success
&& orderinforesp.success == 1
&& orderinforesp.return
&& orderinforesp.return[orderInfoParams.order_id]
&& orderinforesp.return[orderInfoParams.order_id].status
&& orderinforesp.return[orderInfoParams.order_id].status == 1) {
var examount = message.amount * message.newrate;
examount = formatDecimal(examount, message.destcrypto, false);
//var exchangefee = examount * message.exchangefee;
//exchangefee = formatDecimal(exchangefee, message.destcrypto);
var appfee = examount * message.appfee; // take the fee you want to charge for them using your app
//appfee = formatDecimal(appfee, message.destcrypto);
var withdrawamount = examount - (/*exchangefee +*/ appfee);
withdrawamount = formatDecimal(withdrawamount, message.destcrypto, false);
var mysavings = (examount - withdrawamount) /*+ exchangefee*/;
mysavings = formatDecimal(mysavings, message.destcrypto, true);
var withdrawParams = {
coinName: message.destcrypto,
amount: withdrawamount,
address: message.withdrawdestination
}
callYobitTapi(tapiConfig, 'WithdrawCoinsToAddress', withdrawParams, function(withdrawresp) {
if (withdrawresp
&& withdrawresp.success
&& withdrawresp.success == 1) {
db.client.query("UPDATE transactions SET destamount=?,withdrawamount=?,dbangkosavings=?,withdrawstatus=? WHERE txhash=?",
[examount,withdrawamount,dbangkosavings,'wsuccess',message.txhash],
function(err, result) {
if (err) {
console.error(err);
db.client.end();
db.client = null;
db.status = "disconnected";
connectToDb("WithdrawCoinsToAddress(wsuccess)");
return;
}
});
} else {
console.error("Failed to withdraw " + withdrawamount + " " + message.destcrypto + " to " + message.withdrawdestination);
db.client.query("UPDATE transactions SET withdrawstatus=? WHERE txhash=?",
['wfail',message.txhash],
function(err, result) {
if (err) {
console.error(err);
db.client.end();
db.client = null;
db.status = "disconnected";
connectToDb("WithdrawCoinsToAddress(wfail)");
return;
}
});
}
});
} else {
console.error("Sell order is not yet closed, requerying...");
if (message.orderinforetrylimit < RETRYLIMIT) { //limit the retries
setTimeout(function() {
withdraw(message, orderInfoParams);
}, 4000);
++message.orderinforetrylimit;
} else {
console.error("Sell order is not yet closed, requery retry limit is reached");
message.orderinforetrylimit = 0;
db.client.query("UPDATE transactions SET withdrawstatus=? WHERE txhash=?",
['wfail',message.txhash],
function(err, result) {
if (err) {
console.error(err);
db.client.end();
db.client = null;
db.status = "disconnected";
connectToDb("OrderInfo(wfail)");
return;
}
});
}
}
});
}
var formatDecimal = function(decimaldata, coin, isfee) {
var ret = decimaldata.toString();
var retidx = ret.indexOf(".");
if (retidx == -1)
ret = "0";
var deciCount = 0;
switch (coin) {
case "usd":
isfee ? deciCount = 8 : deciCount = 2;
if (retidx > -1)
ret = ret.slice(retidx, deciCount + 2);
break;
case "btc":
case "doge":
case "waves":
isfee ? deciCount = 8 : deciCount = 8;
if (retidx > -1)
ret = ret.slice(retidx, deciCount + 2);
break;
case "eth":
isfee ? deciCount = 18 : deciCount = 8;
if (retidx > -1)
ret = ret.slice(retidx, deciCount + 2);
break;
default:
console.error("Invalid coin");
break;
}
return (Math.floor(decimaldata) + (ret * 1));
}
var callRESt = function(message, method, data, success) {
if (!message) {
console.error("message parameter is not defined");
return;
}
var dataString = "";
if (data) {
if (data.constructor.name != 'String')
dataString = JSON.stringify(data);
else
dataString = data;
}
var headers = {};
if (message.headers)
headers = message.headers;
var endpoint = message.endpoint;
if (method == 'GET') {
if (data) {
if (data.constructor.name != 'String')
endpoint += '?' + querystring.stringify(data);
else
endpoint += '?' + data;
}
} else if (method == 'POST') {
headers['Keep-Alive'] = 'timeout=15, max=5';
if (!headers['Content-Type'])
headers['Content-Type'] = 'application/json'; //Set default Content-Type if no property found
headers['Content-Length'] = dataString.length;
} else {
console.error("Invalid Http method, valid values are GET/POST");
return;
}
var options = {
host: message.host,
path: endpoint,
method: method,
headers: headers
};
var connobj = message.protocol == 'https' ? https : http;
var req = https.request(options, function(res) {
res.setEncoding('utf-8');
var responseString = '';
res.on('data', function(data) {
responseString += data;
});
res.on('end', function() {
var responseObject = {};
try {
if (options.headers['Content-Type'] === 'text/html')
responseObject = {data: responseString};
else
responseObject = JSON.parse(responseString);
} catch(exception) {
console.error(exception.message);
} finally {
success(responseObject);
}
});
});
req.on('error', (err) => {
console.error(err.message);
});
req.write(dataString);
req.end();
}
var callYobitTapi = function(config, method, methodparams, callback) {
if (!methodparams)
methodparams = {};
db.client.query("SELECT * FROM tapi WHERE nonce < 2147483646 ORDER BY id",
function(err, result, fields) {
if (err) {
console.error(err);
db.client.end();
db.client = null;
b.status = "disconnected";
connectToDb("nonce(select)");
return;
}
if (!config['nonce']){
config = result[0];
}
methodparams['method'] = method;
methodparams['nonce'] = config.nonce;
if (config.nonce < 2147483646) {
db.client.query("UPDATE tapi SET nonce=? WHERE id=?",
[++config.nonce,config.id],
function(err, res) {
if (err) {
console.error(err);
db.client.end();
db.client = null;
b.status = "disconnected";
connectToDb("nonce(update)");
return;
}
});
} else {
console.error("nonce exceeds the allowable limit of 2147483646");
return;
}
var data = "";
for (var paramelem in methodparams) {
data += paramelem + "=" + methodparams[paramelem] + "&";
}
data = data.substr(0, data.length-1);
var hash = crypto.createHmac('sha512', config.secret);
hash.update(data);
var signature = hash.digest('hex');
var tapiHeaders = {
'Sign': signature,
'Key': config.key,
'User-Agent': "Mozilla/5.0",
'Content-Type': "application/x-www-form-urlencoded"
}
var tapiReqParams = {
host: "yobit.io",
endpoint: "/tapi/",
protocol: "https",
headers: tapiHeaders
}
callRESt(tapiReqParams, 'POST', data, callback);
});
}
|
"use strict";
const _ = require('lodash');
const $ = require('sand-dollar');
class GeneralError extends Error {
/**
* Create and error with a message and optional message to log
*
* @param {string} message - the user friendly error message
* @param {string|bool} logMessage - a message to log if string, or logs the message if true
*/
constructor(message, logMessage) {
super();
if (message instanceof Error) {
_.extend(this, $.transgress(message));
} else {
if (_.isArray(message)) {
this.message = message.join('\n');
} else {
this.message = message;
}
}
if ('test' !== sand.env) {
if ('string' === typeof logMessage) {
sand.error(logMessage);
} else if (true === typeof logMessage) {
sand.error(message);
}
}
Object.defineProperty(this, 'expose', {
enumerable: false,
writable: true,
value: true
});
}
}
module.exports = GeneralError;
|
'use strict';
function isLegacyEnabled(options) {
return !options.hasOwnProperty('legacy') || options.legacy;
}
function precisionRound(number, precision) {
if (typeof precision === 'number') {
const factor = Math.pow(10, precision);
return Math.round(number * factor) / factor;
} else if (typeof precision === 'object') {
const thresholds = Object.keys(precision).map(Number).sort((a, b) => b - a);
for (const t of thresholds) {
if (! isNaN(t) && number >= t) {
return precisionRound(number, precision[t]);
}
}
}
return number;
}
function toLocalISOString(dDate) {
const tzOffset = -dDate.getTimezoneOffset();
const plusOrMinus = tzOffset >= 0 ? '+' : '-';
const pad = function(num) {
const norm = Math.floor(Math.abs(num));
return (norm < 10 ? '0' : '') + norm;
};
return dDate.getFullYear() +
'-' + pad(dDate.getMonth() + 1) +
'-' + pad(dDate.getDate()) +
'T' + pad(dDate.getHours()) +
':' + pad(dDate.getMinutes()) +
':' + pad(dDate.getSeconds()) +
plusOrMinus + pad(tzOffset / 60) +
':' + pad(tzOffset % 60);
}
function numberWithinRange(number, min, max) {
if (number > max) {
return max;
} else if (number < min) {
return min;
} else {
return number;
}
}
/**
* Maps number from one range to another. In other words it performs a linear interpolation.
* Note that this function can interpolate values outside source range (linear extrapolation).
* @param {number} value value to map
* @param {number} fromLow source range lower value
* @param {number} fromHigh source range upper value
* @param {number} toLow target range lower value
* @param {number} toHigh target range upper value
* @param {number} [precision=0] number of decimal places to which result should be rounded
* @return {number} value mapped to new range
*/
function mapNumberRange(value, fromLow, fromHigh, toLow, toHigh, precision=0) {
const mappedValue = toLow + (value - fromLow) * (toHigh - toLow) / (fromHigh - fromLow);
return precisionRound(mappedValue, precision);
}
const transactionStore = {};
function hasAlreadyProcessedMessage(msg, ID=null, key=null) {
const currentID = ID !== null ? ID : msg.meta.zclTransactionSequenceNumber;
key = key || msg.device.ieeeAddr;
if (transactionStore[key] === currentID) return true;
transactionStore[key] = currentID;
return false;
}
const defaultPrecision = {temperature: 2, humidity: 2, pressure: 1, pm25: 0};
function calibrateAndPrecisionRoundOptions(number, options, type) {
// Calibrate
const calibrateKey = `${type}_calibration`;
let calibrationOffset = options && options.hasOwnProperty(calibrateKey) ? options[calibrateKey] : 0;
if (type == 'illuminance' || type === 'illuminance_lux') {
// linear calibration because measured value is zero based
// +/- percent
calibrationOffset = Math.round(number * calibrationOffset / 100);
}
number = number + calibrationOffset;
// Precision round
const precisionKey = `${type}_precision`;
const defaultValue = defaultPrecision[type] || 0;
const precision = options && options.hasOwnProperty(precisionKey) ? options[precisionKey] : defaultValue;
return precisionRound(number, precision);
}
function toPercentage(value, min, max) {
if (value > max) {
value = max;
} else if (value < min) {
value = min;
}
const normalised = (value - min) / (max - min);
return Math.round(normalised * 100);
}
function addActionGroup(payload, msg, definition) {
const disableActionGroup = definition.meta && definition.meta.disableActionGroup;
if (!disableActionGroup && msg.groupID) {
payload.action_group = msg.groupID;
}
}
function postfixWithEndpointName(value, msg, definition) {
if (definition.meta && definition.meta.multiEndpoint) {
const endpointName = definition.hasOwnProperty('endpoint') ?
getKey(definition.endpoint(msg.device), msg.endpoint.ID) : msg.endpoint.ID;
return `${value}_${endpointName}`;
} else {
return value;
}
}
function getKey(object, value, fallback, convertTo) {
for (const key in object) {
if (object[key]===value) {
return convertTo ? convertTo(key) : key;
}
}
return fallback;
}
function batteryVoltageToPercentage(voltage, option) {
let percentage = null;
if (option === '3V_2100') {
if (voltage < 2100) {
percentage = 0;
} else if (voltage < 2440) {
percentage = 6 - ((2440 - voltage) * 6) / 340;
} else if (voltage < 2740) {
percentage = 18 - ((2740 - voltage) * 12) / 300;
} else if (voltage < 2900) {
percentage = 42 - ((2900 - voltage) * 24) / 160;
} else if (voltage < 3000) {
percentage = 100 - ((3000 - voltage) * 58) / 100;
} else if (voltage >= 3000) {
percentage = 100;
}
percentage = Math.round(percentage);
} else if (option === '3V_2500') {
percentage = toPercentage(voltage, 2500, 3000);
} else if (option === '3V_2500_3200') {
percentage = toPercentage(voltage, 2500, 3200);
} else if (option === '3V_1500_2800') {
percentage = 235 - 370000 / (voltage + 1);
if (percentage > 100) {
percentage = 100;
} else if (percentage < 0) {
percentage = 0;
}
percentage = Math.round(percentage);
} else if (option === '4LR6AA1_5v') {
percentage = toPercentage(voltage, 3000, 4200);
} else {
throw new Error(`Not batteryVoltageToPercentage type supported: ${option}`);
}
return percentage;
}
// groupStrategy: allEqual: return only if all members in the groups have the same meta property value.
// first: return the first property
function getMetaValue(entity, definition, key, groupStrategy='first', defaultValue=undefined) {
if (entity.constructor.name === 'Group' && entity.members.length > 0) {
const values = [];
for (let i = 0; i < entity.members.length; i++) {
const memberMetaMeta = getMetaValues(definition[i], entity.members[i]);
if (memberMetaMeta && memberMetaMeta.hasOwnProperty(key)) {
if (groupStrategy === 'first') {
return memberMetaMeta[key];
}
values.push(memberMetaMeta[key]);
} else {
values.push(defaultValue);
}
}
if (groupStrategy === 'allEqual' && (new Set(values)).size === 1) {
return values[0];
}
} else {
const definitionMeta = getMetaValues(definition, entity);
if (definitionMeta && definitionMeta.hasOwnProperty(key)) {
return definitionMeta[key];
}
}
return defaultValue;
}
function hasEndpoints(device, endpoints) {
const eps = device.endpoints.map((e) => e.ID);
for (const endpoint of endpoints) {
if (!eps.includes(endpoint)) {
return false;
}
}
return true;
}
function isInRange(min, max, value) {
return value >= min && value <= max;
}
function replaceInArray(arr, oldElements, newElements) {
const clone = [...arr];
for (let i = 0; i < oldElements.length; i++) {
const index = clone.indexOf(oldElements[i]);
if (index !== -1) {
clone[index] = newElements[i];
} else {
throw new Error('Element not in array');
}
}
return clone;
}
function filterObject(obj, keys) {
const result = {};
for (const [key, value] of Object.entries(obj)) {
if (keys.includes(key)) {
result[key] = value;
}
}
return result;
}
async function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
function toSnakeCase(value) {
if (typeof value === 'object') {
for (const key of Object.keys(value)) {
const keySnakeCase = toSnakeCase(key);
if (key !== keySnakeCase) {
value[keySnakeCase] = value[key];
delete value[key];
}
}
return value;
} else {
return value.replace(/\.?([A-Z])/g, (x, y) => '_' + y.toLowerCase()).replace(/^_/, '').replace('_i_d', '_id');
}
}
function toCamelCase(value) {
if (typeof value === 'object') {
for (const key of Object.keys(value)) {
const keyCamelCase = toCamelCase(key);
if (key !== keyCamelCase) {
value[keyCamelCase] = value[key];
delete value[key];
}
}
return value;
} else {
return value.replace(/_([a-z])/g, (x, y) => y.toUpperCase());
}
}
function saveSceneState(entity, sceneID, groupID, state, name) {
const attributes = ['state', 'brightness', 'color', 'color_temp', 'color_mode'];
if (!entity.meta.hasOwnProperty('scenes')) entity.meta.scenes = {};
const metaKey = `${sceneID}_${groupID}`;
entity.meta.scenes[metaKey] = {name, state: filterObject(state, attributes)};
entity.save();
}
function deleteSceneState(entity, sceneID=null, groupID=null) {
if (entity.meta.scenes) {
if (sceneID == null && groupID == null) {
entity.meta.scenes = {};
} else {
const metaKey = `${sceneID}_${groupID}`;
if (entity.meta.scenes.hasOwnProperty(metaKey)) {
delete entity.meta.scenes[metaKey];
}
}
entity.save();
}
}
function getSceneState(entity, sceneID, groupID) {
const metaKey = `${sceneID}_${groupID}`;
if (entity.meta.hasOwnProperty('scenes') && entity.meta.scenes.hasOwnProperty(metaKey)) {
return entity.meta.scenes[metaKey].state;
}
return null;
}
function getEntityOrFirstGroupMember(entity) {
if (entity.constructor.name === 'Group') {
return entity.members.length > 0 ? entity.members[0] : null;
} else {
return entity;
}
}
function getTransition(entity, key, meta) {
const {options, message} = meta;
let manufacturerIDs = [];
if (entity.constructor.name === 'Group') {
manufacturerIDs = entity.members.map((m) => m.getDevice().manufacturerID);
} else if (entity.constructor.name === 'Endpoint') {
manufacturerIDs = [entity.getDevice().manufacturerID];
}
if (manufacturerIDs.includes(4476)) {
/**
* When setting both brightness and color temperature with a transition, the brightness is skipped
* for IKEA TRADFRI bulbs.
* To workaround this we skip the transition for the brightness as it is applied first.
* https://github.com/Koenkk/zigbee2mqtt/issues/1810
*/
if (key === 'brightness' && (message.hasOwnProperty('color') || message.hasOwnProperty('color_temp'))) {
return {time: 0, specified: false};
}
}
if (message.hasOwnProperty('transition')) {
return {time: message.transition * 10, specified: true};
} else if (options.hasOwnProperty('transition')) {
return {time: options.transition * 10, specified: true};
} else {
return {time: 0, specified: false};
}
}
function getOptions(definition, entity, options={}) {
const allowed = ['disableDefaultResponse', 'timeout'];
return getMetaValues(definition, entity, allowed, options);
}
function getMetaValues(definition, entity, allowed, options={}) {
const result = {...options};
if (definition && definition.meta) {
for (const key of Object.keys(definition.meta)) {
if (allowed == null || allowed.includes(key)) {
const value = definition.meta[key];
result[key] = typeof value === 'function' ? value(entity) : value;
}
}
}
return result;
}
function getObjectProperty(object, key, defaultValue) {
return object && object.hasOwnProperty(key) ? object[key] : defaultValue;
}
function validateValue(value, allowed) {
if (!allowed.includes(value)) {
throw new Error(`'${value}' not allowed, choose between: ${allowed}`);
}
}
function normalizeCelsiusVersionOfFahrenheit(value) {
const fahrenheit = (value * 1.8) + 32;
const roundedFahrenheit = (Math.round((fahrenheit * 2).toFixed(1)) / 2).toFixed(1);
return ((roundedFahrenheit - 32)/1.8).toFixed(2);
}
function extendDevice(deviceConfigs, modelName, adjustments) {
const baseDevice = deviceConfigs.find((device) => device.model === modelName);
if (typeof baseDevice !== 'object') {
throw Error(`Could not find model ${modelName} in provided device list`);
}
return {...baseDevice, ...adjustments};
}
module.exports = {
getOptions,
isLegacyEnabled,
precisionRound,
toLocalISOString,
numberWithinRange,
mapNumberRange,
hasAlreadyProcessedMessage,
calibrateAndPrecisionRoundOptions,
toPercentage,
addActionGroup,
postfixWithEndpointName,
getKey,
getObjectProperty,
batteryVoltageToPercentage,
getEntityOrFirstGroupMember,
getTransition,
getMetaValue,
validateValue,
hasEndpoints,
isInRange,
replaceInArray,
filterObject,
saveSceneState,
sleep,
toSnakeCase,
toCamelCase,
normalizeCelsiusVersionOfFahrenheit,
deleteSceneState,
getSceneState,
extendDevice,
};
|
const UserController = require('../controller/userController')
const authentication = require('../auth/auth')
const express = require('express')
const router = express.Router()
// rota para cadastro
router.post('/user/signup', UserController.signUp)
// rota para login
router.post('/user/signin', UserController.signIn)
// rota para deletar user
router.delete('/user/delete/:id', authentication.auth, UserController.deleteUser)
module.exports = router
|
const expect = require('chai').expect;
const activateAndControlSW = require('../../../infra/testing/activate-and-control');
const cleanSWEnv = require('../../../infra/testing/clean-sw');
describe(`[workbox-precaching] Precache and Update`, function() {
const DB_NAME = 'workbox-precache-http___localhost_3004_test_workbox-precaching_static_precache-and-update_';
let testServerAddress = global.__workbox.server.getAddress();
const testingUrl = `${testServerAddress}/test/workbox-precaching/static/precache-and-update/`;
beforeEach(async function() {
// Navigate to our test page and clear all caches before this test runs.
await cleanSWEnv(global.__workbox.webdriver, testingUrl);
});
const getCachedRequests = (cacheName) => {
return global.__workbox.webdriver.executeAsyncScript((cacheName, cb) => {
caches.open(cacheName)
.then((cache) => {
return cache.keys();
})
.then((keys) => {
cb(
keys.map((request) => request.url).sort()
);
});
}, cacheName);
};
it(`should load a page with service worker `, async function() {
const SW_1_URL = `${testingUrl}sw-1.js`;
const SW_2_URL = `${testingUrl}sw-2.js`;
await global.__workbox.webdriver.get(testingUrl);
const getIdbData = global.__workbox.seleniumBrowser.getId() === 'safari' ?
require('../utils/getPrecachedIDBData-safari') :
require('../utils/getPrecachedIDBData');
// Precaching will cache bust with a search param in some situations.
const needsCacheBustSearchParam = await global.__workbox.webdriver.executeScript(() => {
return !('cache' in Request.prototype);
});
// Clear out the counters so that we start fresh.
global.__workbox.server.reset();
// Register the first service worker.
await activateAndControlSW(SW_1_URL);
// Check that only the precache cache was created.
const keys = await global.__workbox.webdriver.executeAsyncScript((cb) => {
caches.keys().then((keys) => cb(keys));
});
expect(keys).to.deep.equal([
'workbox-precache-http://localhost:3004/test/workbox-precaching/static/precache-and-update/-temp',
'workbox-precache-http://localhost:3004/test/workbox-precaching/static/precache-and-update/',
]);
// Check that the cached requests are what we expect for sw-1.js
let cachedRequests = await getCachedRequests('workbox-precache-http://localhost:3004/test/workbox-precaching/static/precache-and-update/');
expect(cachedRequests).to.deep.equal([
'http://localhost:3004/test/workbox-precaching/static/precache-and-update/index.html',
'http://localhost:3004/test/workbox-precaching/static/precache-and-update/styles/index.css',
]);
let savedIDBData = await getIdbData(DB_NAME);
expect(savedIDBData).to.deep.equal([
{
revision: '1',
url: 'http://localhost:3004/test/workbox-precaching/static/precache-and-update/index.html',
},
{
revision: '1',
url: 'http://localhost:3004/test/workbox-precaching/static/precache-and-update/styles/index.css',
},
]);
// Make sure the requested URL's include cache busting search param if needed.
let requestsMade = global.__workbox.server.getRequests();
if (needsCacheBustSearchParam) {
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/styles/index.css']).to.equal(1);
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/index.html?_workbox-cache-bust=1']).to.equal(1);
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/styles/index.css?_workbox-cache-bust=1']).to.equal(1);
} else {
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/styles/index.css']).to.equal(1);
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/index.html']).to.equal(1);
}
// Request the page and check that the precached assets weren't requested from the network
global.__workbox.server.reset();
await global.__workbox.webdriver.get(testingUrl);
requestsMade = global.__workbox.server.getRequests();
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/']).to.equal(undefined);
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/index.html']).to.equal(undefined);
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/styles/index.css']).to.equal(undefined);
// This is a crude way to fake an updated service worker.
const error = await global.__workbox.webdriver.executeAsyncScript((SW_1_URL, cb) => {
navigator.serviceWorker.getRegistration()
.then((reg) => reg.unregister(SW_1_URL))
.then(() => cb())
.catch((err) => cb(err.message));
}, SW_1_URL);
if (error) {
throw error;
}
// Activate the second service worker
await activateAndControlSW(SW_2_URL);
// Ensure that the new assets were requested and cache busted.
requestsMade = global.__workbox.server.getRequests();
if (needsCacheBustSearchParam) {
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/index.html?_workbox-cache-bust=2']).to.equal(1);
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/new-request.txt?_workbox-cache-bust=2']).to.equal(1);
} else {
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/index.html']).to.equal(1);
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/new-request.txt']).to.equal(1);
}
// Check that the cached entries were deleted / added as expected when
// updating from sw-1.js to sw-2.js
cachedRequests = await getCachedRequests('workbox-precache-http://localhost:3004/test/workbox-precaching/static/precache-and-update/');
expect(cachedRequests).to.deep.equal([
'http://localhost:3004/test/workbox-precaching/static/precache-and-update/index.html',
'http://localhost:3004/test/workbox-precaching/static/precache-and-update/new-request.txt',
]);
savedIDBData = await getIdbData(DB_NAME);
expect(savedIDBData).to.deep.equal([
{
revision: '2',
url: 'http://localhost:3004/test/workbox-precaching/static/precache-and-update/index.html',
},
{
revision: '2',
url: 'http://localhost:3004/test/workbox-precaching/static/precache-and-update/new-request.txt',
},
]);
// Refresh the page and test that the requests are as expected
global.__workbox.server.reset();
await global.__workbox.webdriver.get(testingUrl);
requestsMade = global.__workbox.server.getRequests();
// Ensure the HTML page is returned from cache and not network
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/']).to.equal(undefined);
// Ensure the now deleted index.css file is returned from network and not cache.
expect(requestsMade['/test/workbox-precaching/static/precache-and-update/styles/index.css']).to.equal(1);
});
});
|
// set up status variables used by multiple functions
var rt = null;
var current = 0;
var current_stale = false;
var past_decimal = 0;
var in_operation = null;
var out = document.getElementById("out");
out.innerHTML = "Click to enter numbers and operators";
// get relevant page elements
var button_table= document.getElementById("button_holder");
var function_buttons = button_table.getElementsByClassName("function_button");
var number_buttons = button_table.getElementsByClassName("number_button");
// add event listeners for digit buttons
for (to_add = 0; to_add < number_buttons.length; to_add++) {
number_buttons[to_add].addEventListener("click",
function (event) { digit_pressed(event.target.value); },
false);
}
// add event listeners for operator buttons and other special buttons
for (to_add = 0; to_add < function_buttons.length; to_add++) {
function_buttons[to_add].addEventListener("click",
function (event) {
evt = event.target.value;
switch (evt) {
case "C":
clear_pressed();
break;
case "/":
division();
break;
case "*":
multiplication();
break;
case "-":
subtraction();
break;
case "+":
addition();
break;
case ".":
decimal_pressed();
break;
case "=":
calculate();
break;
}
},
false);
}
function update_output(out_number) {
// update the currently displayed number
var out_string = out_number;
// This detects and handles the decimal point and any zeroes after it.
if (past_decimal > 0 && current === Math.floor(current)) {
out_string = out_string + ".";
for (decm = 0; decm < past_decimal - 1; decm++) {
out_string = out_string + "0";
}
}
// This detects and handles numbers and operations out of the scope of what the calculator can handle,
// such as numbers too big to fit in a standard variable and division by zero.
if (isFinite(out_number) === false || isNaN(out_number) === true) {
clear_all();
out_string = "E";
}
out.innerHTML = out_string;
} // update_output
function clear_pressed() {
// responds to the C button
update_output("Clearing...");
clear_all();
update_output("0");
} // clear_pressed
function clear_all() {
// clears everything out
rt = null;
current = 0;
current_stale = false;
past_decimal = 0;
in_operation = null;
} // clear_all
function digit_pressed(incoming) {
// respond to digit buttons
// Check if current number is stale, and reset it if it is.
// This allows the last number entered to be kept around for repeated use of = until the user enters another number.
if (current_stale) {
current = 0;
current_stale = false;
}
// This adjusts the current number to account for ordinary numeric input.
if (past_decimal === 0) {
current = current * 10 + Number(incoming);
}
else {
// This adjusts the current number to account for numeric input after the decimal point has been entered.
// The variable past_decimal keeps track of how many times a digit has been added after the decimal.
// Raising 0.1 to the power of the position past the decimal produces 0.1, 0.01, 0.001, etc.
current = current + (Math.pow((0.1), past_decimal) * Number(incoming));
past_decimal++;
}
update_output(current);
} // digit_pressed
function decimal_pressed() {
// respond to the decimal point button
if (past_decimal === 0) {
past_decimal = 1;
}
update_output(current);
} // decimal_pressed
function division() {
// respond to the / button
if (current_stale === false) calculate();
in_operation = "divide";
} // division
function multiplication() {
// respond to the * button
if (current_stale === false) calculate();
in_operation = "multiply";
} // multiplication
function subtraction() {
// respond to the - button
if (current_stale === false) calculate();
in_operation = "subtract";
} // subtraction
function addition() {
// respond to the + button
if (current_stale === false) calculate();
in_operation = "add";
} // addition
function calculate() {
// This is called whenever an operator button is pressed, and is the only thing called when the = button is pressed.
// It does all of the actual user-relevant calculation.
if (rt === null) {
rt = current;
}
else {
switch (in_operation) {
case ("add"):
rt = rt + current;
break;
case ("subtract"):
rt = rt - current;
break;
case ("multiply"):
rt = rt * current;
break;
case ("divide"):
rt = rt / current;
break;
}
}
// check if something other than an ordinary number was calculated last
if (out.innerHTML !== "E") {
current_stale = true;
past_decimal = 0;
update_output(rt);
}
} // calculate
|
import React from "react";
import { useWizard, Wizard } from "react-use-wizard";
import Layout from "../components/layout";
const Step = ({ number }) => {
const { handleStep } = useWizard();
handleStep(() => {
alert(`Going to step ${number}`);
});
return <p>Step {number}</p>;
};
const Footer = () => {
const {
nextStep,
previousStep,
isLoading,
activeStep,
isLastStep,
isFirstStep
} = useWizard();
return (
<code>
<div style={{ display: "flex", gap: "1rem" }}>
<p>Has previous step: {!isFirstStep ? "✅" : "⛔"}</p>
<br />
<p>Has next step: {!isLastStep ? "✅" : "⛔"} </p>
<br />
<p>
Active step: {activeStep + 1} <br />
</p>
</div>
<div>
<button
onClick={() => previousStep()}
disabled={isLoading || isFirstStep}
>
Previous
</button>
<button onClick={() => nextStep()} disabled={isLoading || isLastStep}>
Next
</button>
</div>
</code>
);
};
const IndexPage = () => {
return (
<Layout>
<Wizard footer={<Footer />}>
<Step number={1} />
<Step number={2} />
<Step number={3} />
</Wizard>
</Layout>
);
};
export default IndexPage;
|
import { describe, it } from 'flow-typed-test';
import createEnturService, { ONSTREET_BUS, FeatureCategory } from '@entur/sdk'
describe('createEnturService', () => {
it('creates a service', () => {
const service = createEnturService({
clientName: 'flow-typed'
})
});
it('fails if using wrong typefor service', () => {
// $FlowExpectedError[incompatible-type] wrong return type
const numberService: number = createEnturService({
clientName: 'flow-typed'
})
});
})
describe('findTrips', () => {
it('can call findTrips', () => {
const service = createEnturService({
clientName: 'flow-typed'
})
service.findTrips(
'Oslo',
'Bergen'
)
});
it('fails if using parameter is missing', () => {
const service = createEnturService({
clientName: 'flow-typed'
})
// $FlowExpectedError[incompatible-call]
service.findTrips('Oslo')
});
})
describe('getQuaysForStopPlace', () => {
it('can be called with single argument', () => {
const service = createEnturService({ clientName: 'flow-typed' })
const p: Promise<Array<$entur$sdk$Quay>> = service.getQuaysForStopPlace('NSR:StopPlace:1')
});
it('cannot be called without arguments', () => {
const service = createEnturService({ clientName: 'flow-typed' })
// $FlowExpectedError[incompatible-call]
const p: Promise<Array<$entur$sdk$Quay>> = service.getQuaysForStopPlace()
});
it('can be called with options', () => {
const service = createEnturService({ clientName: 'flow-typed' })
const p: Promise<Array<$entur$sdk$Quay>> = service.getQuaysForStopPlace('NSR:StopPlace:1', {
filterByInUse: true
})
});
it('can be called with options', () => {
const service = createEnturService({ clientName: 'flow-typed' })
// $FlowExpectedError[prop-missing]
const p: Promise<Array<$entur$sdk$Quay>> = service.getQuaysForStopPlace('NSR:StopPlace:1', {
allowCheeses: ['camembert', 'brie']
})
});
})
describe('FeatureCategory constants', () => {
it('can import individual constants', () => {
const onstreetBus: string = ONSTREET_BUS
});
it('can use FeatureCategory enum', () => {
const onstreetBus: string = FeatureCategory.ONSTREET_BUS
});
})
|
/*!
* ui-select
* http://github.com/angular-ui/ui-select
* Version: 0.19.8 - 2020-07-02T08:56:13.966Z
* License: MIT
*/
!function(){"use strict";function e(e){return angular.isUndefined(e)||null===e}var t={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,COMMAND:91,MAP:{91:"COMMAND",8:"BACKSPACE",9:"TAB",13:"ENTER",16:"SHIFT",17:"CTRL",18:"ALT",19:"PAUSEBREAK",20:"CAPSLOCK",27:"ESC",32:"SPACE",33:"PAGE_UP",34:"PAGE_DOWN",35:"END",36:"HOME",37:"LEFT",38:"UP",39:"RIGHT",40:"DOWN",43:"+",44:"PRINTSCREEN",45:"INSERT",46:"DELETE",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NUMLOCK",145:"SCROLLLOCK",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},isControl:function(e){var s=e.which;switch(s){case t.COMMAND:case t.SHIFT:case t.CTRL:case t.ALT:return!0}return!!(e.metaKey||e.ctrlKey||e.altKey)},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&e<=123},isVerticalMovement:function(e){return~[t.UP,t.DOWN].indexOf(e)},isHorizontalMovement:function(e){return~[t.LEFT,t.RIGHT,t.BACKSPACE,t.DELETE].indexOf(e)},toSeparator:function(e){var s={ENTER:"\n",TAB:"\t",SPACE:" "}[e];return s?s:t[e]?void 0:e}};void 0===angular.element.prototype.querySelectorAll&&(angular.element.prototype.querySelectorAll=function(e){return angular.element(this[0].querySelectorAll(e))}),void 0===angular.element.prototype.closest&&(angular.element.prototype.closest=function(e){for(var t=this[0],s=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector;t;){if(s.bind(t)(e))return t;t=t.parentElement}return!1});var s=0,l=angular.module("ui.select",[]).constant("uiSelectConfig",{theme:"bootstrap",searchEnabled:!0,sortable:!1,placeholder:"",refreshDelay:1e3,closeOnSelect:!0,skipFocusser:!1,dropdownPosition:"auto",removeSelected:!0,resetSearchInput:!0,generateId:function(){return s++},appendToBody:!1,spinnerEnabled:!1,spinnerClass:"glyphicon glyphicon-refresh ui-select-spin",backspaceReset:!0}).service("uiSelectMinErr",function(){var e=angular.$$minErr("ui.select");return function(){var t=e.apply(this,arguments),s=t.message.replace(new RegExp("\nhttp://errors.angularjs.org/.*"),"");return new Error(s)}}).directive("uisTranscludeAppend",function(){return{link:function(e,t,s,l,i){i(e,function(e){t.append(e)})}}}).filter("highlight",function(){function e(e){return(""+e).replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(t,s){return s&&t?(""+t).replace(new RegExp(e(s),"gi"),'<span class="ui-select-highlight">$&</span>'):t}}).factory("uisOffset",["$document","$window",function(e,t){return function(s){var l=s[0].getBoundingClientRect();return{width:l.width||s.prop("offsetWidth"),height:l.height||s.prop("offsetHeight"),top:l.top+(t.pageYOffset||e[0].documentElement.scrollTop),left:l.left+(t.pageXOffset||e[0].documentElement.scrollLeft)}}}]);l.factory("$$uisDebounce",["$timeout",function(e){return function(t,s){var l;return function(){var i=this,c=Array.prototype.slice.call(arguments);l&&e.cancel(l),l=e(function(){t.apply(i,c)},s)}}}]),l.directive("uiSelectChoices",["uiSelectConfig","uisRepeatParser","uiSelectMinErr","$compile","$window",function(e,t,s,l,i){return{restrict:"EA",require:"^uiSelect",replace:!0,transclude:!0,templateUrl:function(t){t.addClass("ui-select-choices");var s=t.parent().attr("theme")||e.theme;return s+"/choices.tpl.html"},compile:function(l,c){if(!c.repeat)throw s("repeat","Expected 'repeat' expression.");var n=c.groupBy,a=c.groupFilter;if(n){var r=l.querySelectorAll(".ui-select-choices-group");if(1!==r.length)throw s("rows","Expected 1 .ui-select-choices-group but got '{0}'.",r.length);r.attr("ng-repeat",t.getGroupNgRepeatExpression())}var o=t.parse(c.repeat),u=l.querySelectorAll(".ui-select-choices-row");if(1!==u.length)throw s("rows","Expected 1 .ui-select-choices-row but got '{0}'.",u.length);u.attr("ng-repeat",o.repeatExpression(n)).attr("ng-if","$select.open");var d=l.querySelectorAll(".ui-select-choices-row-inner");if(1!==d.length)throw s("rows","Expected 1 .ui-select-choices-row-inner but got '{0}'.",d.length);d.attr("uis-transclude-append","");var p=i.document.addEventListener?u:d;return p.attr("ng-click","$select.select("+o.itemName+",$select.skipFocusser,$event)"),function(t,s,i,c){c.parseRepeatAttr(i.repeat,n,a),c.disableChoiceExpression=i.uiDisableChoice,c.onHighlightCallback=i.onHighlight,c.minimumInputLength=parseInt(i.minimumInputLength)||0,c.dropdownPosition=i.position?i.position.toLowerCase():e.dropdownPosition,t.$watch("$select.search",function(e){e&&!c.open&&c.multiple&&c.activate(!1,!0),c.activeIndex=c.tagging.isActivated?-1:0,!i.minimumInputLength||c.search.length>=i.minimumInputLength?c.refresh(i.refresh):c.items=[]}),i.$observe("refreshDelay",function(){var s=t.$eval(i.refreshDelay);c.refreshDelay=void 0!==s?s:e.refreshDelay}),t.$watch("$select.open",function(e){e?(l.attr("role","listbox"),c.refresh(i.refresh)):s.removeAttr("role")})}}}}]),l.controller("uiSelectCtrl",["$scope","$element","$timeout","$filter","$$uisDebounce","uisRepeatParser","uiSelectMinErr","uiSelectConfig","$parse","$injector","$window",function(s,l,i,c,n,a,r,o,u,d,p){function h(e,t,s){if(e.findIndex)return e.findIndex(t,s);for(var l,i=Object(e),c=i.length>>>0,n=0;n<c;n++)if(l=i[n],t.call(s,l,n,i))return n;return-1}function g(){y.resetSearchInput&&(y.search=x,y.multiple||(y.selected&&y.items.length?y.activeIndex=h(y.items,function(e){return angular.equals(this,e)},y.selected):y.activeIndex=0))}function f(e,t){var s,l,i=[];for(s=0;s<t.length;s++)for(l=0;l<e.length;l++)e[l].name==[t[s]]&&i.push(e[l]);return i}function v(e,t){var s=I.indexOf(e);t&&s===-1&&I.push(e),!t&&s>-1&&I.splice(s,1)}function m(e){return I.indexOf(e)>-1}function $(e){function t(e,t){var s=l.indexOf(e);t&&s===-1&&l.push(e),!t&&s>-1&&l.splice(s,1)}function s(e){return l.indexOf(e)>-1}if(e){var l=[];y.isLocked=function(e,l){var i=!1,c=y.selected[l];return c&&(e?(i=!!e.$eval(y.lockChoiceExpression),t(c,i)):i=s(c)),i}}}function b(e){var s=!0;switch(e){case t.DOWN:if(!y.open&&y.multiple)y.activate(!1,!0);else if(y.activeIndex<y.items.length-1)for(var l=++y.activeIndex;m(y.items[l])&&l<y.items.length;)y.activeIndex=++l;break;case t.UP:if(!y.open&&y.multiple)y.activate(!1,!0);else if(y.activeIndex>0)for(var i=--y.activeIndex;m(y.items[i])&&i>0;)y.activeIndex=--i;break;case t.ENTER:y.open&&(y.tagging.isActivated||y.activeIndex>=0)?y.select(y.items[y.activeIndex],y.skipFocusser):y.activate(!1,!0);break;case t.ESC:y.close();break;default:s=!1}return s}function w(){var e=l.querySelectorAll(".ui-select-choices-content"),t=e.querySelectorAll(".ui-select-choices-row");if(t.length<1)throw r("choices","Expected multiple .ui-select-choices-row but got '{0}'.",t.length);if(!(y.activeIndex<0)){var s=t[y.activeIndex],i=s.offsetTop+s.clientHeight-e[0].scrollTop,c=e[0].offsetHeight;i>c?e[0].scrollTop+=i-c:i<s.clientHeight&&(y.isGrouped&&0===y.activeIndex?e[0].scrollTop=0:e[0].scrollTop-=s.clientHeight-i)}}var y=this,x="";if(y.placeholder=o.placeholder,y.searchEnabled=o.searchEnabled,y.sortable=o.sortable,y.refreshDelay=o.refreshDelay,y.paste=o.paste,y.resetSearchInput=o.resetSearchInput,y.refreshing=!1,y.spinnerEnabled=o.spinnerEnabled,y.spinnerClass=o.spinnerClass,y.removeSelected=o.removeSelected,y.closeOnSelect=!0,y.skipFocusser=!1,y.search=x,y.activeIndex=void 0,y.items=[],y.open=!1,y.focus=!1,y.disabled=!1,y.selected=void 0,y.dropdownPosition="auto",y.focusser=void 0,y.multiple=void 0,y.disableChoiceExpression=void 0,y.tagging={isActivated:!1,fct:void 0},y.taggingTokens={isActivated:!1,tokens:void 0},y.lockChoiceExpression=void 0,y.clickTriggeredSelect=!1,y.$filter=c,y.$element=l,y.$animate=function(){try{return d.get("$animate")}catch(e){return null}}(),y.searchInput=l.querySelectorAll("input.ui-select-search"),1!==y.searchInput.length)throw r("searchInput","Expected 1 input.ui-select-search but got '{0}'.",y.searchInput.length);y.isEmpty=function(){return e(y.selected)||""===y.selected||y.multiple&&0===y.selected.length},y.getPlaceholder=function(){if(!y.selected||!y.selected.length)return y.placeholder},y.activate=function(e,t,c){if(c&&c.preventDefault(),y.disabled||y.open)y.open&&!y.searchEnabled&&y.close();else{t||g(),s.$broadcast("uis:activate"),y.open=!0,y.activeIndex=y.activeIndex>=y.items.length?0:y.activeIndex,y.activeIndex===-1&&y.taggingLabel!==!1&&(y.activeIndex=0);var n=l.querySelectorAll(".ui-select-choices-content"),a=l.querySelectorAll(".ui-select-search");if(y.$animate&&y.$animate.on&&y.$animate.enabled(n[0])){var r=function(t,s){"start"===s&&0===y.items.length?(y.$animate.off("removeClass",a[0],r),i(function(){y.focusSearchInput(e)})):"close"===s?(y.$animate.off("enter",n[0],r),i(function(){y.focusSearchInput(e)})):"start"===s&&y.activeIndex&&(y.$animate.off("removeClass",a[0],r),i(function(){w()}))};y.items.length>0?y.$animate.on("enter",n[0],r):y.$animate.on("removeClass",a[0],r)}else i(function(){y.focusSearchInput(e),!y.tagging.isActivated&&y.items.length>1&&y.open&&w()})}},y.focusSearchInput=function(e){y.search=e||y.search,y.searchInput[0].focus()},y.findGroupByName=function(e,t){return y.groups&&y.groups.filter(function(s){return t?s.name==e:s.name===e})[0]},y.parseRepeatAttr=function(e,t,l){function i(e){var i=s.$eval(t);if(y.groups=[],angular.forEach(e,function(e){var t=angular.isFunction(i)?i(e):e[i],s=y.findGroupByName(t);s?s.items.push(e):y.groups.push({name:t,items:[e]})}),l){var c=s.$eval(l);angular.isFunction(c)?y.groups=c(y.groups):angular.isArray(c)&&(y.groups=f(y.groups,c))}y.items=[],y.groups.forEach(function(e){y.items=y.items.concat(e.items)})}function c(e){y.items=e||[]}y.setItemsFn=t?i:c,y.parserResult=a.parse(e),y.isGrouped=!!t,y.itemProperty=y.parserResult.itemName;var n=y.parserResult.source,o=function(){var e=n(s);s.$uisSource=Object.keys(e).map(function(t){var s={};return s[y.parserResult.keyName]=t,s.value=e[t],s})};y.parserResult.keyName&&(o(),y.parserResult.source=u("$uisSource"+y.parserResult.filters),s.$watch(n,function(e,t){e!==t&&o()},!0)),y.refreshItems=function(e){e=e||y.parserResult.source(s);var t=y.selected;if(y.isEmpty()||angular.isArray(t)&&!t.length||!y.multiple||!y.removeSelected)y.setItemsFn(e);else if(void 0!==e&&null!==e){var l=e.filter(function(e){return angular.isArray(t)?t.every(function(t){return!angular.equals(e,t)}):!angular.equals(e,t)});y.setItemsFn(l)}"auto"!==y.dropdownPosition&&"up"!==y.dropdownPosition||s.calculateDropdownPos(),s.$broadcast("uis:refresh")},s.$watchCollection(y.parserResult.source,function(e){if(void 0===e||null===e)y.items=[];else{if(!angular.isArray(e))throw r("items","Expected an array but got '{0}'.",e);y.refreshItems(e),angular.isDefined(y.ngModel.$modelValue)&&(y.ngModel.$modelValue=null)}})};var E;y.refresh=function(e){void 0!==e&&(E&&i.cancel(E),E=i(function(){if(s.$select.search.length>=s.$select.minimumInputLength){var t=s.$eval(e);t&&angular.isFunction(t.then)&&!y.refreshing&&(y.refreshing=!0,t["finally"](function(){y.refreshing=!1}))}},y.refreshDelay))},y.isActive=function(e){if(!y.open)return!1;var t=y.items.indexOf(e[y.itemProperty]),s=t==y.activeIndex;return!(!s||t<0)&&(s&&!angular.isUndefined(y.onHighlightCallback)&&e.$eval(y.onHighlightCallback),s)};var S=function(e){return y.selected&&angular.isArray(y.selected)&&y.selected.filter(function(t){return angular.equals(t,e)}).length>0},I=[];y.isDisabled=function(e){if(y.open){var t=e[y.itemProperty],s=y.items.indexOf(t),l=!1;if(s>=0&&(angular.isDefined(y.disableChoiceExpression)||y.multiple)){if(t.isTag)return!1;y.multiple&&(l=S(t)),!l&&angular.isDefined(y.disableChoiceExpression)&&(l=!!e.$eval(y.disableChoiceExpression)),v(t,l)}return l}},y.select=function(t,l,i){if(e(t)||!m(t)){if(!y.items&&!y.search&&!y.tagging.isActivated)return;if(!t||!m(t)){if(y.clickTriggeredSelect=!1,i&&("click"===i.type||"touchend"===i.type)&&t&&(y.clickTriggeredSelect=!0),y.tagging.isActivated&&y.clickTriggeredSelect===!1){if(y.taggingLabel===!1)if(y.activeIndex<0){if(void 0===t&&(t=void 0!==y.tagging.fct?y.tagging.fct(y.search):y.search),!t||angular.equals(y.items[0],t))return}else t=y.items[y.activeIndex];else if(0===y.activeIndex){if(void 0===t)return;if(void 0!==y.tagging.fct&&"string"==typeof t){if(t=y.tagging.fct(t),!t)return}else"string"==typeof t&&(t=t.replace(y.taggingLabel,"").trim())}if(S(t))return void y.close(l)}g(),s.$broadcast("uis:select",t),y.closeOnSelect&&y.close(l)}}},y.close=function(e){y.open&&(y.ngModel&&y.ngModel.$setTouched&&y.ngModel.$setTouched(),y.open=!1,g(),s.$broadcast("uis:close",e))},y.setFocus=function(){y.focus||angular.element(document.querySelector("#selector-close-wrapper-"+s.$select.generatedId)).focus()},y.clear=function(e){y.select(null),e.stopPropagation(),i(function(){angular.element(document.querySelector("#selector-close-wrapper-"+s.$select.generatedId)).focus()},0,!1)},y.toggle=function(e){y.open?y.close():y.activate(),e.preventDefault(),e.stopPropagation()},y.isLocked=function(){return!1},s.$watch(function(){return angular.isDefined(y.lockChoiceExpression)&&""!==y.lockChoiceExpression},$);var C=null,A=!1;y.sizeSearchInput=function(){var e=y.searchInput[0],t=y.$element[0],l=function(){return t.clientWidth*!!e.offsetParent},c=function(t){if(0===t)return!1;var s=t-e.offsetLeft;return s<50&&(s=t),y.searchInput.css("width",s+"px"),!0};y.searchInput.css("width","10px"),i(function(){null!==C||c(l())||(C=s.$watch(function(){A||(A=!0,s.$$postDigest(function(){A=!1,c(l())&&(C(),C=null)}))},angular.noop))})},y.searchInput.on("keydown",function(e){var l=e.which;~[t.ENTER,t.ESC].indexOf(l)&&(e.preventDefault(),e.stopPropagation()),s.$apply(function(){var s=!1;if((y.items.length>0||y.tagging.isActivated)&&(b(l)||y.searchEnabled||(e.preventDefault(),e.stopPropagation()),y.taggingTokens.isActivated)){for(var c=0;c<y.taggingTokens.tokens.length;c++)y.taggingTokens.tokens[c]===t.MAP[e.keyCode]&&y.search.length>0&&(s=!0);s&&i(function(){y.searchInput.triggerHandler("tagged");var s=y.search.replace(t.MAP[e.keyCode],"").trim();y.tagging.fct&&(s=y.tagging.fct(s)),s&&y.select(s,!0)})}}),t.isVerticalMovement(l)&&y.items.length>0&&w(),l!==t.ENTER&&l!==t.ESC||(e.preventDefault(),e.stopPropagation())}),y.searchInput.on("paste",function(e){var s;if(s=window.clipboardData&&window.clipboardData.getData?window.clipboardData.getData("Text"):(e.originalEvent||e).clipboardData.getData("text/plain"),s=y.search+s,s&&s.length>0)if(y.taggingTokens.isActivated){for(var l=[],i=0;i<y.taggingTokens.tokens.length;i++){var c=t.toSeparator(y.taggingTokens.tokens[i])||y.taggingTokens.tokens[i];if(s.indexOf(c)>-1){l=s.split(c);break}}0===l.length&&(l=[s]);var n=y.search;angular.forEach(l,function(e){var t=y.tagging.fct?y.tagging.fct(e):e;t&&y.select(t,!0)}),y.search=n||x,e.preventDefault(),e.stopPropagation()}else y.paste&&(y.paste(s),y.search=x,e.preventDefault(),e.stopPropagation())}),y.searchInput.on("tagged",function(){i(function(){g()})});var k=n(function(){y.sizeSearchInput()},50);angular.element(p).bind("resize",k),s.$on("$destroy",function(){y.searchInput.off("keyup keydown tagged blur paste"),angular.element(p).off("resize",k)}),s.$watch("$select.activeIndex",function(e){void 0!==e&&l.find("input").attr("aria-activedescendant","ui-select-choices-row-"+y.generatedId+"-"+e)}),s.$watch("$select.open",function(e){e||l.find("input").removeAttr("aria-activedescendant")})}]),l.directive("uiSelect",["$document","uiSelectConfig","uiSelectMinErr","uisOffset","$compile","$parse","$timeout","$window",function(e,t,s,l,i,c,n,a){return{restrict:"EA",templateUrl:function(e,s){var l=s.theme||t.theme;return l+(angular.isDefined(s.multiple)?"/select-multiple.tpl.html":"/select.tpl.html")},replace:!0,transclude:!0,require:["uiSelect","^ngModel"],scope:!0,controller:"uiSelectCtrl",controllerAs:"$select",compile:function(i,r){var o=/{(.*)}\s*{(.*)}/.exec(r.ngClass);if(o){var u="{"+o[1]+", "+o[2]+"}";r.ngClass=u,i.attr("ng-class",u)}return angular.isDefined(r.multiple)?i.append("<ui-select-multiple/>").removeAttr("multiple"):i.append("<ui-select-single/>"),r.inputId&&(i.querySelectorAll("input.ui-select-search")[0].id=r.inputId),function(i,r,o,u,d){function p(e){if(f.open){var t=!1;if(t=window.jQuery?window.jQuery.contains(r[0],e.target):r[0].contains(e.target),!t&&!f.clickTriggeredSelect){var s;if(f.skipFocusser)s=!0;else{var l=["input","button","textarea","select"],c=angular.element(e.target).controller("uiSelect");s=c&&c!==f,s||(s=~l.indexOf(e.target.tagName.toLowerCase()))}f.close(s),i.$digest()}f.clickTriggeredSelect=!1}}function h(){var t=l(r);$=angular.element('<div class="ui-select-placeholder"></div>'),$[0].style.width=t.width+"px",$[0].style.height=t.height+"px",r.after($),b=r[0].style.width,e.find("body").append(r),r[0].style.position="absolute",r[0].style.left=t.left+"px",r[0].style.top=t.top+"px",r[0].style.width=t.width+"px"}function g(){null!==$&&($.replaceWith(r),$=null,r[0].style.position="",r[0].style.left="",r[0].style.top="",r[0].style.width=b,f.setFocus())}var f=u[0],v=u[1];f.generatedId=t.generateId(),f.baseTitle=o.title||"Select box",f.focusserTitle=f.baseTitle+" focus",f.selectorAriaLabel=o.ariaLabel||"Select box",f.selectorAriaRequired=o.ariaRequired||!1,f.focusserId="focusser-"+f.generatedId,f.closeOnSelect=function(){return angular.isDefined(o.closeOnSelect)?c(o.closeOnSelect)():t.closeOnSelect}(),i.$watch("skipFocusser",function(){var e=i.$eval(o.skipFocusser);f.skipFocusser=void 0!==e?e:t.skipFocusser}),f.onSelectCallback=c(o.onSelect),f.onRemoveCallback=c(o.onRemove),f.ngModel=v,f.choiceGrouped=function(e){return f.isGrouped&&e&&e.name},o.tabindex&&o.$observe("tabindex",function(e){f.focusInput.attr("tabindex",e),r.removeAttr("tabindex")}),i.$watch(function(){return i.$eval(o.searchEnabled)},function(e){f.searchEnabled=void 0!==e?e:t.searchEnabled}),i.$watch("sortable",function(){var e=i.$eval(o.sortable);f.sortable=void 0!==e?e:t.sortable}),o.$observe("backspaceReset",function(){var e=i.$eval(o.backspaceReset);f.backspaceReset=void 0===e||e}),o.$observe("limit",function(){f.limit=angular.isDefined(o.limit)?parseInt(o.limit,10):void 0}),i.$watch("removeSelected",function(){var e=i.$eval(o.removeSelected);f.removeSelected=void 0!==e?e:t.removeSelected}),o.$observe("disabled",function(){f.disabled=void 0!==o.disabled&&o.disabled}),o.$observe("resetSearchInput",function(){var e=i.$eval(o.resetSearchInput);f.resetSearchInput=void 0===e||e}),o.$observe("paste",function(){f.paste=i.$eval(o.paste)}),o.$observe("tagging",function(){if(void 0!==o.tagging){var e=i.$eval(o.tagging);f.tagging={isActivated:!0,fct:e!==!0?e:void 0}}else f.tagging={isActivated:!1,fct:void 0}}),o.$observe("taggingLabel",function(){void 0!==o.tagging&&("false"===o.taggingLabel?f.taggingLabel=!1:f.taggingLabel=void 0!==o.taggingLabel?o.taggingLabel:"(new)")}),o.$observe("taggingTokens",function(){if(void 0!==o.tagging){var e=void 0!==o.taggingTokens?o.taggingTokens.split("|"):[",","ENTER"];f.taggingTokens={isActivated:!0,tokens:e}}}),o.$observe("spinnerEnabled",function(){var e=i.$eval(o.spinnerEnabled);f.spinnerEnabled=void 0!==e?e:t.spinnerEnabled}),o.$observe("spinnerClass",function(){var e=o.spinnerClass;f.spinnerClass=void 0!==e?o.spinnerClass:t.spinnerClass}),angular.isDefined(o.autofocus)&&n(function(){f.setFocus()}),angular.isDefined(o.focusOn)&&i.$on(o.focusOn,function(){n(function(){f.setFocus()})}),a.document.addEventListener("click",p,!0),i.$on("$destroy",function(){a.document.removeEventListener("click",p,!0)}),d(i,function(e){var t=angular.element("<div>").append(e),l=t.querySelectorAll(".ui-select-match");if(l.removeAttr("ui-select-match"),l.removeAttr("data-ui-select-match"),1!==l.length)throw s("transcluded","Expected 1 .ui-select-match but got '{0}'.",l.length);r.querySelectorAll(".ui-select-match").replaceWith(l);var i=t.querySelectorAll(".ui-select-choices");if(i.removeAttr("ui-select-choices"),i.removeAttr("data-ui-select-choices"),1!==i.length)throw s("transcluded","Expected 1 .ui-select-choices but got '{0}'.",i.length);r.querySelectorAll(".ui-select-choices").replaceWith(i);var c=t.querySelectorAll(".ui-select-no-choice");c.removeAttr("ui-select-no-choice"),c.removeAttr("data-ui-select-no-choice"),1==c.length&&r.querySelectorAll(".ui-select-no-choice").replaceWith(c);var n=t.querySelectorAll(".ui-select-header");n.removeAttr("ui-select-header"),n.removeAttr("data-ui-select-header"),1==n.length?r.querySelectorAll(".ui-select-header").replaceWith(n):r.querySelectorAll(".ui-select-header").remove();var a=t.querySelectorAll(".ui-select-footer");a.removeAttr("ui-select-footer"),a.removeAttr("data-ui-select-footer"),1==a.length?r.querySelectorAll(".ui-select-footer").replaceWith(a):r.querySelectorAll(".ui-select-footer").remove()});var m=i.$eval(o.appendToBody);(void 0!==m?m:t.appendToBody)&&(i.$watch("$select.open",function(e){e?h():g()}),i.$on("$destroy",function(){g()}));var $=null,b="",w=null,y="direction-up";i.$watch("$select.open",function(){"auto"!==f.dropdownPosition&&"up"!==f.dropdownPosition||i.calculateDropdownPos()});var x=function(e,t){e=e||l(r),t=t||l(w),w[0].style.position="absolute",w[0].style.top=t.height*-1+"px",r.addClass(y)},E=function(e,t){r.removeClass(y),e=e||l(r),t=t||l(w),w[0].style.position="",w[0].style.top=""},S=function(){n(function(){if("up"===f.dropdownPosition)x();else{r.removeClass(y);var t=l(r),s=l(w),i=e[0].documentElement.scrollTop||e[0].body.scrollTop;t.top+t.height+s.height>i+e[0].documentElement.clientHeight?x(t,s):E(t,s)}w[0].style.opacity=1})},I=!1;i.calculateDropdownPos=function(){if(f.open){if(w=angular.element(r).querySelectorAll(".ui-select-dropdown"),0===w.length)return;if(""!==f.search||I||(w[0].style.opacity=0,I=!0),!l(w).height&&f.$animate&&f.$animate.on&&f.$animate.enabled(w)){var e=!0;f.$animate.on("enter",w,function(t,s){"close"===s&&e&&(S(),e=!1)})}else S()}else{if(null===w||0===w.length)return;w[0].style.opacity=0,w[0].style.position="",w[0].style.top="",r.removeClass(y)}}}}}}]),l.directive("uiSelectFooter",["uiSelectConfig",function(e){return{templateUrl:function(t){t.addClass("ui-select-footer");var s=t.parent().attr("theme")||e.theme;return s+"/footer.tpl.html"},restrict:"EA",transclude:!0,replace:!0}}]),l.directive("uiSelectHeader",["uiSelectConfig",function(e){return{templateUrl:function(t){t.addClass("ui-select-header");var s=t.parent().attr("theme")||e.theme;return s+"/header.tpl.html"},restrict:"EA",transclude:!0,replace:!0}}]),l.directive("uiSelectHeaderGroupSelectable",["$timeout",function(e){return{restrict:"EA",require:["^uiSelect"],scope:{isEnabled:"<?uiSelectHeaderGroupSelectable"},link:function(t,s,l,i){function c(){return angular.isUndefined(t.isEnabled)||t.isEnabled}function n(){return o.multiple&&o.groups?s.querySelectorAll(".ui-select-choices-group-label"):(console.error("Use uiSelectHeaderGroupSelectable with no multiple uiSelect or without groupBy"),[])}function a(){c()&&angular.forEach(n(),function(t){var s=angular.element(t);s.hasClass("ui-select-header-group-selectable")||(s.addClass("ui-select-header-group-selectable"),s.on("click",function(){if(c()){var t=o.findGroupByName(s.text(),!0);angular.forEach(t.items,function(t){e(function(){o.select(t,!1," ")})})}}))})}function r(){c()||angular.forEach(n(),function(e){var t=angular.element(e);t.removeClass("ui-select-header-group-selectable"),t.off("click")})}var o=i[0];angular.isUndefined(t.isEnabled)&&(t.isEnabled=!0),t.$watch("isEnabled",function(){c()?a():r()}),t.$watch("$select.groups",a),t.$watch(function(){return o.selected&&o.selected.length?o.selected.length:-1},a)}}}]),l.directive("uiSelectMatch",["uiSelectConfig",function(e){function t(e,t){return e[0].hasAttribute(t)?e.attr(t):e[0].hasAttribute("data-"+t)?e.attr("data-"+t):e[0].hasAttribute("x-"+t)?e.attr("x-"+t):void 0}return{restrict:"EA",require:"^uiSelect",replace:!0,transclude:!0,templateUrl:function(s){s.addClass("ui-select-match");var l=s.parent(),i=t(l,"theme")||e.theme,c=angular.isDefined(t(l,"multiple"));return i+(c?"/match-multiple.tpl.html":"/match.tpl.html")},link:function(t,s,l,i){function c(e){i.allowClear=!!angular.isDefined(e)&&(""===e||"true"===e.toLowerCase())}i.lockChoiceExpression=l.uiLockChoice,l.$observe("placeholder",function(t){i.placeholder=void 0!==t?t:e.placeholder}),l.$observe("allowClear",c),c(l.allowClear),i.multiple&&i.sizeSearchInput()}}}]),l.directive("uiSelectMultiple",["uiSelectMinErr","$timeout",function(s,l){return{restrict:"EA",require:["^uiSelect","^ngModel"],controller:["$scope","$timeout",function(e,t){var s,l=this,i=e.$select;angular.isUndefined(i.selected)&&(i.selected=[]),e.$evalAsync(function(){s=e.ngModel}),l.activeMatchIndex=-1,l.updateModel=function(){s.$setViewValue(Date.now()),l.refreshComponent()},l.refreshComponent=function(){i.refreshItems&&i.refreshItems(),i.sizeSearchInput&&i.sizeSearchInput()},l.removeChoice=function(s){if(i.isLocked(null,s))return!1;var c=i.selected[s],n={};return n[i.parserResult.itemName]=c,i.selected.splice(s,1),l.activeMatchIndex=-1,i.sizeSearchInput(),t(function(){i.onRemoveCallback(e,{$item:c,$model:i.parserResult.modelMapper(e,n)})}),l.updateModel(),!0}}],controllerAs:"$selectMultiple",link:function(i,c,n,a){function r(e){return angular.isNumber(e.selectionStart)?e.selectionStart:e.value.length}function o(e){function s(){switch(e){case t.LEFT:return~g.activeMatchIndex?u:n;case t.RIGHT:return~g.activeMatchIndex&&a!==n?o:(p.activate(),!1);case t.BACKSPACE:return~g.activeMatchIndex?g.removeChoice(a)?u:a:n;case t.DELETE:return!!~g.activeMatchIndex&&(g.removeChoice(g.activeMatchIndex),a)}}var l=r(p.searchInput[0]),i=p.selected.length,c=0,n=i-1,a=g.activeMatchIndex,o=g.activeMatchIndex+1,u=g.activeMatchIndex-1,d=a;return!(l>0||p.search.length&&e==t.RIGHT)&&(p.close(),d=s(),p.selected.length&&d!==!1?g.activeMatchIndex=Math.min(n,Math.max(c,d)):g.activeMatchIndex=-1,!0)}function u(e){if(void 0===e||void 0===p.search)return!1;var t=e.filter(function(e){return void 0!==p.search.toUpperCase()&&void 0!==e&&e.toUpperCase()===p.search.toUpperCase()}).length>0;return t}function d(e,t){var s=-1;if(angular.isArray(e))for(var l=angular.copy(e),i=0;i<l.length;i++)if(void 0===p.tagging.fct)l[i]+" "+p.taggingLabel===t&&(s=i);else{var c=l[i];angular.isObject(c)&&(c.isTag=!0),angular.equals(c,t)&&(s=i)}return s}var p=a[0],h=i.ngModel=a[1],g=i.$selectMultiple;p.multiple=!0,p.focusInput=p.searchInput,h.$isEmpty=function(e){return!e||0===e.length},h.$parsers.unshift(function(){for(var e,t={},s=[],l=p.selected.length-1;l>=0;l--)t={},t[p.parserResult.itemName]=p.selected[l],e=p.parserResult.modelMapper(i,t),s.unshift(e);return s}),h.$formatters.unshift(function(e){var t,s=p.parserResult&&p.parserResult.source(i,{$select:{search:""}}),l={};if(!s)return e;var c=[],n=function(e,s){if(e&&e.length){for(var n=e.length-1;n>=0;n--){if(l[p.parserResult.itemName]=e[n],t=p.parserResult.modelMapper(i,l),p.parserResult.trackByExp){var a=/(\w*)\./.exec(p.parserResult.trackByExp),r=/\.([^\s]+)/.exec(p.parserResult.trackByExp);if(a&&a.length>0&&a[1]==p.parserResult.itemName&&r&&r.length>0&&t[r[1]]==s[r[1]])return c.unshift(e[n]),!0}if(angular.equals(t,s))return c.unshift(e[n]),!0}return!1}};if(!e)return c;for(var a=e.length-1;a>=0;a--)n(p.selected,e[a])||n(s,e[a])||c.unshift(e[a]);return c}),i.$watchCollection(function(){return h.$modelValue},function(e,t){t!=e&&(angular.isDefined(h.$modelValue)&&(h.$modelValue=null),g.refreshComponent())}),h.$render=function(){if(!angular.isArray(h.$viewValue)){if(!e(h.$viewValue))throw s("multiarr","Expected model value to be array but got '{0}'",h.$viewValue);h.$viewValue=[]}p.selected=h.$viewValue,g.refreshComponent(),i.$evalAsync()},i.$on("uis:select",function(e,t){if(!(p.selected.length>=p.limit)){p.selected.push(t);var s={};s[p.parserResult.itemName]=t,l(function(){p.onSelectCallback(i,{$item:t,$model:p.parserResult.modelMapper(i,s)})}),g.updateModel()}}),i.$on("uis:activate",function(){g.activeMatchIndex=-1}),i.$watch("$select.disabled",function(e,t){t&&!e&&p.sizeSearchInput()}),p.searchInput.on("keydown",function(e){var s=e.which;i.$apply(function(){var l=!1;t.isHorizontalMovement(s)&&(l=o(s)),l&&s!=t.TAB&&(e.preventDefault(),e.stopPropagation())})}),p.searchInput.on("keyup",function(e){if(t.isVerticalMovement(e.which)||i.$evalAsync(function(){p.activeIndex=p.taggingLabel===!1?-1:0}),p.tagging.isActivated&&p.search.length>0){if(e.which===t.TAB||t.isControl(e)||t.isFunctionKey(e)||e.which===t.ESC||t.isVerticalMovement(e.which))return;if(p.activeIndex=p.taggingLabel===!1?-1:0,p.taggingLabel===!1)return;var s,l,c,n,a=angular.copy(p.items),r=angular.copy(p.items),o=!1,h=-1;if(void 0!==p.tagging.fct){if(c=p.$filter("filter")(a,{isTag:!0}),c.length>0&&(n=c[0]),a.length>0&&n&&(o=!0,a=a.slice(1,a.length),r=r.slice(1,r.length)),s=p.tagging.fct(p.search),r.some(function(e){return angular.equals(e,s)})||p.selected.some(function(e){return angular.equals(e,s)}))return void i.$evalAsync(function(){p.activeIndex=0,p.items=a});s&&(s.isTag=!0)}else{if(c=p.$filter("filter")(a,function(e){return e.match(p.taggingLabel)}),c.length>0&&(n=c[0]),l=a[0],void 0!==l&&a.length>0&&n&&(o=!0,a=a.slice(1,a.length),r=r.slice(1,r.length)),s=p.search+" "+p.taggingLabel,d(p.selected,p.search)>-1)return;if(u(r.concat(p.selected)))return void(o&&(a=r,i.$evalAsync(function(){p.activeIndex=0,p.items=a})));if(u(r))return void(o&&(p.items=r.slice(1,r.length)))}o&&(h=d(p.selected,s)),h>-1?a=a.slice(h+1,a.length-1):(a=[],s&&a.push(s),a=a.concat(r)),i.$evalAsync(function(){if(p.activeIndex=0,p.items=a,p.isGrouped){var e=s?a.slice(1):a;p.setItemsFn(e),s&&(p.items.unshift(s),p.groups.unshift({name:"",items:[s],tagging:!0}))}})}}),p.searchInput.on("blur",function(){l(function(){g.activeMatchIndex=-1})})}}}]),l.directive("uiSelectNoChoice",["uiSelectConfig",function(e){return{restrict:"EA",require:"^uiSelect",replace:!0,transclude:!0,templateUrl:function(t){t.addClass("ui-select-no-choice");var s=t.parent().attr("theme")||e.theme;return s+"/no-choice.tpl.html"}}}]),l.directive("uiSelectSingle",["$timeout","$compile",function(t,s){return{restrict:"EA",require:["^uiSelect","^ngModel"],link:function(s,l,i,c){var n=c[0],a=c[1];a.$parsers.unshift(function(t){if(e(t))return t;var l,i={};return i[n.parserResult.itemName]=t,l=n.parserResult.modelMapper(s,i)}),a.$formatters.unshift(function(t){if(e(t))return t;var l,i=n.parserResult&&n.parserResult.source(s,{$select:{search:""}}),c={};if(i){var a=function(e){return c[n.parserResult.itemName]=e,l=n.parserResult.modelMapper(s,c),l===t};if(n.selected&&a(n.selected))return n.selected;for(var r=i.length-1;r>=0;r--)if(a(i[r]))return i[r]}return t}),s.$watch("$select.selected",function(e){a.$viewValue!==e&&a.$setViewValue(e)}),a.$render=function(){n.selected=a.$viewValue},s.$on("uis:select",function(l,i){n.selected=i;var c={};c[n.parserResult.itemName]=i,t(function(){n.onSelectCallback(s,{$item:i,$model:e(i)?i:n.parserResult.modelMapper(s,c)})})}),s.$on("uis:close",function(e,s){t(function(){s||angular.element(document.querySelector("#selector-close-wrapper-"+n.generatedId)).focus()},0,!1)}),s.$on("uis:activate",function(){})}}}]),l.directive("uiSelectSort",["$timeout","uiSelectConfig","uiSelectMinErr",function(e,t,s){return{require:["^^uiSelect","^ngModel"],link:function(t,l,i,c){if(null===t[i.uiSelectSort])throw s("sort","Expected a list to sort");var n=c[0],a=c[1],r=angular.extend({axis:"horizontal"},t.$eval(i.uiSelectSortOptions)),o=r.axis,u="dragging",d="dropping",p="dropping-before",h="dropping-after";if(t.$watch(function(){return n.sortable},function(e){e?l.attr("draggable",!0):l.removeAttr("draggable")}),!l.data("disallowDrop")){l.on("dragstart",function(e){l.addClass(u),(e.dataTransfer||e.originalEvent.dataTransfer).setData("text",t.$index.toString());
}),l.on("dragend",function(){v(u)});var g,f=function(e,t){this.splice(t,0,this.splice(e,1)[0])},v=function(e){angular.forEach(n.$element.querySelectorAll("."+e),function(t){angular.element(t).removeClass(e)})},m=function(e){e.preventDefault();var t="vertical"===o?e.offsetY||e.layerY||(e.originalEvent?e.originalEvent.offsetY:0):e.offsetX||e.layerX||(e.originalEvent?e.originalEvent.offsetX:0);t<this["vertical"===o?"offsetHeight":"offsetWidth"]/2?(v(h),l.addClass(p)):(v(p),l.addClass(h))},$=function(t){t.preventDefault();var s=parseInt((t.dataTransfer||t.originalEvent.dataTransfer).getData("text"),10);e.cancel(g),g=e(function(){b(s)},20)},b=function(e){var s=t.$eval(i.uiSelectSort),c=s[e],n=null;n=l.hasClass(p)?e<t.$index?t.$index-1:t.$index:e<t.$index?t.$index:t.$index+1,f.apply(s,[e,n]),a.$setViewValue(Date.now()),t.$apply(function(){t.$emit("uiSelectSort:change",{array:s,item:c,from:e,to:n})}),v(d),v(p),v(h),l.off("drop",$)};l.on("dragenter",function(){l.hasClass(u)||(l.addClass(d),l.on("dragover",m),l.on("drop",$))}),l.on("dragleave",function(e){e.target==l&&(v(d),v(p),v(h),l.off("dragover",m),l.off("drop",$))})}}}}]),l.directive("uisOpenClose",["$parse","$timeout",function(e,t){return{restrict:"A",require:"uiSelect",link:function(s,l,i,c){c.onOpenCloseCallback=e(i.uisOpenClose),s.$watch("$select.open",function(e,l){e!==l&&t(function(){c.onOpenCloseCallback(s,{isOpen:e})})})}}}]),l.service("uisRepeatParser",["uiSelectMinErr","$parse",function(e,t){var s=this;s.parse=function(s){var l;if(l=s.match(/^\s*(?:([\s\S]+?)\s+as\s+)?(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(\s*[\s\S]+?)?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/),!l)throw e("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",s);var i=l[5],c="";if(l[3]){i=l[5].replace(/(^\()|(\)$)/g,"");var n=l[5].match(/^\s*(?:[\s\S]+?)(?:[^\|]|\|\|)+([\s\S]*)\s*$/);n&&n[1].trim()&&(c=n[1],i=i.replace(c,""))}return{itemName:l[4]||l[2],keyName:l[3],source:t(i),filters:c,trackByExp:l[6],modelMapper:t(l[1]||l[4]||l[2]),repeatExpression:function(e){var t=this.itemName+" in "+(e?"$group.items":"$select.items");return this.trackByExp&&(t+=" track by "+this.trackByExp),t}}},s.getGroupNgRepeatExpression=function(){return"$group in $select.groups track by $group.name"}}])}(),angular.module("ui.select").run(["$templateCache",function(e){e.put("bootstrap/choices.tpl.html",'<ul class="ui-select-choices ui-select-choices-content"><li class="ui-select-choices-group" id="ui-select-choices-{{ $select.generatedId }}"><div class="divider" ng-show="$select.isGrouped && $index > 0"></div><div ng-show="$select.isGrouped" class="ui-select-choices-group-label dropdown-header" ng-bind="$group.name"></div><div ng-attr-id="ui-select-choices-row-{{ $select.generatedId }}-{{$index}}" class="ui-select-choices-row" ng-class="{active: $select.isActive(this), disabled: $select.isDisabled(this)}" role="option" aria-selected="{{ $select.isActive(this) }}"><span class="ui-select-choices-row-inner"></span></div></li></ul>'),e.put("bootstrap/footer.tpl.html",'<div class="ui-select-footer" ng-transclude=""></div>'),e.put("bootstrap/header.tpl.html",'<div class="ui-select-header" ng-transclude=""></div>'),e.put("bootstrap/match-multiple.tpl.html",'<span class="ui-select-match"><span ng-repeat="$item in $select.selected track by $index"><span class="ui-select-match-item btn btn-default btn-xs" tabindex="-1" type="button" ng-disabled="$select.disabled" ng-click="$selectMultiple.activeMatchIndex = $index;" ng-class="{\'btn-primary\':$selectMultiple.activeMatchIndex === $index, \'select-locked\':$select.isLocked(this, $index)}" ui-select-sort="$select.selected"><span class="close ui-select-match-close" ng-hide="$select.disabled" ng-click="$selectMultiple.removeChoice($index)"> ×</span> <span uis-transclude-append=""></span></span></span></span>'),e.put("bootstrap/match.tpl.html",'<button tabindex="0" class="ui-select-match" type="button" ng-hide="$select.open && $select.searchEnabled" ng-disabled="$select.disabled" ng-class="{\'btn-default-focus\':$select.focus}" ng-click="$select.activate(false, false, $event)" aria-label="{{ ($select.selectorAriaLabel || $select.selected.title) + \' activate\' }}" aria-haspopup="listbox" aria-expanded="{{ $select.open }}" aria-required="{{ $select.selectorAriaRequired }}" id="selector-close-wrapper-{{ $select.generatedId }}"><span tabindex="-1" class="btn btn-default form-control ui-select-toggle" aria-label="{{ $select.selected.title }} selected" ng-disabled="$select.disabled" style="outline: 0;"><span ng-show="$select.isEmpty()" class="ui-select-placeholder text-muted">{{$select.placeholder}}</span> <span ng-hide="$select.isEmpty()" class="ui-select-match-text pull-left" ng-class="{\'ui-select-allow-clear\': $select.allowClear && !$select.isEmpty()}" ng-transclude=""></span> <i class="caret pull-right" ng-click="$select.toggle($event)"></i> <a ng-show="$select.allowClear && !$select.isEmpty() && ($select.disabled !== true)" aria-label="{{ $select.baseTitle }} clear" style="margin-right: 10px" ng-click="$select.clear($event)" class="btn btn-xs btn-link pull-right"><i class="glyphicon glyphicon-remove" aria-hidden="true"></i></a></span></button>'),e.put("bootstrap/no-choice.tpl.html",'<ul class="ui-select-no-choice dropdown-menu" ng-show="$select.items.length == 0"><li ng-transclude=""></li></ul>'),e.put("bootstrap/select-multiple.tpl.html",'<div class="ui-select-container ui-select-multiple ui-select-bootstrap dropdown form-control" ng-class="{open: $select.open}"><div><div class="ui-select-match"></div><span ng-show="$select.open && $select.refreshing && $select.spinnerEnabled" class="ui-select-refreshing {{$select.spinnerClass}}"></span> <input type="search" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" class="ui-select-search input-xs" placeholder="{{$select.getPlaceholder()}}" ng-disabled="$select.disabled" ng-click="$select.activate()" ng-model="$select.search" role="combobox" aria-expanded="{{$select.open}}" aria-label="{{$select.baseTitle}}" ng-class="{\'spinner\': $select.refreshing}" data-disallow-drop="data-disallow-drop"></div><div ng-show="$select.open && $select.items.length > 0" class="ui-select-dropdown dropdown-menu"><div class="ui-select-header"></div><div class="ui-select-choices"></div><div class="ui-select-footer"></div></div><div class="ui-select-no-choice"></div></div>'),e.put("bootstrap/select.tpl.html",'<div class="ui-select-container ui-select-bootstrap dropdown" ng-class="{open: $select.open}"><div class="ui-select-match"></div><span ng-show="$select.open && $select.refreshing && $select.spinnerEnabled" class="ui-select-refreshing {{$select.spinnerClass}}"></span> <input type="search" autocomplete="off" tabindex="-1" aria-expanded="true" aria-label="{{ $select.baseTitle }}" aria-owns="ui-select-choices-{{ $select.generatedId }}" class="form-control ui-select-search" ng-class="{ \'ui-select-search-hidden\' : !$select.searchEnabled }" placeholder="{{$select.placeholder}}" ng-model="$select.search" ng-show="$select.open"><div ng-show="$select.open && $select.items.length > 0" class="ui-select-dropdown dropdown-menu"><div class="ui-select-header"></div><div class="ui-select-choices"></div><div class="ui-select-footer"></div></div><div class="ui-select-no-choice"></div></div>'),e.put("select2/choices.tpl.html",'<ul tabindex="-1" class="ui-select-choices ui-select-choices-content select2-results"><li class="ui-select-choices-group" ng-class="{\'select2-result-with-children\': $select.choiceGrouped($group) }"><div ng-show="$select.choiceGrouped($group)" class="ui-select-choices-group-label select2-result-label" ng-bind="$group.name"></div><ul id="ui-select-choices-{{ $select.generatedId }}" ng-class="{\'select2-result-sub\': $select.choiceGrouped($group), \'select2-result-single\': !$select.choiceGrouped($group) }"><li role="option" ng-attr-id="ui-select-choices-row-{{ $select.generatedId }}-{{$index}}" class="ui-select-choices-row" ng-class="{\'select2-highlighted\': $select.isActive(this), \'select2-disabled\': $select.isDisabled(this)}"><div class="select2-result-label ui-select-choices-row-inner"></div></li></ul></li></ul>'),e.put("select2/footer.tpl.html",'<div class="ui-select-footer" ng-transclude=""></div>'),e.put("select2/header.tpl.html",'<div class="ui-select-header" ng-transclude=""></div>'),e.put("select2/match-multiple.tpl.html",'<span class="ui-select-match"><li class="ui-select-match-item select2-search-choice" ng-repeat="$item in $select.selected track by $index" ng-class="{\'select2-search-choice-focus\':$selectMultiple.activeMatchIndex === $index, \'select2-locked\':$select.isLocked(this, $index)}" ui-select-sort="$select.selected"><span uis-transclude-append=""></span> <a href="javascript:;" class="ui-select-match-close select2-search-choice-close" ng-click="$selectMultiple.removeChoice($index)" tabindex="-1"></a></li></span>'),e.put("select2/match.tpl.html",'<a class="select2-choice ui-select-match" ng-class="{\'select2-default\': $select.isEmpty()}" ng-click="$select.toggle($event)" aria-label="{{ $select.baseTitle }} select"><span ng-show="$select.isEmpty()" class="select2-chosen">{{$select.placeholder}}</span> <span ng-hide="$select.isEmpty()" class="select2-chosen" ng-transclude=""></span> <abbr ng-if="$select.allowClear && !$select.isEmpty()" class="select2-search-choice-close" ng-click="$select.clear($event)"></abbr> <span class="select2-arrow ui-select-toggle"><b></b></span></a>'),e.put("select2/no-choice.tpl.html",'<div class="ui-select-no-choice dropdown" ng-show="$select.items.length == 0"><div class="dropdown-content"><div data-selectable="" ng-transclude=""></div></div></div>'),e.put("select2/select-multiple.tpl.html",'<div class="ui-select-container ui-select-multiple select2 select2-container select2-container-multi" ng-class="{\'select2-container-active select2-dropdown-open open\': $select.open, \'select2-container-disabled\': $select.disabled}"><ul class="select2-choices"><span class="ui-select-match"></span><li class="select2-search-field"><input type="search" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="combobox" aria-expanded="true" aria-owns="ui-select-choices-{{ $select.generatedId }}" aria-label="{{ $select.baseTitle }}" aria-activedescendant="ui-select-choices-row-{{ $select.generatedId }}-{{ $select.activeIndex }}" class="select2-input ui-select-search" placeholder="{{$select.getPlaceholder()}}" ng-disabled="$select.disabled" ng-hide="$select.disabled" ng-model="$select.search" ng-click="$select.activate()" style="width: 34px;" data-disallow-drop="data-disallow-drop"></li></ul><div class="ui-select-dropdown select2-drop select2-with-searchbox select2-drop-active" ng-class="{\'select2-display-none\': !$select.open || $select.items.length === 0}"><div class="ui-select-header"></div><div class="ui-select-choices"></div><div class="ui-select-footer"></div></div></div>'),e.put("select2/select.tpl.html",'<div class="ui-select-container select2 select2-container" ng-class="{\'select2-container-active select2-dropdown-open open\': $select.open, \'select2-container-disabled\': $select.disabled, \'select2-container-active\': $select.focus, \'select2-allowclear\': $select.allowClear && !$select.isEmpty()}"><div class="ui-select-match"></div><div class="ui-select-dropdown select2-drop select2-with-searchbox select2-drop-active" ng-class="{\'select2-display-none\': !$select.open}"><div class="search-container" ng-class="{\'ui-select-search-hidden\':!$select.searchEnabled, \'select2-search\':$select.searchEnabled}"><input type="search" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" ng-class="{\'select2-active\': $select.refreshing}" role="combobox" aria-expanded="true" aria-owns="ui-select-choices-{{ $select.generatedId }}" aria-label="{{ $select.baseTitle }}" class="ui-select-search select2-input" ng-model="$select.search"></div><div class="ui-select-header"></div><div class="ui-select-choices"></div><div class="ui-select-no-choice"></div><div class="ui-select-footer"></div></div></div>'),e.put("selectize/choices.tpl.html",'<div class="ui-select-choices"><div class="ui-select-choices-content selectize-dropdown-content"><div class="ui-select-choices-group optgroup"><div ng-show="$select.isGrouped" class="ui-select-choices-group-label optgroup-header" ng-bind="$group.name"></div><div role="option" class="ui-select-choices-row" ng-class="{active: $select.isActive(this), disabled: $select.isDisabled(this)}"><div class="option ui-select-choices-row-inner" data-selectable=""></div></div></div></div></div>'),e.put("selectize/footer.tpl.html",'<div class="ui-select-footer" ng-transclude=""></div>'),e.put("selectize/header.tpl.html",'<div class="ui-select-header" ng-transclude=""></div>'),e.put("selectize/match-multiple.tpl.html",'<div class="ui-select-match" data-value="" ng-repeat="$item in $select.selected track by $index" ng-click="$selectMultiple.activeMatchIndex = $index;" ng-class="{\'active\':$selectMultiple.activeMatchIndex === $index}" ui-select-sort="$select.selected"><span class="ui-select-match-item" ng-class="{\'select-locked\':$select.isLocked(this, $index)}"><span uis-transclude-append=""></span> <span class="remove ui-select-match-close" ng-hide="$select.disabled" ng-click="$selectMultiple.removeChoice($index)">×</span></span></div>'),e.put("selectize/match.tpl.html",'<div ng-hide="$select.searchEnabled && ($select.open || $select.isEmpty())" class="ui-select-match"><span ng-show="!$select.searchEnabled && ($select.isEmpty() || $select.open)" class="ui-select-placeholder text-muted">{{$select.placeholder}}</span> <span ng-hide="$select.isEmpty() || $select.open" ng-transclude=""></span></div>'),e.put("selectize/no-choice.tpl.html",'<div class="ui-select-no-choice selectize-dropdown" ng-show="$select.items.length == 0"><div class="selectize-dropdown-content"><div data-selectable="" ng-transclude=""></div></div></div>'),e.put("selectize/select-multiple.tpl.html",'<div class="ui-select-container selectize-control multi plugin-remove_button" ng-class="{\'open\': $select.open}"><div class="selectize-input" ng-class="{\'focus\': $select.open, \'disabled\': $select.disabled, \'selectize-focus\' : $select.focus}" ng-click="$select.open && !$select.searchEnabled ? $select.toggle($event) : $select.activate()"><div class="ui-select-match"></div><input type="search" autocomplete="off" tabindex="-1" class="ui-select-search" ng-class="{\'ui-select-search-hidden\':!$select.searchEnabled}" placeholder="{{$select.getPlaceholder()}}" ng-model="$select.search" ng-disabled="$select.disabled" aria-expanded="{{$select.open}}" aria-label="{{ $select.baseTitle }}" data-disallow-drop="data-disallow-drop"></div><div ng-show="$select.open" class="ui-select-dropdown selectize-dropdown" ng-class="{\'single\': !$select.multiple, \'multi\': $select.multiple}"><div class="ui-select-header"></div><div class="ui-select-choices"></div><div class="ui-select-footer"></div></div><div class="ui-select-no-choice"></div></div>'),e.put("selectize/select.tpl.html",'<div class="ui-select-container selectize-control single" ng-class="{\'open\': $select.open}"><div class="selectize-input" ng-class="{\'focus\': $select.open, \'disabled\': $select.disabled, \'selectize-focus\' : $select.focus}" ng-click="$select.open && !$select.searchEnabled ? $select.toggle($event) : $select.activate()"><div class="ui-select-match"></div><input type="search" autocomplete="off" tabindex="-1" class="ui-select-search ui-select-toggle" ng-class="{\'ui-select-search-hidden\':!$select.searchEnabled}" ng-click="$select.toggle($event)" placeholder="{{$select.placeholder}}" ng-model="$select.search" ng-hide="!$select.isEmpty() && !$select.open" ng-disabled="$select.disabled" aria-label="{{ $select.baseTitle }}"></div><div ng-show="$select.open" class="ui-select-dropdown selectize-dropdown" ng-class="{\'single\': !$select.multiple, \'multi\': $select.multiple}"><div class="ui-select-header"></div><div class="ui-select-choices"></div><div class="ui-select-footer"></div></div><div class="ui-select-no-choice"></div></div>')}]);
//# sourceMappingURL=select.min.js.map
|
import React from 'react';
import Table from '@semcore/table';
const data = [
{
keyword: 'ebay buy',
kd: '77.8',
cpc: '$1.25',
vol: 'n/a',
},
{
keyword: 'www.ebay.com',
kd: '11.2',
cpc: '$3.4',
vol: '32,500,000',
},
{
keyword: 'www.ebay.com',
kd: '10',
cpc: '$0.65',
vol: '47,354,640',
},
{
keyword: 'ebay buy',
kd: '-',
cpc: '$0',
vol: '65,457,920',
},
{
keyword: 'ebay buy',
kd: '75.89',
cpc: '$0',
vol: '21,644,290',
},
];
const Demo = () => (
<Table use="secondary">
<Table.Head>
<Table.Row theme="false">
{Object.keys(data[0])
.slice(0, -1)
.map((name) => (
<Table.CellHead key={name}>{name}</Table.CellHead>
))}
{Object.keys(data[0])
.slice(-1)
.map((name) => (
<Table.CellHead key={name} sorting="asc" active>
{name}
</Table.CellHead>
))}
</Table.Row>
</Table.Head>
<Table.Body>
{data.map((row) => (
<Table.Row>
{Object.keys(row).map((name) => (
<Table.Cell key={row[name]}>{row[name]}</Table.Cell>
))}
</Table.Row>
))}
</Table.Body>
</Table>
);
export default Demo;
|
import defaultLocale from '../locale/en-US/index.js';
import subMilliseconds from '../subMilliseconds/index.js';
import toDate from '../toDate/index.js';
import assign from '../_lib/assign/index.js';
import longFormatters from '../_lib/format/longFormatters/index.js';
import getTimezoneOffsetInMilliseconds from '../_lib/getTimezoneOffsetInMilliseconds/index.js';
import { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from '../_lib/protectedTokens/index.js';
import toInteger from '../_lib/toInteger/index.js';
import parsers from './_lib/parsers/index.js';
import requiredArgs from '../_lib/requiredArgs/index.js';
var TIMEZONE_UNIT_PRIORITY = 10; // This RegExp consists of three parts separated by `|`:
// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
// (one of the certain letters followed by `o`)
// - (\w)\1* matches any sequences of the same letter
// - '' matches two quote characters in a row
// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
// except a single quote symbol, which ends the sequence.
// Two quote characters do not end the sequence.
// If there is no matching single quote
// then the sequence will continue until the end of the string.
// - . matches any single character unmatched by previous parts of the RegExps
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
var escapedStringRegExp = /^'([^]*?)'?$/;
var doubleQuoteRegExp = /''/g;
var notWhitespaceRegExp = /\S/;
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
/**
* @name parse
* @category Common Helpers
* @summary Parse the date.
*
* @description
* Return the date parsed from string using the given format string.
*
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
* > See: https://git.io/fxCyr
*
* The characters in the format string wrapped between two single quotes characters (') are escaped.
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
*
* Format of the format string is based on Unicode Technical Standard #35:
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
* with a few additions (see note 5 below the table).
*
* Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
* and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
*
* ```javascript
* parse('23 AM', 'HH a', new Date())
* //=> RangeError: The format string mustn't contain `HH` and `a` at the same time
* ```
*
* See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
*
* Accepted format string patterns:
* | Unit |Prior| Pattern | Result examples | Notes |
* |---------------------------------|-----|---------|-----------------------------------|-------|
* | Era | 140 | G..GGG | AD, BC | |
* | | | GGGG | Anno Domini, Before Christ | 2 |
* | | | GGGGG | A, B | |
* | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
* | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
* | | | yy | 44, 01, 00, 17 | 4 |
* | | | yyy | 044, 001, 123, 999 | 4 |
* | | | yyyy | 0044, 0001, 1900, 2017 | 4 |
* | | | yyyyy | ... | 2,4 |
* | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
* | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
* | | | YY | 44, 01, 00, 17 | 4,6 |
* | | | YYY | 044, 001, 123, 999 | 4 |
* | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
* | | | YYYYY | ... | 2,4 |
* | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
* | | | RR | -43, 01, 00, 17 | 4,5 |
* | | | RRR | -043, 001, 123, 999, -999 | 4,5 |
* | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
* | | | RRRRR | ... | 2,4,5 |
* | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
* | | | uu | -43, 01, 99, -99 | 4 |
* | | | uuu | -043, 001, 123, 999, -999 | 4 |
* | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
* | | | uuuuu | ... | 2,4 |
* | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
* | | | Qo | 1st, 2nd, 3rd, 4th | 5 |
* | | | QQ | 01, 02, 03, 04 | |
* | | | QQQ | Q1, Q2, Q3, Q4 | |
* | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
* | | | QQQQQ | 1, 2, 3, 4 | 4 |
* | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
* | | | qo | 1st, 2nd, 3rd, 4th | 5 |
* | | | qq | 01, 02, 03, 04 | |
* | | | qqq | Q1, Q2, Q3, Q4 | |
* | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
* | | | qqqqq | 1, 2, 3, 4 | 3 |
* | Month (formatting) | 110 | M | 1, 2, ..., 12 | |
* | | | Mo | 1st, 2nd, ..., 12th | 5 |
* | | | MM | 01, 02, ..., 12 | |
* | | | MMM | Jan, Feb, ..., Dec | |
* | | | MMMM | January, February, ..., December | 2 |
* | | | MMMMM | J, F, ..., D | |
* | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
* | | | Lo | 1st, 2nd, ..., 12th | 5 |
* | | | LL | 01, 02, ..., 12 | |
* | | | LLL | Jan, Feb, ..., Dec | |
* | | | LLLL | January, February, ..., December | 2 |
* | | | LLLLL | J, F, ..., D | |
* | Local week of year | 100 | w | 1, 2, ..., 53 | |
* | | | wo | 1st, 2nd, ..., 53th | 5 |
* | | | ww | 01, 02, ..., 53 | |
* | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
* | | | Io | 1st, 2nd, ..., 53th | 5 |
* | | | II | 01, 02, ..., 53 | 5 |
* | Day of month | 90 | d | 1, 2, ..., 31 | |
* | | | do | 1st, 2nd, ..., 31st | 5 |
* | | | dd | 01, 02, ..., 31 | |
* | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
* | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
* | | | DD | 01, 02, ..., 365, 366 | 7 |
* | | | DDD | 001, 002, ..., 365, 366 | |
* | | | DDDD | ... | 2 |
* | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Su | |
* | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
* | | | EEEEE | M, T, W, T, F, S, S | |
* | | | EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |
* | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
* | | | io | 1st, 2nd, ..., 7th | 5 |
* | | | ii | 01, 02, ..., 07 | 5 |
* | | | iii | Mon, Tue, Wed, ..., Su | 5 |
* | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
* | | | iiiii | M, T, W, T, F, S, S | 5 |
* | | | iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | 5 |
* | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
* | | | eo | 2nd, 3rd, ..., 1st | 5 |
* | | | ee | 02, 03, ..., 01 | |
* | | | eee | Mon, Tue, Wed, ..., Su | |
* | | | eeee | Monday, Tuesday, ..., Sunday | 2 |
* | | | eeeee | M, T, W, T, F, S, S | |
* | | | eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |
* | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
* | | | co | 2nd, 3rd, ..., 1st | 5 |
* | | | cc | 02, 03, ..., 01 | |
* | | | ccc | Mon, Tue, Wed, ..., Su | |
* | | | cccc | Monday, Tuesday, ..., Sunday | 2 |
* | | | ccccc | M, T, W, T, F, S, S | |
* | | | cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |
* | AM, PM | 80 | a..aaa | AM, PM | |
* | | | aaaa | a.m., p.m. | 2 |
* | | | aaaaa | a, p | |
* | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
* | | | bbbb | a.m., p.m., noon, midnight | 2 |
* | | | bbbbb | a, p, n, mi | |
* | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
* | | | BBBB | at night, in the morning, ... | 2 |
* | | | BBBBB | at night, in the morning, ... | |
* | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
* | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
* | | | hh | 01, 02, ..., 11, 12 | |
* | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
* | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
* | | | HH | 00, 01, 02, ..., 23 | |
* | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
* | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
* | | | KK | 1, 2, ..., 11, 0 | |
* | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
* | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
* | | | kk | 24, 01, 02, ..., 23 | |
* | Minute | 60 | m | 0, 1, ..., 59 | |
* | | | mo | 0th, 1st, ..., 59th | 5 |
* | | | mm | 00, 01, ..., 59 | |
* | Second | 50 | s | 0, 1, ..., 59 | |
* | | | so | 0th, 1st, ..., 59th | 5 |
* | | | ss | 00, 01, ..., 59 | |
* | Seconds timestamp | 40 | t | 512969520 | |
* | | | tt | ... | 2 |
* | Fraction of second | 30 | S | 0, 1, ..., 9 | |
* | | | SS | 00, 01, ..., 99 | |
* | | | SSS | 000, 0001, ..., 999 | |
* | | | SSSS | ... | 2 |
* | Milliseconds timestamp | 20 | T | 512969520900 | |
* | | | TT | ... | 2 |
* | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
* | | | XX | -0800, +0530, Z | |
* | | | XXX | -08:00, +05:30, Z | |
* | | | XXXX | -0800, +0530, Z, +123456 | 2 |
* | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
* | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
* | | | xx | -0800, +0530, +0000 | |
* | | | xxx | -08:00, +05:30, +00:00 | 2 |
* | | | xxxx | -0800, +0530, +0000, +123456 | |
* | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
* | Long localized date | NA | P | 05/29/1453 | 5,8 |
* | | | PP | May 29, 1453 | |
* | | | PPP | May 29th, 1453 | |
* | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
* | Long localized time | NA | p | 12:00 AM | 5,8 |
* | | | pp | 12:00:00 AM | |
* | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
* | | | PPpp | May 29, 1453, 12:00:00 AM | |
* | | | PPPpp | May 29th, 1453 at ... | |
* | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
* Notes:
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
* are the same as "stand-alone" units, but are different in some languages.
* "Formatting" units are declined according to the rules of the language
* in the context of a date. "Stand-alone" units are always nominative singular.
* In `format` function, they will produce different result:
*
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
*
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
*
* `parse` will try to match both formatting and stand-alone units interchangably.
*
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
* the single quote characters (see below).
* If the sequence is longer than listed in table:
* - for numerical units (`yyyyyyyy`) `parse` will try to match a number
* as wide as the sequence
* - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.
* These variations are marked with "2" in the last column of the table.
*
* 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
* These tokens represent the shortest form of the quarter.
*
* 4. The main difference between `y` and `u` patterns are B.C. years:
*
* | Year | `y` | `u` |
* |------|-----|-----|
* | AC 1 | 1 | 1 |
* | BC 1 | 1 | 0 |
* | BC 2 | 2 | -1 |
*
* Also `yy` will try to guess the century of two digit year by proximity with `backupDate`:
*
* `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`
*
* `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`
*
* while `uu` will just assign the year as is:
*
* `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`
*
* `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`
*
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
* except local week-numbering years are dependent on `options.weekStartsOn`
* and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}
* and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).
*
* 5. These patterns are not in the Unicode Technical Standard #35:
* - `i`: ISO day of week
* - `I`: ISO week of year
* - `R`: ISO week-numbering year
* - `o`: ordinal number modifier
* - `P`: long localized date
* - `p`: long localized time
*
* 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
*
* 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
*
* 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
* on the given locale.
*
* using `en-US` locale: `P` => `MM/dd/yyyy`
* using `en-US` locale: `p` => `hh:mm a`
* using `pt-BR` locale: `P` => `dd/MM/yyyy`
* using `pt-BR` locale: `p` => `HH:mm`
*
* Values will be assigned to the date in the descending order of its unit's priority.
* Units of an equal priority overwrite each other in the order of appearance.
*
* If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),
* the values will be taken from 3rd argument `backupDate` which works as a context of parsing.
*
* `backupDate` must be passed for correct work of the function.
* If you're not sure which `backupDate` to supply, create a new instance of Date:
* `parse('02/11/2014', 'MM/dd/yyyy', new Date())`
* In this case parsing will be done in the context of the current date.
* If `backupDate` is `Invalid Date` or a value not convertible to valid `Date`,
* then `Invalid Date` will be returned.
*
* The result may vary by locale.
*
* If `formatString` matches with `dateString` but does not provides tokens, `backupDate` will be returned.
*
* If parsing failed, `Invalid Date` will be returned.
* Invalid Date is a Date, whose time value is NaN.
* Time value of Date: http://es5.github.io/#x15.9.1.1
*
* ### v2.0.0 breaking changes:
*
* - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
*
* - Old `parse` was renamed to `toDate`.
* Now `parse` is a new function which parses a string using a provided format.
*
* ```javascript
* // Before v2.0.0
* parse('2016-01-01')
*
* // v2.0.0 onward
* toDate('2016-01-01')
* parse('2016-01-01', 'yyyy-MM-dd', new Date())
* ```
*
* @param {String} dateString - the string to parse
* @param {String} formatString - the string of tokens
* @param {Date|Number} backupDate - defines values missing from the parsed dateString
* @param {Object} [options] - an object with options.
* @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
* @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
* @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year
* @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
* see: https://git.io/fxCyr
* @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
* see: https://git.io/fxCyr
* @returns {Date} the parsed date
* @throws {TypeError} 3 arguments required
* @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
* @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
* @throws {RangeError} `options.locale` must contain `match` property
* @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr
* @throws {RangeError} use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr
* @throws {RangeError} use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr
* @throws {RangeError} use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr
* @throws {RangeError} format string contains an unescaped latin alphabet character
*
* @example
* // Parse 11 February 2014 from middle-endian format:
* var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())
* //=> Tue Feb 11 2014 00:00:00
*
* @example
* // Parse 28th of February in Esperanto locale in the context of 2010 year:
* import eo from 'date-fns/locale/eo'
* var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), {
* locale: eo
* })
* //=> Sun Feb 28 2010 00:00:00
*/
export default function parse(dirtyDateString, dirtyFormatString, dirtyBackupDate, dirtyOptions) {
requiredArgs(3, arguments);
var dateString = String(dirtyDateString);
var formatString = String(dirtyFormatString);
var options = dirtyOptions || {};
var locale = options.locale || defaultLocale;
if (!locale.match) {
throw new RangeError('locale must contain match property');
}
var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
}
var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
}
if (formatString === '') {
if (dateString === '') {
return toDate(dirtyBackupDate);
} else {
return new Date(NaN);
}
}
var subFnOptions = {
firstWeekContainsDate: firstWeekContainsDate,
weekStartsOn: weekStartsOn,
locale: locale // If timezone isn't specified, it will be set to the system timezone
};
var setters = [{
priority: TIMEZONE_UNIT_PRIORITY,
set: dateToSystemTimezone,
index: 0
}];
var i;
var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {
var firstCharacter = substring[0];
if (firstCharacter === 'p' || firstCharacter === 'P') {
var longFormatter = longFormatters[firstCharacter];
return longFormatter(substring, locale.formatLong, subFnOptions);
}
return substring;
}).join('').match(formattingTokensRegExp);
var usedTokens = [];
for (i = 0; i < tokens.length; i++) {
var token = tokens[i];
if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {
throwProtectedError(token);
}
if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
throwProtectedError(token);
}
var firstCharacter = token[0];
var parser = parsers[firstCharacter];
if (parser) {
var incompatibleTokens = parser.incompatibleTokens;
if (Array.isArray(incompatibleTokens)) {
var incompatibleToken = void 0;
for (var _i = 0; _i < usedTokens.length; _i++) {
var usedToken = usedTokens[_i].token;
if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {
incompatibleToken = usedTokens[_i];
break;
}
}
if (incompatibleToken) {
throw new RangeError("The format string mustn't contain `".concat(incompatibleToken.fullToken, "` and `").concat(token, "` at the same time"));
}
} else if (parser.incompatibleTokens === '*' && usedTokens.length) {
throw new RangeError("The format string mustn't contain `".concat(token, "` and any other token at the same time"));
}
usedTokens.push({
token: firstCharacter,
fullToken: token
});
var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);
if (!parseResult) {
return new Date(NaN);
}
setters.push({
priority: parser.priority,
set: parser.set,
validate: parser.validate,
value: parseResult.value,
index: setters.length
});
dateString = parseResult.rest;
} else {
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
} // Replace two single quote characters with one single quote character
if (token === "''") {
token = "'";
} else if (firstCharacter === "'") {
token = cleanEscapedString(token);
} // Cut token from string, or, if string doesn't match the token, return Invalid Date
if (dateString.indexOf(token) === 0) {
dateString = dateString.slice(token.length);
} else {
return new Date(NaN);
}
}
} // Check if the remaining input contains something other than whitespace
if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {
return new Date(NaN);
}
var uniquePrioritySetters = setters.map(function (setter) {
return setter.priority;
}).sort(function (a, b) {
return b - a;
}).filter(function (priority, index, array) {
return array.indexOf(priority) === index;
}).map(function (priority) {
return setters.filter(function (setter) {
return setter.priority === priority;
}).reverse();
}).map(function (setterArray) {
return setterArray[0];
});
var date = toDate(dirtyBackupDate);
if (isNaN(date)) {
return new Date(NaN);
} // Convert the date in system timezone to the same date in UTC+00:00 timezone.
// This ensures that when UTC functions will be implemented, locales will be compatible with them.
// See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37
var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));
var flags = {};
for (i = 0; i < uniquePrioritySetters.length; i++) {
var setter = uniquePrioritySetters[i];
if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {
return new Date(NaN);
}
var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags)
if (result[0]) {
utcDate = result[0];
assign(flags, result[1]); // Result is date
} else {
utcDate = result;
}
}
return utcDate;
}
function dateToSystemTimezone(date, flags) {
if (flags.timestampIsSet) {
return date;
}
var convertedDate = new Date(0);
convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
return convertedDate;
}
function cleanEscapedString(input) {
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
}
|
/**
* The Initial Developer of the Original Code is
* Tarmo Alexander Sundström <ta@sundstrom.io>
*
* Portions created by the Initial Developer are
* Copyright (C) 2014 Tarmo Alexander Sundström <ta@sundstrom.io>
*
* All Rights Reserved.
*
* Contributor(s):
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
jQuery(document).ready(
function () {
// Create editors
jQuery('.datepicker').datetimepicker();
// Handle repeatable reset
jQuery('.field-Datetimepicker').each(
function () {
jQuery(this).find('.repeatable-field-button').each(
function () {
jQuery(this).on(
'click', function () {
jQuery('.datepicker').datetimepicker();
}
);
}
);
}
);
// Handle repeatable group reset
jQuery('.tab-pane').each(
function () {
jQuery(this).find('.repeatable-group-button').each(
function () {
jQuery(this).on(
'click', function () {
jQuery('.datepicker').datetimepicker();
}
);
}
);
}
);
}
);
|
import * as types from '../constants/actionTypes';
import { refToArray } from '../common/helpers';
export default function notebookReducer(state = {}, action) {
switch (action.type) {
// *** GET NOTEBOOKS
case types.GetNotebooksRequested: {
return Object.assign({}, state, {
inProgress: true,
error: '',
success: ''
});
}
case types.GetNotebooksRejected: {
return Object.assign({}, state, {
inProgress: false,
error: 'Error getting notebooks'
});
}
case types.GetNotebooksFulfilled: {
let notebooks = refToArray(action.notebooks);
const newState = Object.assign({}, state, {
inProgress: false,
success: 'Got notebooks'
});
newState.notebooks = notebooks;
return newState;
}
// *** ADD NOTEBOOKS
case types.AddNotebookRequested: {
return Object.assign({}, state, {
inProgress: true,
error: '',
success: ''
});
}
case types.AddNotebookRejected: {
return Object.assign({}, state, {
inProgress: false,
error: 'Error adding notebook'
});
}
case types.AddNotebookFulfilled: {
const notebook = action.notebook;
const newState = Object.assign({}, state, {
inProgress: false,
success: 'Added notebook'
});
newState.notebooks = state.notebooks || [];
newState.notebooks.push(notebook);
return newState;
}
// *** DELETE NOTEBOOK
case types.DeleteNotebookRequested: {
return Object.assign({}, state, {
inProgress: true,
error: '',
success: ''
});
}
case types.DeleteNotebookRejected: {
return Object.assign({}, state, {
inProgress: false,
error: 'Error deleting notebook'
});
}
case types.DeleteNotebookFulfilled: {
const notebooks = action.notebooks;
const newState = Object.assign({}, state, {
inProgress: false,
success: 'Deleted notebook'
});
newState.notebooks = notebooks;
return newState;
}
default:
return state;
}
}
|
var searchData=
[
['cartapp_21',['CartApp',['../namespace_cart_app.html',1,'']]],
['cartapp_2eassemblyinfo_2ecs_22',['CartApp.AssemblyInfo.cs',['../_cart_app_8_assembly_info_8cs.html',1,'']]],
['cartapp_2erazorassemblyinfo_2ecs_23',['CartApp.RazorAssemblyInfo.cs',['../_cart_app_8_razor_assembly_info_8cs.html',1,'']]],
['cartapp_2erazortargetassemblyinfo_2ecs_24',['CartApp.RazorTargetAssemblyInfo.cs',['../_cart_app_8_razor_target_assembly_info_8cs.html',1,'']]],
['cartcontroller_25',['CartController',['../class_cart_app_1_1_controllers_1_1_cart_controller.html',1,'CartApp.Controllers.CartController'],['../class_cart_app_1_1_controllers_1_1_cart_controller.html#ada426897dd6282b3c86c52b2f4db2344',1,'CartApp.Controllers.CartController.CartController()']]],
['cartcontroller_2ecs_26',['CartController.cs',['../_cart_controller_8cs.html',1,'']]],
['cartproduct_27',['CartProduct',['../class_cart_app_1_1_models_1_1_cart_product.html',1,'CartApp::Models']]],
['cartproduct_2ecs_28',['CartProduct.cs',['../_cart_product_8cs.html',1,'']]],
['cartproductset_29',['CartProductSet',['../class_cart_app_1_1_data_1_1_shop_cart_db_context.html#a7a823debaf1d75c373cadf1eaef0c777',1,'CartApp::Data::ShopCartDbContext']]],
['cartproductviewmodel_30',['CartProductViewModel',['../class_cart_app_1_1_models_1_1_cart_product_view_model.html',1,'CartApp::Models']]],
['cartproductviewmodel_2ecs_31',['CartProductViewModel.cs',['../_cart_product_view_model_8cs.html',1,'']]],
['configuration_32',['Configuration',['../class_cart_app_1_1_startup.html#ae140b83b440da1cc8cd27d3f626080bf',1,'CartApp::Startup']]],
['configure_33',['Configure',['../class_cart_app_1_1_startup.html#aab60a21db45c9237f45a0fc34985b4c4',1,'CartApp::Startup']]],
['configureservices_34',['ConfigureServices',['../class_cart_app_1_1_startup.html#ab2d6e398ba19a88840e358f857beab75',1,'CartApp::Startup']]],
['confirmpassword_35',['ConfirmPassword',['../class_cart_app_1_1_models_1_1_register_view_model.html#a081855e480bc27381d66b7459b649df0',1,'CartApp::Models::RegisterViewModel']]],
['controllers_36',['Controllers',['../namespace_cart_app_1_1_controllers.html',1,'CartApp']]],
['count_37',['Count',['../class_cart_app_1_1_models_1_1_cart_product.html#ad8d7bddec2eab47911337e6090e62ed5',1,'CartApp.Models.CartProduct.Count()'],['../class_cart_app_1_1_models_1_1_cart_product_view_model.html#adcf53913a801a3995d9ea1059c43f3d1',1,'CartApp.Models.CartProductViewModel.count()']]],
['country_38',['Country',['../class_cart_app_1_1_models_1_1_order.html#afd61486834c622fa1f4a813813717389',1,'CartApp::Models::Order']]],
['create_39',['Create',['../class_cart_app_1_1_controllers_1_1_products_controller.html#ac0b05ca549c55a5dad14311c1b453668',1,'CartApp.Controllers.ProductsController.Create()'],['../class_cart_app_1_1_controllers_1_1_products_controller.html#a625e6f0b6f3b378c71ecbede561462e4',1,'CartApp.Controllers.ProductsController.Create([Bind("Id,Name,Price, ImageFile")] Product product)']]],
['create_2ecshtml_2eg_2ecs_40',['Create.cshtml.g.cs',['../_create_8cshtml_8g_8cs.html',1,'']]],
['createhostbuilder_41',['CreateHostBuilder',['../class_cart_app_1_1_program.html#a0ad1ce6d0ac2b51b9d5057e8c4ae4a40',1,'CartApp::Program']]],
['createrole_42',['CreateRole',['../class_cart_app_1_1_controllers_1_1_administration_controller.html#a40eda79df95c4ba5b7e7c8810391e784',1,'CartApp.Controllers.AdministrationController.CreateRole()'],['../class_cart_app_1_1_controllers_1_1_administration_controller.html#af6a9edd676271a0300161a7f0778f542',1,'CartApp.Controllers.AdministrationController.CreateRole(CreateRoleViewModel model)']]],
['createrole_2ecshtml_2eg_2ecs_43',['CreateRole.cshtml.g.cs',['../_create_role_8cshtml_8g_8cs.html',1,'']]],
['createroleviewmodel_44',['CreateRoleViewModel',['../class_cart_app_1_1_models_1_1_create_role_view_model.html',1,'CartApp::Models']]],
['createroleviewmodel_2ecs_45',['CreateRoleViewModel.cs',['../_create_role_view_model_8cs.html',1,'']]],
['data_46',['Data',['../namespace_cart_app_1_1_data.html',1,'CartApp']]],
['migrations_47',['Migrations',['../namespace_cart_app_1_1_migrations.html',1,'CartApp']]],
['models_48',['Models',['../namespace_cart_app_1_1_models.html',1,'CartApp']]]
];
|
import path from 'path';
import routes from '../routes';
export default async app => {
const { expressApp } = app;
expressApp.use('/api', routes(app));
expressApp.use(function(err, req, res, next) {
res.status(400);
const errorStack = process.env.MODE === 'development' ? err.stack : {};
console.log(err.message);
res.json({
status: 400,
message: err.message,
error: errorStack,
});
});
expressApp.get('*', (req, res) => {
res.sendFile(path.join(__dirname, '../../build/index.html'));
});
};
|
/*
YUI 3.8.0pr2 (build 154)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
if (typeof _yuitest_coverage == "undefined"){
_yuitest_coverage = {};
_yuitest_coverline = function(src, line){
var coverage = _yuitest_coverage[src];
if (!coverage.lines[line]){
coverage.calledLines++;
}
coverage.lines[line]++;
};
_yuitest_coverfunc = function(src, name, line){
var coverage = _yuitest_coverage[src],
funcId = name + ":" + line;
if (!coverage.functions[funcId]){
coverage.calledFunctions++;
}
coverage.functions[funcId]++;
};
}
_yuitest_coverage["build/event-tap/event-tap.js"] = {
lines: {},
functions: {},
coveredLines: 0,
calledLines: 0,
coveredFunctions: 0,
calledFunctions: 0,
path: "build/event-tap/event-tap.js",
code: []
};
_yuitest_coverage["build/event-tap/event-tap.js"].code=["YUI.add('event-tap', function (Y, NAME) {","","/**","The tap module provides a gesture events, \"tap\", which normalizes user interactions","across touch and mouse or pointer based input devices. This can be used by application developers","to build input device agnostic components which behave the same in response to either touch or mouse based","interaction.","","'tap' is like a touchscreen 'click', only it requires much less finger-down time since it listens to touch events,","but reverts to mouse events if touch is not supported. ","","@example",""," YUI().use('event-tap', function (Y) {"," Y.one('#my-button').on('tap', function (e) {"," });"," });","","@module event","@submodule event-tap","@author Andres Garza, matuzak and tilo mitra","@since 3.7.0 ","","*/","var doc = Y.config.doc,"," GESTURE_MAP = Y.Event._GESTURE_MAP,"," SUPPORTS_TOUCHES = !!(doc && doc.createTouch),"," EVT_START = GESTURE_MAP.start,"," EVT_MOVE = GESTURE_MAP.move,"," EVT_END = GESTURE_MAP.end,"," EVT_CANCEL = GESTURE_MAP.cancel,"," EVT_TAP = 'tap',",""," HANDLES = {"," START: 'Y_TAP_ON_START_HANDLE',"," MOVE: 'Y_TAP_ON_MOVE_HANDLE',"," END: 'Y_TAP_ON_END_HANDLE',"," CANCEL: 'Y_TAP_ON_CANCEL_HANDLE'"," };","","function detachHelper(subscription, handles, subset, context) {",""," handles = subset ? handles : [ handles.START, handles.MOVE, handles.END, handles.CANCEL ];",""," Y.Array.each(handles, function (item, index, array) {"," var handle = subscription[item];"," if (handle) {"," handle.detach();"," subscription[item] = null;"," }"," });","","}","","","/**","Sets up a \"tap\" event, that is fired on touch devices in response to a tap event (finger down, finder up).","This event can be used instead of listening for click events which have a 500ms delay on most touch devices.","This event can also be listened for using node.delegate().","","@event tap","@param type {string} \"tap\"","@param fn {function} The method the event invokes. It receives the event facade of the underlying DOM event.","@for Event","@return {EventHandle} the detach handle","*/","Y.Event.define(EVT_TAP, {",""," /**"," This function should set up the node that will eventually fire the event.",""," Usage: ",""," node.on('tap', function (e) {"," });",""," @method on"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @public"," @static"," **/"," on: function (node, subscription, notifier) {"," subscription[HANDLES.START] = node.on(EVT_START, this.touchStart, this, node, subscription, notifier);"," },",""," /**"," Detaches all event subscriptions set up by the event-tap module",""," @method detach"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @public"," @static"," **/"," detach: function (node, subscription, notifier) {"," detachHelper(subscription, HANDLES);"," },",""," /**"," Event delegation for the 'tap' event. The delegated event will use a "," supplied selector or filtering function to test if the event references at least one "," node that should trigger the subscription callback.",""," Usage: ",""," node.delegate('tap', function (e) {"," }, 'li a');",""," @method delegate"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @param {String | Function} filter"," @public"," @static"," **/"," delegate: function (node, subscription, notifier, filter) {"," subscription[HANDLES.START] = node.delegate(EVT_START, function (e) {"," this.touchStart(e, node, subscription, notifier, true);"," }, filter, this);"," },",""," /**"," Detaches the delegated event subscriptions set up by the event-tap module."," Only used if you use node.delegate(...) instead of node.on(...);",""," @method detachDelegate"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @public"," @static"," **/"," detachDelegate: function (node, subscription, notifier) {"," detachHelper(subscription, HANDLES);"," },","",""," /**"," Called when the monitor(s) are tapped on, either through touchstart or mousedown.",""," @method touchStart"," @param {DOMEventFacade} event"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @param {Boolean} delegate"," @protected"," @static"," **/"," touchStart: function (event, node, subscription, notifier, delegate) {",""," var context = {"," canceled: false"," };"," //move ways to quit early to the top.",""," // no right clicks"," if (event.button && event.button === 3) {"," return;"," }",""," // for now just support a 1 finger count (later enhance via config)"," if (event.touches && event.touches.length !== 1) {"," return;"," }",""," context.node = delegate ? event.currentTarget : node;",""," //There is a double check in here to support event simulation tests, in which"," //event.touches can be undefined when simulating 'touchstart' on touch devices."," if (SUPPORTS_TOUCHES && event.touches) {"," context.startXY = [ event.touches[0].pageX, event.touches[0].pageY ];"," }"," else {"," context.startXY = [ event.pageX, event.pageY ];"," }",""," //Possibly outdated issue: something is off with the move that it attaches it but never triggers the handler"," subscription[HANDLES.MOVE] = node.once(EVT_MOVE, this.touchMove, this, node, subscription, notifier, delegate, context);"," subscription[HANDLES.END] = node.once(EVT_END, this.touchEnd, this, node, subscription, notifier, delegate, context);"," subscription[HANDLES.CANCEL] = node.once(EVT_CANCEL, this.touchMove, this, node, subscription, notifier, delegate, context);"," },",""," /**"," Called when the monitor(s) fires a touchmove or touchcancel event (or the mouse equivalent)."," This method detaches event handlers so that 'tap' is not fired.",""," @method touchMove"," @param {DOMEventFacade} event"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @param {Boolean} delegate"," @param {Object} context"," @protected"," @static"," **/"," touchMove: function (event, node, subscription, notifier, delegate, context) {"," detachHelper(subscription, [ HANDLES.MOVE, HANDLES.END, HANDLES.CANCEL ], true, context);"," context.cancelled = true;",""," },",""," /**"," Called when the monitor(s) fires a touchend event (or the mouse equivalent)."," This method fires the 'tap' event if certain requirements are met.",""," @method touchEnd"," @param {DOMEventFacade} event"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @param {Boolean} delegate"," @param {Object} context"," @protected"," @static"," **/"," touchEnd: function (event, node, subscription, notifier, delegate, context) {"," var startXY = context.startXY,"," endXY,"," clientXY;",""," //There is a double check in here to support event simulation tests, in which"," //event.touches can be undefined when simulating 'touchstart' on touch devices."," if (SUPPORTS_TOUCHES && event.changedTouches) {"," endXY = [ event.changedTouches[0].pageX, event.changedTouches[0].pageY ];"," clientXY = [event.changedTouches[0].clientX, event.changedTouches[0].clientY];"," }"," else {"," endXY = [ event.pageX, event.pageY ];"," clientXY = [event.clientX, event.clientY];"," }",""," detachHelper(subscription, [ HANDLES.MOVE, HANDLES.END, HANDLES.CANCEL ], true, context);",""," // make sure mouse didn't move"," if (Math.abs(endXY[0] - startXY[0]) === 0 && Math.abs(endXY[1] - startXY[1]) === 0) {",""," event.type = EVT_TAP;"," event.pageX = endXY[0];"," event.pageY = endXY[1];"," event.clientX = clientXY[0];"," event.clientY = clientXY[1];"," event.currentTarget = context.node;",""," notifier.fire(event);"," }"," }","});","","","}, '3.8.0pr2', {\"requires\": [\"node-base\", \"event-base\", \"event-touch\", \"event-synthetic\"]});"];
_yuitest_coverage["build/event-tap/event-tap.js"].lines = {"1":0,"25":0,"41":0,"43":0,"45":0,"46":0,"47":0,"48":0,"49":0,"67":0,"85":0,"99":0,"121":0,"122":0,"138":0,"156":0,"162":0,"163":0,"167":0,"168":0,"171":0,"175":0,"176":0,"179":0,"183":0,"184":0,"185":0,"203":0,"204":0,"223":0,"229":0,"230":0,"231":0,"234":0,"235":0,"238":0,"241":0,"243":0,"244":0,"245":0,"246":0,"247":0,"248":0,"250":0};
_yuitest_coverage["build/event-tap/event-tap.js"].functions = {"(anonymous 2):45":0,"detachHelper:41":0,"on:84":0,"detach:98":0,"(anonymous 3):121":0,"delegate:120":0,"detachDelegate:137":0,"touchStart:154":0,"touchMove:202":0,"touchEnd:222":0,"(anonymous 1):1":0};
_yuitest_coverage["build/event-tap/event-tap.js"].coveredLines = 44;
_yuitest_coverage["build/event-tap/event-tap.js"].coveredFunctions = 11;
_yuitest_coverline("build/event-tap/event-tap.js", 1);
YUI.add('event-tap', function (Y, NAME) {
/**
The tap module provides a gesture events, "tap", which normalizes user interactions
across touch and mouse or pointer based input devices. This can be used by application developers
to build input device agnostic components which behave the same in response to either touch or mouse based
interaction.
'tap' is like a touchscreen 'click', only it requires much less finger-down time since it listens to touch events,
but reverts to mouse events if touch is not supported.
@example
YUI().use('event-tap', function (Y) {
Y.one('#my-button').on('tap', function (e) {
});
});
@module event
@submodule event-tap
@author Andres Garza, matuzak and tilo mitra
@since 3.7.0
*/
_yuitest_coverfunc("build/event-tap/event-tap.js", "(anonymous 1)", 1);
_yuitest_coverline("build/event-tap/event-tap.js", 25);
var doc = Y.config.doc,
GESTURE_MAP = Y.Event._GESTURE_MAP,
SUPPORTS_TOUCHES = !!(doc && doc.createTouch),
EVT_START = GESTURE_MAP.start,
EVT_MOVE = GESTURE_MAP.move,
EVT_END = GESTURE_MAP.end,
EVT_CANCEL = GESTURE_MAP.cancel,
EVT_TAP = 'tap',
HANDLES = {
START: 'Y_TAP_ON_START_HANDLE',
MOVE: 'Y_TAP_ON_MOVE_HANDLE',
END: 'Y_TAP_ON_END_HANDLE',
CANCEL: 'Y_TAP_ON_CANCEL_HANDLE'
};
_yuitest_coverline("build/event-tap/event-tap.js", 41);
function detachHelper(subscription, handles, subset, context) {
_yuitest_coverfunc("build/event-tap/event-tap.js", "detachHelper", 41);
_yuitest_coverline("build/event-tap/event-tap.js", 43);
handles = subset ? handles : [ handles.START, handles.MOVE, handles.END, handles.CANCEL ];
_yuitest_coverline("build/event-tap/event-tap.js", 45);
Y.Array.each(handles, function (item, index, array) {
_yuitest_coverfunc("build/event-tap/event-tap.js", "(anonymous 2)", 45);
_yuitest_coverline("build/event-tap/event-tap.js", 46);
var handle = subscription[item];
_yuitest_coverline("build/event-tap/event-tap.js", 47);
if (handle) {
_yuitest_coverline("build/event-tap/event-tap.js", 48);
handle.detach();
_yuitest_coverline("build/event-tap/event-tap.js", 49);
subscription[item] = null;
}
});
}
/**
Sets up a "tap" event, that is fired on touch devices in response to a tap event (finger down, finder up).
This event can be used instead of listening for click events which have a 500ms delay on most touch devices.
This event can also be listened for using node.delegate().
@event tap
@param type {string} "tap"
@param fn {function} The method the event invokes. It receives the event facade of the underlying DOM event.
@for Event
@return {EventHandle} the detach handle
*/
_yuitest_coverline("build/event-tap/event-tap.js", 67);
Y.Event.define(EVT_TAP, {
/**
This function should set up the node that will eventually fire the event.
Usage:
node.on('tap', function (e) {
});
@method on
@param {Y.Node} node
@param {Array} subscription
@param {Boolean} notifier
@public
@static
**/
on: function (node, subscription, notifier) {
_yuitest_coverfunc("build/event-tap/event-tap.js", "on", 84);
_yuitest_coverline("build/event-tap/event-tap.js", 85);
subscription[HANDLES.START] = node.on(EVT_START, this.touchStart, this, node, subscription, notifier);
},
/**
Detaches all event subscriptions set up by the event-tap module
@method detach
@param {Y.Node} node
@param {Array} subscription
@param {Boolean} notifier
@public
@static
**/
detach: function (node, subscription, notifier) {
_yuitest_coverfunc("build/event-tap/event-tap.js", "detach", 98);
_yuitest_coverline("build/event-tap/event-tap.js", 99);
detachHelper(subscription, HANDLES);
},
/**
Event delegation for the 'tap' event. The delegated event will use a
supplied selector or filtering function to test if the event references at least one
node that should trigger the subscription callback.
Usage:
node.delegate('tap', function (e) {
}, 'li a');
@method delegate
@param {Y.Node} node
@param {Array} subscription
@param {Boolean} notifier
@param {String | Function} filter
@public
@static
**/
delegate: function (node, subscription, notifier, filter) {
_yuitest_coverfunc("build/event-tap/event-tap.js", "delegate", 120);
_yuitest_coverline("build/event-tap/event-tap.js", 121);
subscription[HANDLES.START] = node.delegate(EVT_START, function (e) {
_yuitest_coverfunc("build/event-tap/event-tap.js", "(anonymous 3)", 121);
_yuitest_coverline("build/event-tap/event-tap.js", 122);
this.touchStart(e, node, subscription, notifier, true);
}, filter, this);
},
/**
Detaches the delegated event subscriptions set up by the event-tap module.
Only used if you use node.delegate(...) instead of node.on(...);
@method detachDelegate
@param {Y.Node} node
@param {Array} subscription
@param {Boolean} notifier
@public
@static
**/
detachDelegate: function (node, subscription, notifier) {
_yuitest_coverfunc("build/event-tap/event-tap.js", "detachDelegate", 137);
_yuitest_coverline("build/event-tap/event-tap.js", 138);
detachHelper(subscription, HANDLES);
},
/**
Called when the monitor(s) are tapped on, either through touchstart or mousedown.
@method touchStart
@param {DOMEventFacade} event
@param {Y.Node} node
@param {Array} subscription
@param {Boolean} notifier
@param {Boolean} delegate
@protected
@static
**/
touchStart: function (event, node, subscription, notifier, delegate) {
_yuitest_coverfunc("build/event-tap/event-tap.js", "touchStart", 154);
_yuitest_coverline("build/event-tap/event-tap.js", 156);
var context = {
canceled: false
};
//move ways to quit early to the top.
// no right clicks
_yuitest_coverline("build/event-tap/event-tap.js", 162);
if (event.button && event.button === 3) {
_yuitest_coverline("build/event-tap/event-tap.js", 163);
return;
}
// for now just support a 1 finger count (later enhance via config)
_yuitest_coverline("build/event-tap/event-tap.js", 167);
if (event.touches && event.touches.length !== 1) {
_yuitest_coverline("build/event-tap/event-tap.js", 168);
return;
}
_yuitest_coverline("build/event-tap/event-tap.js", 171);
context.node = delegate ? event.currentTarget : node;
//There is a double check in here to support event simulation tests, in which
//event.touches can be undefined when simulating 'touchstart' on touch devices.
_yuitest_coverline("build/event-tap/event-tap.js", 175);
if (SUPPORTS_TOUCHES && event.touches) {
_yuitest_coverline("build/event-tap/event-tap.js", 176);
context.startXY = [ event.touches[0].pageX, event.touches[0].pageY ];
}
else {
_yuitest_coverline("build/event-tap/event-tap.js", 179);
context.startXY = [ event.pageX, event.pageY ];
}
//Possibly outdated issue: something is off with the move that it attaches it but never triggers the handler
_yuitest_coverline("build/event-tap/event-tap.js", 183);
subscription[HANDLES.MOVE] = node.once(EVT_MOVE, this.touchMove, this, node, subscription, notifier, delegate, context);
_yuitest_coverline("build/event-tap/event-tap.js", 184);
subscription[HANDLES.END] = node.once(EVT_END, this.touchEnd, this, node, subscription, notifier, delegate, context);
_yuitest_coverline("build/event-tap/event-tap.js", 185);
subscription[HANDLES.CANCEL] = node.once(EVT_CANCEL, this.touchMove, this, node, subscription, notifier, delegate, context);
},
/**
Called when the monitor(s) fires a touchmove or touchcancel event (or the mouse equivalent).
This method detaches event handlers so that 'tap' is not fired.
@method touchMove
@param {DOMEventFacade} event
@param {Y.Node} node
@param {Array} subscription
@param {Boolean} notifier
@param {Boolean} delegate
@param {Object} context
@protected
@static
**/
touchMove: function (event, node, subscription, notifier, delegate, context) {
_yuitest_coverfunc("build/event-tap/event-tap.js", "touchMove", 202);
_yuitest_coverline("build/event-tap/event-tap.js", 203);
detachHelper(subscription, [ HANDLES.MOVE, HANDLES.END, HANDLES.CANCEL ], true, context);
_yuitest_coverline("build/event-tap/event-tap.js", 204);
context.cancelled = true;
},
/**
Called when the monitor(s) fires a touchend event (or the mouse equivalent).
This method fires the 'tap' event if certain requirements are met.
@method touchEnd
@param {DOMEventFacade} event
@param {Y.Node} node
@param {Array} subscription
@param {Boolean} notifier
@param {Boolean} delegate
@param {Object} context
@protected
@static
**/
touchEnd: function (event, node, subscription, notifier, delegate, context) {
_yuitest_coverfunc("build/event-tap/event-tap.js", "touchEnd", 222);
_yuitest_coverline("build/event-tap/event-tap.js", 223);
var startXY = context.startXY,
endXY,
clientXY;
//There is a double check in here to support event simulation tests, in which
//event.touches can be undefined when simulating 'touchstart' on touch devices.
_yuitest_coverline("build/event-tap/event-tap.js", 229);
if (SUPPORTS_TOUCHES && event.changedTouches) {
_yuitest_coverline("build/event-tap/event-tap.js", 230);
endXY = [ event.changedTouches[0].pageX, event.changedTouches[0].pageY ];
_yuitest_coverline("build/event-tap/event-tap.js", 231);
clientXY = [event.changedTouches[0].clientX, event.changedTouches[0].clientY];
}
else {
_yuitest_coverline("build/event-tap/event-tap.js", 234);
endXY = [ event.pageX, event.pageY ];
_yuitest_coverline("build/event-tap/event-tap.js", 235);
clientXY = [event.clientX, event.clientY];
}
_yuitest_coverline("build/event-tap/event-tap.js", 238);
detachHelper(subscription, [ HANDLES.MOVE, HANDLES.END, HANDLES.CANCEL ], true, context);
// make sure mouse didn't move
_yuitest_coverline("build/event-tap/event-tap.js", 241);
if (Math.abs(endXY[0] - startXY[0]) === 0 && Math.abs(endXY[1] - startXY[1]) === 0) {
_yuitest_coverline("build/event-tap/event-tap.js", 243);
event.type = EVT_TAP;
_yuitest_coverline("build/event-tap/event-tap.js", 244);
event.pageX = endXY[0];
_yuitest_coverline("build/event-tap/event-tap.js", 245);
event.pageY = endXY[1];
_yuitest_coverline("build/event-tap/event-tap.js", 246);
event.clientX = clientXY[0];
_yuitest_coverline("build/event-tap/event-tap.js", 247);
event.clientY = clientXY[1];
_yuitest_coverline("build/event-tap/event-tap.js", 248);
event.currentTarget = context.node;
_yuitest_coverline("build/event-tap/event-tap.js", 250);
notifier.fire(event);
}
}
});
}, '3.8.0pr2', {"requires": ["node-base", "event-base", "event-touch", "event-synthetic"]});
|
const { normalizeArgs, readableToString } = require("./helpers.js");
const { mergeToString } = require("./mergeToString.js");
/**
* Reads multiple streams, merges their contents and write into the given stream.
* @param {WriteStream} destStream A stream which will be used to write the merge result.
* @param {ReadStream[]} srcStreams Streams which will be used to read data from.
* @param {Object} [options] Merge options. Currently unused.
* @param {Function} [cb] Callback function which will be called at completion. Will receive error as first argument if any.
*/
function mergeStreams(destStream, srcStreams, options, cb) {
const { callback, normalizedOptions, returnValue } = normalizeArgs(
options,
cb
);
Promise.all(srcStreams.map(readableToString)).then((srcStrings) => {
let destString = mergeToString(srcStrings, options);
destStream.on("error", callback);
destStream.write(destString, "utf8", callback);
}, callback);
return returnValue;
}
module.exports = { mergeStreams };
|
/* eslint-disable react/no-unescaped-entities */
import React, { memo, useState } from 'react';
import PropTypes from 'prop-types';
import { compose } from 'redux';
import { connect } from 'react-redux';
import { useInjectReducer } from 'utils/injectReducer';
import { useInjectSaga } from 'utils/injectSaga';
import reducer from 'containers/AddPage/reducer';
import saga from 'containers/AddPage/saga';
import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import { makeStyles } from '@material-ui/core/styles';
import DialogContentText from '@material-ui/core/DialogContentText';
import {
selectedTaskId,
changeEditTask,
updateTask,
} from '../../containers/AddPage/actions';
import Ul from './Ul';
import Wrapper from './Wrapper';
import Item from './Item';
import Span from './Span';
const useStyles = makeStyles({
root: {
'& > *': {
minWidth: '600px',
},
},
});
function List(props) {
const classes = useStyles();
const [open, setOpen] = React.useState(false);
const [openDel, setOpenDel] = React.useState(false);
const [text, setText] = React.useState('');
const [id, setId] = React.useState('');
const key = 'todoListReducer';
useInjectReducer({ key, reducer });
useInjectSaga({ key, saga });
const handleOpenEdit = (textInput, idTask) => {
setText(textInput);
setId(idTask);
setOpen(true);
};
const handleCloseEdit = () => {
setOpen(false);
};
const handleOpenDel = (textInput, idTask) => {
setText(textInput);
setId(idTask);
setOpenDel(true);
};
const handleCloseDel = () => {
setOpenDel(false);
};
const handleDeleteTaskById = () => {
props.onChangeSelectedTask(id);
setOpenDel(false);
};
const handleChangeUpdateTask = e => {
props.onChangeInputTask({ idTask: id, taskValue: e.target.value });
};
const handleUpdateTask = () => {
setOpen(false);
props.submitUpdateTask();
};
let content = <div />;
// If we have items, render them
if (props.items) {
content = props.items.map(item => (
// eslint-disable-next-line no-underscore-dangle
<Item key={item._id}>
{item.description}{' '}
<Span onClick={() => handleOpenDel(item.description, item._id)}>
Delete
</Span>
<Span onClick={() => handleOpenEdit(item.description, item._id)}>
Edit
</Span>
</Item>
));
} else {
// Otherwise render a single component
content = <div />;
}
return (
<Wrapper>
<Ul>{content}</Ul>
{/* Edit */}
<Dialog
fullWidth="300px"
open={open}
onClose={handleCloseEdit}
aria-labelledby="form-dialog-title"
className={classes.root}
>
<DialogTitle id="form-dialog-title">Edit Todo Task</DialogTitle>
<DialogContent>
<TextField
autoFocus
margin="dense"
id="todo"
label="Todo Task"
fullWidth
defaultValue={text}
onChange={handleChangeUpdateTask}
/>
</DialogContent>
<DialogActions>
<Button onClick={handleCloseEdit} color="primary">
Cancel
</Button>
<Button
onClick={handleUpdateTask}
color="primary"
variant="contained"
href="#contained-buttons"
>
Edit
</Button>
</DialogActions>
</Dialog>
{/* Delete */}
<Dialog
fullWidth="300px"
open={openDel}
onClose={handleCloseDel}
aria-labelledby="form-dialog-title"
className={classes.root}
>
<DialogTitle id="form-dialog-title">Delete Todo Task!!!</DialogTitle>
<DialogContent>
<DialogContentText id="alert-dialog-description">
Do you want delete "{text}" ?
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={handleCloseDel} color="primary">
Cancel
</Button>
<Button
variant="contained"
color="secondary"
onClick={handleDeleteTaskById}
>
Delete
</Button>
</DialogActions>
</Dialog>
</Wrapper>
);
}
List.propTypes = {
items: PropTypes.array,
onChangeSelectedTask: PropTypes.func,
onChangeInputTask: PropTypes.func,
submitUpdateTask: PropTypes.func,
};
export function mapDispatchToProps(dispatch) {
return {
onChangeSelectedTask: evt => {
dispatch(selectedTaskId(evt));
},
onChangeInputTask: evt => dispatch(changeEditTask(evt)),
submitUpdateTask: () => dispatch(updateTask()),
};
}
const withConnect = connect(
null,
mapDispatchToProps,
);
export default compose(
withConnect,
memo,
)(List);
|
var chevrotain = require("chevrotain")
// ----------------- lexer -----------------
var createToken = chevrotain.createToken
var Lexer = chevrotain.Lexer
var Parser = chevrotain.Parser
var True = createToken({ name: "True", pattern: /true/ })
var False = createToken({ name: "False", pattern: /false/ })
var Null = createToken({ name: "Null", pattern: /null/ })
var LCurly = createToken({ name: "LCurly", pattern: /{/ })
var RCurly = createToken({ name: "RCurly", pattern: /}/ })
var LSquare = createToken({ name: "LSquare", pattern: /\[/ })
var RSquare = createToken({ name: "RSquare", pattern: /]/ })
var Comma = createToken({ name: "Comma", pattern: /,/ })
var Colon = createToken({ name: "Colon", pattern: /:/ })
var StringLiteral = createToken({
name: "StringLiteral",
pattern: /"(?:[^\\"]|\\(?:[bfnrtv"\\/]|u[0-9a-fA-F]{4}))*"/
})
var NumberLiteral = createToken({
name: "NumberLiteral",
pattern: /-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/
})
var WhiteSpace = createToken({
name: "WhiteSpace",
pattern: /\s+/,
group: Lexer.SKIPPED,
line_breaks: true
})
var allTokens = [
WhiteSpace,
NumberLiteral,
StringLiteral,
LCurly,
RCurly,
LSquare,
RSquare,
Comma,
Colon,
True,
False,
Null
]
var JsonLexer = new Lexer(allTokens)
// ----------------- parser -----------------
function JsonParserES5(input) {
// invoke super constructor
Parser.call(this, input, allTokens)
// not mandatory, using <$> (or any other sign) to reduce verbosity (this. this. this. this. .......)
var $ = this
this.RULE("json", function() {
// prettier-ignore
$.OR([
{ALT: function() {$.SUBRULE($.object)}},
{ALT: function() {$.SUBRULE($.array)}}
])
})
this.RULE("object", function() {
$.CONSUME(LCurly)
$.MANY_SEP({
SEP: Comma,
DEF: function() {
$.SUBRULE2($.objectItem)
}
})
$.CONSUME(RCurly)
})
this.RULE("objectItem", function() {
$.CONSUME(StringLiteral)
$.CONSUME(Colon)
$.SUBRULE($.value)
})
this.RULE("array", function() {
$.CONSUME(LSquare)
$.MANY_SEP({
SEP: Comma,
DEF: () => {
$.SUBRULE2($.value)
}
})
$.CONSUME(RSquare)
})
this.RULE("value", function() {
// prettier-ignore
$.OR([
{ALT: function() {$.CONSUME(StringLiteral)}},
{ALT: function() {$.CONSUME(NumberLiteral)}},
{ALT: function() {$.SUBRULE($.object)}},
{ALT: function() {$.SUBRULE($.array)}},
{ALT: function() {$.CONSUME(True)}},
{ALT: function() {$.CONSUME(False)}},
{ALT: function() {$.CONSUME(Null)}}
])
})
// very important to call this after all the rules have been defined.
// otherwise the parser may not work correctly as it will lack information
// derived during the self analysis phase.
Parser.performSelfAnalysis(this)
}
// Using ES5 inheritance must be implemented using prototypes semantics.
JsonParserES5.prototype = Object.create(Parser.prototype)
JsonParserES5.prototype.constructor = JsonParserES5
// ----------------- wrapping it all together -----------------
// reuse the same parser instance.
var parser = new JsonParserES5([])
module.exports = function(text) {
var lexResult = JsonLexer.tokenize(text)
// setting a new input will RESET the parser instance's state.
parser.input = lexResult.tokens
// any top level rule may be used as an entry point
var value = parser.json()
return {
// This is a pure grammar, the value will be undefined until we add embedded actions
// or enable automatic CST creation.
value: value,
lexErrors: lexResult.errors,
parseErrors: parser.errors
}
}
|
/*
* Section Messages
*
* This contains all the text for the Section component.
*/
import { defineMessages } from 'react-intl';
export const scope = 'app.components.Section';
export default defineMessages({
header: {
id: `${scope}.header`,
defaultMessage: 'This is the Section component!',
},
});
|
define(["jquery","core/form-autocomplete","core/str","core/notification"],function(a,b,c,d){var e={UNIFIED_FILTERS:"#unified-filters"},f=function(){var f=[{key:"filterplaceholder",component:"tool_policy"},{key:"nofiltersapplied",component:"tool_policy"}];M.util.js_pending("acceptances_filter_datasource"),c.get_strings(f).done(function(a){var c=a[0],f=a[1];b.enhance(e.UNIFIED_FILTERS,!0,"tool_policy/acceptances_filter_datasource",c,!1,!0,f,!0).then(function(){M.util.js_complete("acceptances_filter_datasource")}).fail(d.exception)}).fail(d.exception);var g=a(e.UNIFIED_FILTERS).val();a(e.UNIFIED_FILTERS).on("change",function(){var b=a(this).val(),c=[],d=[],e=!1;if(a.each(b,function(a,b){var f=b.split(":",2);if(2!==f.length)return d.push(b),!0;var g=f[0],h=f[1];return"undefined"!=typeof c[g]&&(e=!0),c[g]=h,!0}),e){var f=[];for(var h in c)f.push(h+":"+c[h]);f=f.concat(d),a(this).val(f)}g.join(",")!=b.join(",")&&this.form.submit()})},g=function(){return a(e.UNIFIED_FILTERS).closest("form")};return{init:function(){f()},getForm:function(){return g()}}});
|
describe("About Objects", function () {
describe("Properties", function () {
var megalomaniac;
beforeEach(function () {
megalomaniac = { mastermind: "Joker", henchwoman: "Harley" };
});
it("should confirm objects are collections of properties", function () {
expect(megalomaniac.mastermind).toBe("Joker");
});
it("should confirm that properties are case sensitive", function () {
expect(megalomaniac.henchwoman).toBe("Harley");
expect(megalomaniac.henchWoman).toBe(undefined);
});
});
it("should know properties that are functions act like methods", function () {
var megalomaniac = {
mastermind : "Brain",
henchman: "Pinky",
battleCry: function (noOfBrains) {
return "They are " + this.henchman + " and the" +
Array(noOfBrains + 1).join(" " + this.mastermind);
}
};
var battleCry = megalomaniac.battleCry(4);
expect('They are Pinky and the Brain Brain Brain Brain').toMatch(battleCry);
});
it("should confirm that when a function is attached to an object, 'this' refers to the object", function () {
var currentDate = new Date();
var currentYear = (currentDate.getFullYear());
var megalomaniac = {
mastermind: "James Wood",
henchman: "Adam West",
birthYear: 1970,
calculateAge: function () {
return currentYear - this.birthYear;
}
};
expect(currentYear).toBe(2018);
expect(megalomaniac.calculateAge()).toBe(48);
});
describe("'in' keyword", function () {
var megalomaniac;
beforeEach(function () {
megalomaniac = {
mastermind: "The Monarch",
henchwoman: "Dr Girlfriend",
theBomb: true
};
});
it("should have the bomb", function () {
var hasBomb = "theBomb" in megalomaniac;
expect(hasBomb).toBe(true);
});
it("should not have the detonator however", function () {
var hasDetonator = "theDetonator" in megalomaniac;
expect(hasDetonator).toBe(false);
});
});
it("should know that properties can be added and deleted", function () {
var megalomaniac = { mastermind : "Agent Smith", henchman: "Agent Smith" };
expect("secretary" in megalomaniac).toBe(false);
megalomaniac.secretary = "Agent Smith";
expect("secretary" in megalomaniac).toBe(true);
delete megalomaniac.henchman;
expect("henchman" in megalomaniac).toBe(false);
});
it("should use prototype to add to all objects", function () {
function Circle(radius)
{
this.radius = radius;
}
var simpleCircle = new Circle(10);
var colouredCircle = new Circle(5);
colouredCircle.colour = "red";
expect(simpleCircle.colour).toBe(undefined);
expect(colouredCircle.colour).toBe("red");
Circle.prototype.describe = function () {
return "This circle has a radius of: " + this.radius;
};
expect(simpleCircle.describe()).toBe('This circle has a radius of: 10');
expect(colouredCircle.describe()).toBe('This circle has a radius of: 5');
});
});
|
const loading = {
show (msg = '加载中') {
wx.showLoading({
title: msg
})
},
hide () {
wx.hideLoading()
}
}
export default loading
|
function setCookie(cname,cvalue,exdays){var d=new Date();d.setTime(d.getTime()+(exdays*24*60*60*1000));var expires="expires="+d.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";path=/";}
function getCookie(cname){var name=cname+"=";var decodedCookie=decodeURIComponent(document.cookie);var ca=decodedCookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1);}if(c.indexOf(name)==0){return c.substring(name.length,c.length);}}return "";}
function send(url,method,data,onready, async=true){var xhttp=new XMLHttpRequest();xhttp.onreadystatechange=function(){if(this.readyState==4){if(onready!=null){var json = JSON.parse(this.responseText);onready(json);}}};xhttp.open(method,url,async);xhttp.send(data);return xhttp;}
function HTMLEncode(str){var i=str.length,aRet=[];while(i--){var iC=str[i].charCodeAt();if(iC<65||iC>127||(iC>90&&iC<97)){aRet[i]='&#'+iC+';';}else{aRet[i]=str[i];}}return aRet.join('');}
function store(cname,cvalue,stay=true){if(typeof(Storage)!=="undefined"){if(stay){localStorage.setItem(cname,cvalue);}else{sessionStorage.setItem(cname,cvalue);}}else{setCookie(cname,cvalue,30);}}
function load(cname,stay=true){if(typeof(Storage)!=="undefined"){if(stay){return localStorage.getItem(cname);}else{return sessionStorage.getItem(cname);}}else{return getCookie(cname);}}
function remove(cname,stay=true){if(typeof(Storage)!=="undefined"){if(stay){localStorage.removeItem(cname);}else{sessionStorage.removeItem(cname);}}else{setCookie(cname,null,0);}}
|
/* @flow */
import config from '../config'
import { initProxy } from './proxy'
import { initState } from './state'
import { initRender } from './render'
import { initEvents } from './events'
import { mark, measure } from '../util/perf'
import { initLifecycle, callHook } from './lifecycle'
import { initProvide, initInjections } from './inject'
import { extend, mergeOptions, formatComponentName } from '../util/index'
let uid = 0
/*装载_init 方法*/
export function initMixin (Vue: Class<Component>) {
Vue.prototype._init = function (options?: Object) {
const vm: Component = this
// a uid
vm._uid = uid++
let startTag, endTag
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
startTag = `vue-perf-start:${vm._uid}`
endTag = `vue-perf-end:${vm._uid}`
mark(startTag)
}
// a flag to avoid this being observed
vm._isVue = true
// merge options
if (options && options._isComponent) {
// optimize internal component instantiation
// since dynamic options merging is pretty slow, and none of the
// internal component options needs special treatment.
initInternalComponent(vm, options)
} else {
vm.$options = mergeOptions(
resolveConstructorOptions(vm.constructor),
options || {},
vm
)
}
/* istanbul ignore else */
if (process.env.NODE_ENV !== 'production') {
initProxy(vm)
} else {
vm._renderProxy = vm
}
// expose real self
vm._self = vm
initLifecycle(vm) //$parent,$root,$children,$refs,_watcher,_inactive,_directInactive,_isDestroyed,_isBeingDestroyed
initEvents(vm) //_events,_hasHookEvent
initRender(vm) //_vnode,_staticTrees,$slots,$scopedSlots,_c,$createElement
callHook(vm, 'beforeCreate')
initInjections(vm) // resolve injections before data/props
initState(vm) //_watchers
initProvide(vm) // resolve provide after data/props
callHook(vm, 'created')
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
vm._name = formatComponentName(vm, false)
mark(endTag)
measure(`vue ${vm._name} init`, startTag, endTag)
}
if (vm.$options.el) {
vm.$mount(vm.$options.el) //传入el直接挂载
}
}
}
export function initInternalComponent (vm: Component, options: InternalComponentOptions) {
const opts = vm.$options = Object.create(vm.constructor.options)
// doing this because it's faster than dynamic enumeration.
const parentVnode = options._parentVnode
opts.parent = options.parent
opts._parentVnode = parentVnode
const vnodeComponentOptions = parentVnode.componentOptions
opts.propsData = vnodeComponentOptions.propsData
opts._parentListeners = vnodeComponentOptions.listeners
opts._renderChildren = vnodeComponentOptions.children
opts._componentTag = vnodeComponentOptions.tag
if (options.render) {
opts.render = options.render
opts.staticRenderFns = options.staticRenderFns
}
}
export function resolveConstructorOptions (Ctor: Class<Component>) { //参数 Vue.constructor
let options = Ctor.options
if (Ctor.super) {
const superOptions = resolveConstructorOptions(Ctor.super)
const cachedSuperOptions = Ctor.superOptions
if (superOptions !== cachedSuperOptions) {
// super option changed,
// need to resolve new options.
Ctor.superOptions = superOptions
// check if there are any late-modified/attached options (#4976)
const modifiedOptions = resolveModifiedOptions(Ctor)
// update base extend options
if (modifiedOptions) {
extend(Ctor.extendOptions, modifiedOptions)
}
options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions)
if (options.name) {
options.components[options.name] = Ctor
}
}
}
return options
}
function resolveModifiedOptions (Ctor: Class<Component>): ?Object {
let modified
const latest = Ctor.options
const sealed = Ctor.sealedOptions
for (const key in latest) {
if (latest[key] !== sealed[key]) {
if (!modified) modified = {}
modified[key] = latest[key]
}
}
return modified
}
|
"use strict"
const config = require('../../config')
const cluster = require('cluster')
module.exports = {
'on_start': function (message){
console.log(`+ ${cluster.worker.id} worker [${cluster.worker.process.pid}] received [on_start] event in [${message.module}] module`)
},
'send email': function (data_in, callback){
if (config.email.enabled){
return callback( {
code: 'f.e.1',
message: 'Email sent',
actions: [
{
action: 'send email',
from: data_in.payload.from,
to: data_in.payload.to,
subject: data_in.payload.subject,
body: data_in.payload.body
},
]
})
}
else {
return callback( {
code: 'f.e.2',
message: 'Send email feature is not enabled'
} )
}
},
'about-->send email': function (){ // documentation
return {
title: 'send email',
description: 'Sends email',
data_in: {
token: '[secret token]',
action: 'send email',
payload: {
"from": "latomcus@gmail.com",
"to": "latomcus@gmail.com",
"subject": "Subject text",
"body": "Body html text."
}
}
}
},
}
|
import { ModeloAvance } from './avance.js';
const resolversAvance = {
Query: {
Avances: async (parent, args) => {
const avances = await ModeloAvance.find().populate('proyecto').populate('creadoPor');
return avances;
},
filtrarAvance: async (parents, args) => {
const avanceFiltrado = await ModeloAvance.find({ proyecto: args._id })
.populate('proyecto')
.populate('creadoPor');
return avanceFiltrado;
},
},
Mutation: {
crearAvance: async (parents, args) => {
const avanceCreado = ModeloAvance.create({
fecha: args.fecha,
descripcion: args.descripcion,
proyecto: args.proyecto,
creadoPor: args.creadoPor,
});
return avanceCreado;
},
},
};
export { resolversAvance };
|
const name = 'Генератор защитного поля';
let price = 1000;
console.log(`Выбран «${name}», цена за штуку ${price} кредитов`);
price = 2000;
console.log(`Выбран «${name}», цена за штуку ${price} кредитов`);
|
/*
* Copyright 2020 Google LLC
*
* 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
*
* https://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.
*/
/**
* External dependencies
*/
import { __, sprintf, _x } from '@web-stories-wp/i18n';
import PropTypes from 'prop-types';
/**
* Internal dependencies
*/
import { FIELD_TYPES, SCALE_DIRECTION } from '../../constants';
import { AnimationInputPropTypes } from '../types';
export const ZoomEffectInputPropTypes = {
zoomFrom: PropTypes.shape(AnimationInputPropTypes),
duration: PropTypes.shape(AnimationInputPropTypes),
};
export default {
zoomDirection: {
label: __('Direction', 'web-stories'),
tooltip: sprintf(
/* translators: 1: scaleIn. 2: scaleOut */
__('Valid values are %1$s or %2$s', 'web-stories'),
'zoomIn',
'zoomOut'
),
type: FIELD_TYPES.DIRECTION_PICKER,
values: [SCALE_DIRECTION.SCALE_IN, SCALE_DIRECTION.SCALE_OUT],
defaultValue: SCALE_DIRECTION.SCALE_OUT,
},
duration: {
label: __('Duration', 'web-stories'),
type: FIELD_TYPES.NUMBER,
unit: _x('ms', 'Time in milliseconds', 'web-stories'),
defaultValue: 2000,
},
};
|
;clc=clc||{},clc.cmd=clc.cmd||[],clc.cmd.push(function(){return clc.place({"zones":{"4":{"cn":"<a class=\"top \"href=\"https://stackoverflow.com/jobs/remote-developer-jobs\"target=\"_blank\"data-clc-click=\"https://clc.stackoverflow.com/click?an=42LLzddku3jVQzV8m6s3ExPLkcsvGcVX3PXwfdJmms340e92wPFABimGng0MDA32jIwMLNJM139xzH3PdfOeMFA85YDe1QxLDbW5dtJM3bO5Xszj2dMniib-4T7nrnaenu8iYPF5u2Ms2eNnA8U3n-NYNI_nWy9EPf-pDEtm3rl2DMcKvvmd_XLc1agEAA&cr=10439&ct=1&url=https%3A%2F%2Fstackoverflow.com%2Fjobs%2Fremote-developer-jobs%3Fmed=clc&sig=Hcy7CH2ZIRkn8w\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"46\" height=\"46\" viewBox=\"0 0 46 46\"><g fill=\"#FFF\"><path d=\"M33.35 25.265H11.955c-3.036.182-5.642-2.15-5.823-5.211-.18-3.06 2.133-5.69 5.168-5.871.323-4.711 3.746-8.615 8.343-9.514 4.597-.9 9.22 1.43 11.266 5.677a7.54 7.54 0 0 1 7.96 2.15 7.694 7.694 0 0 1 1.313 8.204 7.58 7.58 0 0 1-6.887 4.565h.055z\" opacity=\".3\"/><path d=\"M39.181 18.453a7.301 7.301 0 0 0-1.245-7.784 7.148 7.148 0 0 0-7.546-2.04.392.392 0 0 1-.477-.205c-1.948-4.128-6.418-6.405-10.868-5.536-4.45.87-7.755 4.664-8.035 9.229a.393.393 0 0 1-.368.368c-2.819.169-4.968 2.611-4.8 5.456.168 2.844 2.59 5.011 5.43 4.841h21.381a7.188 7.188 0 0 0 6.528-4.33zm-.66-8.309a8.087 8.087 0 0 1 1.38 8.624 7.973 7.973 0 0 1-7.244 4.8h-21.36c-3.253.194-6.045-2.305-6.239-5.581-.186-3.16 2.113-5.892 5.194-6.256.44-4.77 3.95-8.698 8.643-9.614 4.692-.916 9.404 1.407 11.578 5.667 2.9-.81 6.019.095 8.048 2.36z\"/><path d=\"M18.948 5.75l.614-.151a.393.393 0 0 0-.188-.763l-.613.151a.393.393 0 0 0 .187.763zm-4.977 5.15a7.252 7.252 0 0 1 2.807-4.083.393.393 0 0 0-.456-.64 8.038 8.038 0 0 0-3.11 4.525.393.393 0 0 0 .759.198zm14.841 18.6v7.659a2.346 2.346 0 0 1-2.335 2.357h-9.695a2.346 2.346 0 0 1-2.335-2.357V29.5a.393.393 0 1 0-.785 0v7.659c0 1.735 1.396 3.143 3.12 3.143h9.695c1.724 0 3.12-1.408 3.12-3.143V29.5a.393.393 0 1 0-.785 0z\"/><path d=\"M16.904 29.431v-6.256a.393.393 0 1 0-.785 0v6.256a.393.393 0 1 0 .785 0zm9.419 0v-6.256a.393.393 0 1 0-.785 0v6.256a.393.393 0 1 0 .785 0zm-4.7 8.052c-.978 0-1.77-.798-1.77-1.782 0-.983.792-1.781 1.77-1.781s1.77.798 1.77 1.781c0 .984-.792 1.782-1.77 1.782zm0-.786a.99.99 0 0 0 .985-.996.99.99 0 0 0-.985-.996.99.99 0 0 0-.985.996c0 .55.441.996.985.996z\"/><path d=\"M11.955 29.631h19.322a.393.393 0 0 0 0-.786H11.955a.393.393 0 0 0 0 .786zm28.295 8.455h-2.073c-1.723 0-3.12 1.408-3.12 3.143v1.375a2.346 2.346 0 0 1-2.334 2.357h-8.346a2.346 2.346 0 0 1-2.335-2.357v-2.75a.393.393 0 1 0-.784 0v2.75c0 1.735 1.396 3.143 3.12 3.143h8.345c1.723 0 3.12-1.408 3.12-3.143v-1.375a2.346 2.346 0 0 1 2.334-2.357h2.073a.393.393 0 0 0 0-.786z\"/></g></svg><span>Work from anywhere</span></a><div class=\"middle\"><ul class=\"jobs\"><li class=\"clc-dismissable\"><div class=\"job-wrap\"><a class=\"job\"title=\"Senior Software Engineer - Forex Exchange - Matching Engine at Kraken Bitcoin Exchange. Click to learn more.\"href=\"https://stackoverflow.com/jobs/172818/senior-software-engineer-forex-exchange-kraken-bitcoin-exchange\"target=\"_blank\"data-clc-click=\"https://clc.stackoverflow.com/click?an=42LLzddku3jVQzV8m6s3ExPLkcsvGcVX3PXwfdJmms340e92wPFABimGng0MDA32jIwMLNJM139xzH3PdfOeMFA85YDe1QxLDbW5dtJM3bO5Xszj2dMniib-4T7nrnaenu8iYPF5u2Ms2eNnA8U3n-NYNI_nWy9EPf-pDEtm3rl2DMcKvvmd_XLc1agEAA&cr=323417&ct=0&url=https%3A%2F%2Fstackoverflow.com%2Fjobs%2F172818%2Fsenior-software-engineer-forex-exchange-kraken-bitcoin-exchange%3Fmed=clc&sig=AXDwwWQQteZi5A\"><div class=\"title\">Senior Software Engineer - Forex Exchange - Matching Engine</div><div><span class=\"company\">Kraken Bitcoin Exchange</span><span class=\"location\"><svg viewBox=\"0 0 12 12\"><path d=\"M6 5.7c.4 0 .7-.1.9-.4.3-.3.4-.6.4-.9 0-.4-.1-.7-.4-.9-.2-.3-.5-.4-.9-.4s-.7.1-.9.4c-.3.2-.4.5-.4.9s.1.7.4.9c.2.3.5.4.9.4zm0-5c1 0 1.9.4 2.6 1.1.7.7 1.1 1.6 1.1 2.6 0 .5-.1 1.1-.4 1.8s-.5 1.3-.9 1.9c-.4.5-.7 1.1-1.1 1.6-.4.5-.7.9-.9 1.2l-.4.4c-.1-.1-.2-.3-.4-.5s-.5-.6-.9-1.2c-.4-.5-.8-1-1.1-1.6s-.7-1.1-.9-1.8c-.3-.7-.4-1.3-.4-1.8 0-1 .4-1.9 1.1-2.6S5 .7 6 .7z\"/></svg><span>Amsterdam, Netherlands</span></span></div><div class=\"opts\"><span class=\"opt salary\"><span>$70k - $130k</span></span><span class=\"opt remote\"><svg viewBox=\"0 0 12 12\"><path d=\"M6 9.8L3.9 7.7c1.3-.9 3-.9 4.2 0L6 9.8zm3-3a4.81 4.81 0 0 0-6 0L2.2 6c2.2-1.8 5.5-1.8 7.7 0l-.9.8zm1.7-1.7a7.27 7.27 0 0 0-9.4 0l-.9-.8c3.2-2.8 7.9-2.8 11.1 0l-.8.8z\"/></svg><span>Remote</span></span></div><span class=\"post-tag\">c++</span><span class=\"post-tag\">low-latency</span><div></div></a></div><a class=\"clc-dismiss\"data-clc-click=\"https://clc.stackoverflow.com/click?an=42LLzddku3jVQzV8m6s3ExPLkcsvGcVX3PXwfdJmms340e92wPFABimGng0MDA32jIwMLNJM139xzH3PdfOeMFA85YDe1QxLDbW5dtJM3bO5Xszj2dMniib-4T7nrnaenu8iYPF5u2Ms2eNnA8U3n-NYNI_nWy9EPf-pDEtm3rl2DMcKvvmd_XLc1agEAA&cr=323417&ct=-1&sig=ZEsHwHd5BRzhJg\"data-clc-meta-target=\"-1\"><svg viewBox=\"0 0 13.6 13.6\"><path d=\"M11.4 2.3C8.9-.2 4.8-.2 2.3 2.3s-2.5 6.6 0 9.1 6.6 2.5 9.1 0 2.5-6.6 0-9.1zM8.6 9.5L6.8 7.7 5 9.5l-.9-.9 1.8-1.8L4.1 5l.9-.9 1.8 1.8 1.8-1.8.9.9-1.8 1.8 1.8 1.8-.9.9z\"/></svg><span class=\"clc-tooltip above-left\">dismiss this job</span></a></li><li class=\"clc-dismissable\"><div class=\"job-wrap\"><a class=\"job\"title=\"Executive Vice President Of Technical Product Management at Crossover. Click to learn more.\"href=\"https://stackoverflow.com/jobs/193837/executive-vice-president-of-technical-product-crossover\"target=\"_blank\"data-clc-click=\"https://clc.stackoverflow.com/click?an=42LLzddku3jVQzV8m6s3ExPLkcsvGcVX3PXwfdJmms340e92wPFABimGng0MDA32jIwMLNJM139xzH3PdfOeMFA85YDe1QxLDbW5dtJM3bO5Xszj2dMniib-4T7nrnaenu8iYPF5u2Ms2eNnA8U3n-NYNI_nWy9EPf-pDEtm3rl2DMcKvvmd_XLc1agEAA&cr=345916&ct=0&url=https%3A%2F%2Fstackoverflow.com%2Fjobs%2F193837%2Fexecutive-vice-president-of-technical-product-crossover%3Fmed=clc&sig=aPKdPqMBT1DplQ\"><div class=\"title\">Executive Vice President Of Technical Product Management</div><div><span class=\"company\">Crossover</span><span class=\"location\"><svg viewBox=\"0 0 12 12\"><path d=\"M6 5.7c.4 0 .7-.1.9-.4.3-.3.4-.6.4-.9 0-.4-.1-.7-.4-.9-.2-.3-.5-.4-.9-.4s-.7.1-.9.4c-.3.2-.4.5-.4.9s.1.7.4.9c.2.3.5.4.9.4zm0-5c1 0 1.9.4 2.6 1.1.7.7 1.1 1.6 1.1 2.6 0 .5-.1 1.1-.4 1.8s-.5 1.3-.9 1.9c-.4.5-.7 1.1-1.1 1.6-.4.5-.7.9-.9 1.2l-.4.4c-.1-.1-.2-.3-.4-.5s-.5-.6-.9-1.2c-.4-.5-.8-1-1.1-1.6s-.7-1.1-.9-1.8c-.3-.7-.4-1.3-.4-1.8 0-1 .4-1.9 1.1-2.6S5 .7 6 .7z\"/></svg><span>No office location</span></span></div><div class=\"opts\"><span class=\"opt salary\"><span>$800k - $800k</span></span><span class=\"opt remote\"><svg viewBox=\"0 0 12 12\"><path d=\"M6 9.8L3.9 7.7c1.3-.9 3-.9 4.2 0L6 9.8zm3-3a4.81 4.81 0 0 0-6 0L2.2 6c2.2-1.8 5.5-1.8 7.7 0l-.9.8zm1.7-1.7a7.27 7.27 0 0 0-9.4 0l-.9-.8c3.2-2.8 7.9-2.8 11.1 0l-.8.8z\"/></svg><span>Remote</span></span></div><span class=\"post-tag\">java</span><span class=\"post-tag\">c#</span><div></div></a></div><a class=\"clc-dismiss\"data-clc-click=\"https://clc.stackoverflow.com/click?an=42LLzddku3jVQzV8m6s3ExPLkcsvGcVX3PXwfdJmms340e92wPFABimGng0MDA32jIwMLNJM139xzH3PdfOeMFA85YDe1QxLDbW5dtJM3bO5Xszj2dMniib-4T7nrnaenu8iYPF5u2Ms2eNnA8U3n-NYNI_nWy9EPf-pDEtm3rl2DMcKvvmd_XLc1agEAA&cr=345916&ct=-1&sig=DY0cqrLdhKdRcw\"data-clc-meta-target=\"-1\"><svg viewBox=\"0 0 13.6 13.6\"><path d=\"M11.4 2.3C8.9-.2 4.8-.2 2.3 2.3s-2.5 6.6 0 9.1 6.6 2.5 9.1 0 2.5-6.6 0-9.1zM8.6 9.5L6.8 7.7 5 9.5l-.9-.9 1.8-1.8L4.1 5l.9-.9 1.8 1.8 1.8-1.8.9.9-1.8 1.8 1.8 1.8-.9.9z\"/></svg><span class=\"clc-tooltip above-left\">dismiss this job</span></a></li><li class=\"clc-dismissable\"><div class=\"job-wrap\"><a class=\"job\"title=\"Senior Design Researcher at Wikimedia Foundation, Inc.. Click to learn more.\"href=\"https://stackoverflow.com/jobs/186054/senior-design-researcher-wikimedia-foundation-inc\"target=\"_blank\"data-clc-click=\"https://clc.stackoverflow.com/click?an=42LLzddku3jVQzV8m6s3ExPLkcsvGcVX3PXwfdJmms340e92wPFABimGng0MDA32jIwMLNJM139xzH3PdfOeMFA85YDe1QxLDbW5dtJM3bO5Xszj2dMniib-4T7nrnaenu8iYPF5u2Ms2eNnA8U3n-NYNI_nWy9EPf-pDEtm3rl2DMcKvvmd_XLc1agEAA&cr=342924&ct=0&url=https%3A%2F%2Fstackoverflow.com%2Fjobs%2F186054%2Fsenior-design-researcher-wikimedia-foundation-inc%3Fmed=clc&sig=aUvAPu29Mgc7tw\"><div class=\"title\">Senior Design Researcher</div><div><span class=\"company\">Wikimedia Foundation, Inc.</span><span class=\"location\"><svg viewBox=\"0 0 12 12\"><path d=\"M6 5.7c.4 0 .7-.1.9-.4.3-.3.4-.6.4-.9 0-.4-.1-.7-.4-.9-.2-.3-.5-.4-.9-.4s-.7.1-.9.4c-.3.2-.4.5-.4.9s.1.7.4.9c.2.3.5.4.9.4zm0-5c1 0 1.9.4 2.6 1.1.7.7 1.1 1.6 1.1 2.6 0 .5-.1 1.1-.4 1.8s-.5 1.3-.9 1.9c-.4.5-.7 1.1-1.1 1.6-.4.5-.7.9-.9 1.2l-.4.4c-.1-.1-.2-.3-.4-.5s-.5-.6-.9-1.2c-.4-.5-.8-1-1.1-1.6s-.7-1.1-.9-1.8c-.3-.7-.4-1.3-.4-1.8 0-1 .4-1.9 1.1-2.6S5 .7 6 .7z\"/></svg><span>San Francisco, CA</span></span></div><div class=\"opts\"><span class=\"opt remote\"><svg viewBox=\"0 0 12 12\"><path d=\"M6 9.8L3.9 7.7c1.3-.9 3-.9 4.2 0L6 9.8zm3-3a4.81 4.81 0 0 0-6 0L2.2 6c2.2-1.8 5.5-1.8 7.7 0l-.9.8zm1.7-1.7a7.27 7.27 0 0 0-9.4 0l-.9-.8c3.2-2.8 7.9-2.8 11.1 0l-.8.8z\"/></svg><span>Remote</span></span></div><span class=\"post-tag\">design</span><span class=\"post-tag\">user-interface</span><div></div></a></div><a class=\"clc-dismiss\"data-clc-click=\"https://clc.stackoverflow.com/click?an=42LLzddku3jVQzV8m6s3ExPLkcsvGcVX3PXwfdJmms340e92wPFABimGng0MDA32jIwMLNJM139xzH3PdfOeMFA85YDe1QxLDbW5dtJM3bO5Xszj2dMniib-4T7nrnaenu8iYPF5u2Ms2eNnA8U3n-NYNI_nWy9EPf-pDEtm3rl2DMcKvvmd_XLc1agEAA&cr=342924&ct=-1&sig=GNj2jK2UZo0eVg\"data-clc-meta-target=\"-1\"><svg viewBox=\"0 0 13.6 13.6\"><path d=\"M11.4 2.3C8.9-.2 4.8-.2 2.3 2.3s-2.5 6.6 0 9.1 6.6 2.5 9.1 0 2.5-6.6 0-9.1zM8.6 9.5L6.8 7.7 5 9.5l-.9-.9 1.8-1.8L4.1 5l.9-.9 1.8 1.8 1.8-1.8.9.9-1.8 1.8 1.8 1.8-.9.9z\"/></svg><span class=\"clc-tooltip above-left\">dismiss this job</span></a></li><li class=\"clc-dismissable\"><div class=\"job-wrap\"><a class=\"job\"title=\"Junior Innovation Developer at Roth Technical Specialties Inc.. Click to learn more.\"href=\"https://stackoverflow.com/jobs/166431/junior-innovation-developer-roth-technical-specialties\"target=\"_blank\"data-clc-click=\"https://clc.stackoverflow.com/click?an=42LLzddku3jVQzV8m6s3ExPLkcsvGcVX3PXwfdJmms340e92wPFABimGng0MDA32jIwMLNJM139xzH3PdfOeMFA85YDe1QxLDbW5dtJM3bO5Xszj2dMniib-4T7nrnaenu8iYPF5u2Ms2eNnA8U3n-NYNI_nWy9EPf-pDEtm3rl2DMcKvvmd_XLc1agEAA&cr=345846&ct=0&url=https%3A%2F%2Fstackoverflow.com%2Fjobs%2F166431%2Fjunior-innovation-developer-roth-technical-specialties%3Fmed=clc&sig=QV4gqcx9w9X-5w\"><div class=\"title\">Junior Innovation Developer</div><div><span class=\"company\">Roth Technical Specialties Inc.</span><span class=\"location\"><svg viewBox=\"0 0 12 12\"><path d=\"M6 5.7c.4 0 .7-.1.9-.4.3-.3.4-.6.4-.9 0-.4-.1-.7-.4-.9-.2-.3-.5-.4-.9-.4s-.7.1-.9.4c-.3.2-.4.5-.4.9s.1.7.4.9c.2.3.5.4.9.4zm0-5c1 0 1.9.4 2.6 1.1.7.7 1.1 1.6 1.1 2.6 0 .5-.1 1.1-.4 1.8s-.5 1.3-.9 1.9c-.4.5-.7 1.1-1.1 1.6-.4.5-.7.9-.9 1.2l-.4.4c-.1-.1-.2-.3-.4-.5s-.5-.6-.9-1.2c-.4-.5-.8-1-1.1-1.6s-.7-1.1-.9-1.8c-.3-.7-.4-1.3-.4-1.8 0-1 .4-1.9 1.1-2.6S5 .7 6 .7z\"/></svg><span>Dallas, TX</span></span></div><div class=\"opts\"><span class=\"opt salary\"><span>$86k - $115k</span></span><span class=\"opt remote\"><svg viewBox=\"0 0 12 12\"><path d=\"M6 9.8L3.9 7.7c1.3-.9 3-.9 4.2 0L6 9.8zm3-3a4.81 4.81 0 0 0-6 0L2.2 6c2.2-1.8 5.5-1.8 7.7 0l-.9.8zm1.7-1.7a7.27 7.27 0 0 0-9.4 0l-.9-.8c3.2-2.8 7.9-2.8 11.1 0l-.8.8z\"/></svg><span>Remote</span></span></div><span class=\"post-tag\">node.js</span><span class=\"post-tag\">javascript</span><div></div></a></div><a class=\"clc-dismiss\"data-clc-click=\"https://clc.stackoverflow.com/click?an=42LLzddku3jVQzV8m6s3ExPLkcsvGcVX3PXwfdJmms340e92wPFABimGng0MDA32jIwMLNJM139xzH3PdfOeMFA85YDe1QxLDbW5dtJM3bO5Xszj2dMniib-4T7nrnaenu8iYPF5u2Ms2eNnA8U3n-NYNI_nWy9EPf-pDEtm3rl2DMcKvvmd_XLc1agEAA&cr=345846&ct=-1&sig=-kLvvYefn80bVw\"data-clc-meta-target=\"-1\"><svg viewBox=\"0 0 13.6 13.6\"><path d=\"M11.4 2.3C8.9-.2 4.8-.2 2.3 2.3s-2.5 6.6 0 9.1 6.6 2.5 9.1 0 2.5-6.6 0-9.1zM8.6 9.5L6.8 7.7 5 9.5l-.9-.9 1.8-1.8L4.1 5l.9-.9 1.8 1.8 1.8-1.8.9.9-1.8 1.8 1.8 1.8-.9.9z\"/></svg><span class=\"clc-tooltip above-left\">dismiss this job</span></a></li><li class=\"x-rem-footer\"><p>Work remotely - from home or wherever you choose.</p><a class=\"x-rem-cta\"href=\"https://stackoverflow.com/jobs/remote-developer-jobs\"target=\"_blank\"data-clc-click=\"https://clc.stackoverflow.com/click?an=42LLzddku3jVQzV8m6s3ExPLkcsvGcVX3PXwfdJmms340e92wPFABimGng0MDA32jIwMLNJM139xzH3PdfOeMFA85YDe1QxLDbW5dtJM3bO5Xszj2dMniib-4T7nrnaenu8iYPF5u2Ms2eNnA8U3n-NYNI_nWy9EPf-pDEtm3rl2DMcKvvmd_XLc1agEAA&cr=10439&ct=2&url=https%3A%2F%2Fstackoverflow.com%2Fjobs%2Fremote-developer-jobs%3Fmed=clc&sig=5wObnQXourEbqQ\">Browse remote jobs</a></li></ul></div><img src=\"https://clc.stackoverflow.com/impression.gif?an=42LLzddku3jVQzV8m6s3ExPLkcsvGcVX3PXwfdJmms340e92wPFABimGng0MDA32jIwMLNJM139xzH3PdfOeMFA85YDe1QxLDbW5dtJM3bO5Xszj2dMniib-4T7nrnaenu8iYPF5u2Ms2eNnA8U3n-NYNI_nWy9EPf-pDEtm3rl2DMcKvvmd_XLc1agEAA&md=0\" class=\"impression\" style=\"display: none;\" />","cl":["orange","tagged","tex2jax_ignore","x-rem","clc-jobs-multi"]}},"tags":"|git|ssh|rsa|","disp":null,"analytics":true})});
|
import React from 'react';
import { Link } from 'react-router-dom'
import NavbarStore from '../stores/NavbarStore';
import NavbarActions from '../actions/NavbarActions';
import AppActions from '../actions/AppActions';
class Nav extends React.Component {
constructor(props) {
super(props);
this.state = NavbarStore.getState();
this.onChange = this.onChange.bind(this);
this.onLogout = this.onLogout.bind(this);
}
componentDidMount() {
NavbarStore.listen(this.onChange);
}
componentWillUnmount() {
NavbarStore.unlisten(this.onChange);
}
onChange(state) {
this.setState(state);
}
onLogout() {
AppActions.doLogout();
}
render() {
return (
<nav className="navbar navbar-inverse">
<div className="container-fluid">
<div className="navbar-header">
<Link className="navbar-brand" to="/">Mmis sso {/*JSON.stringify(this.state)*/}</Link>
</div>
<ul className="nav navbar-nav">
<li className={this.state.path === "/" ? "active" : ""}><Link to="/">Home</Link></li>
</ul>
{
this.state.logined
?
[<ul className="nav navbar-nav" key="DashBoard">
<li className={this.state.path.indexOf("/DashBoard") === 0 ? "active" : ""}><Link to="/DashBoard">DashBoard</Link></li>
</ul>,
<ul className="nav navbar-nav navbar-right" key="/LogOut">
<li><a onClick={this.onLogout}>log out</a></li>
</ul>]
:
<ul className="nav navbar-nav navbar-right">
<li className={this.state.path === "/Login" ? "active" : ""}><Link to="/Login">Login</Link></li>
</ul>
}
</div>
</nav>
);
}
}
export default Nav;
|
import React from 'react';
import GlobalStyle from './styles/global';
import Routes from './routes';
function App () {
return (
<>
<GlobalStyle />
<Routes />
</>
);
}
export default App;
|
!function(a,b,c){"function"==typeof define&&"undefined"!=typeof define.amd?define(b,function(){return c(a)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=c(a):a[b]=c(a)}(this,"UUID",function(){var a=function(a,b){for(var c=[],d=0;a>d;d++)c[d]=Math.floor(Math.random()*b+1);return c},b=function(a,b,c,d,e,f){for(var g=function(a,b){var c=a.toString(16);return c.length<2&&(c="0"+c),b&&(c=c.toUpperCase()),c},h=b;c>=h;h++)e[f++]=g(a[h],d);return e},c=function(a,b,c,d,e){for(var f=b;c>=f;f+=2)d[e++]=parseInt(a.substr(f,2),16)},d=function(a,b){var c={ibits:8,obits:8,obigendian:!0};for(var d in b)"undefined"!=typeof c[d]&&(c[d]=b[d]);for(var e,f,g,h=[],i=0,j=0,k=0,l=a.length;0===j&&(f=a.charCodeAt(i++)),e=f>>c.ibits-(j+8)&255,j=(j+8)%c.ibits,c.obigendian?0===k?g=e<<c.obits-8:g|=e<<c.obits-8-k:0===k?g=e:g|=e<<k,k=(k+8)%c.obits,!(0===k&&(h.push(g),i>=l)););return h},e=function(a,b){var c={ibits:32,ibigendian:!0};for(var d in b)"undefined"!=typeof c[d]&&(c[d]=b[d]);var e="",f=4294967295;c.ibits<32&&(f=(1<<c.ibits)-1);for(var g=a.length,h=0;g>h;h++)for(var i=a[h]&f,j=0;j<c.ibits;j+=8)e+=c.ibigendian?String.fromCharCode(i>>c.ibits-8-j&255):String.fromCharCode(i>>j&255);return e},f=8,g=8,h=256,i=function(a,b,c,d,e,f,g,h){return[h,g,f,e,d,c,b,a]},j=function(){return i(0,0,0,0,0,0,0,0)},k=function(a){for(var b=j(),c=0;f>c;c++)b[c]=Math.floor(a%h),a/=h;return b},l=function(a){for(var b=0,c=f-1;c>=0;c--)b*=h,b+=a[c];return Math.floor(b)},m=function(a,b){for(var c=0,d=0;f>d;d++)c+=a[d]+b[d],a[d]=Math.floor(c%h),c=Math.floor(c/h);return c},n=function(a,b){for(var c=0,d=0;f>d;d++)c+=a[d]*b,a[d]=Math.floor(c%h),c=Math.floor(c/h);return c},o=function(a,b){var c=j();if(b%g!==0)throw new Error("ui64_ror: only bit rotations supported with a multiple of digit bits");for(var d=Math.floor(b/g),e=0;d>e;e++){for(var h=f-1-1;h>=0;h--)c[h+1]=c[h];for(c[0]=a[0],h=0;f-1>h;h++)a[h]=a[h+1];a[h]=0}return l(c)},p=function(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c},q=function(a,b){return a<<b&4294967295|a>>>32-b&4294967295},r=function(a,b){function c(a,b,c,d){return 20>a?b&c|~b&d:40>a?b^c^d:60>a?b&c|b&d|c&d:b^c^d}function d(a){return 20>a?1518500249:40>a?1859775393:60>a?-1894007588:-899497514}a[b>>5]|=128<<24-b%32,a[(b+64>>9<<4)+15]=b;for(var e=Array(80),f=1732584193,g=-271733879,h=-1732584194,i=271733878,j=-1009589776,k=0;k<a.length;k+=16){for(var l=f,m=g,n=h,o=i,r=j,s=0;80>s;s++){16>s?e[s]=a[k+s]:e[s]=q(e[s-3]^e[s-8]^e[s-14]^e[s-16],1);var t=p(p(q(f,5),c(s,g,h,i)),p(p(j,e[s]),d(s)));j=i,i=h,h=q(g,30),g=f,f=t}f=p(f,l),g=p(g,m),h=p(h,n),i=p(i,o),j=p(j,r)}return[f,g,h,i,j]},s=function(a){return e(r(d(a,{ibits:8,obits:32,obigendian:!0}),8*a.length),{ibits:32,ibigendian:!0})},t=function(a,b){function c(a,b,c,d,e,f){return p(q(p(p(b,a),p(d,f)),e),c)}function d(a,b,d,e,f,g,h){return c(b&d|~b&e,a,b,f,g,h)}function e(a,b,d,e,f,g,h){return c(b&e|d&~e,a,b,f,g,h)}function f(a,b,d,e,f,g,h){return c(b^d^e,a,b,f,g,h)}function g(a,b,d,e,f,g,h){return c(d^(b|~e),a,b,f,g,h)}a[b>>5]|=128<<b%32,a[(b+64>>>9<<4)+14]=b;for(var h=1732584193,i=-271733879,j=-1732584194,k=271733878,l=0;l<a.length;l+=16){var m=h,n=i,o=j,r=k;h=d(h,i,j,k,a[l+0],7,-680876936),k=d(k,h,i,j,a[l+1],12,-389564586),j=d(j,k,h,i,a[l+2],17,606105819),i=d(i,j,k,h,a[l+3],22,-1044525330),h=d(h,i,j,k,a[l+4],7,-176418897),k=d(k,h,i,j,a[l+5],12,1200080426),j=d(j,k,h,i,a[l+6],17,-1473231341),i=d(i,j,k,h,a[l+7],22,-45705983),h=d(h,i,j,k,a[l+8],7,1770035416),k=d(k,h,i,j,a[l+9],12,-1958414417),j=d(j,k,h,i,a[l+10],17,-42063),i=d(i,j,k,h,a[l+11],22,-1990404162),h=d(h,i,j,k,a[l+12],7,1804603682),k=d(k,h,i,j,a[l+13],12,-40341101),j=d(j,k,h,i,a[l+14],17,-1502002290),i=d(i,j,k,h,a[l+15],22,1236535329),h=e(h,i,j,k,a[l+1],5,-165796510),k=e(k,h,i,j,a[l+6],9,-1069501632),j=e(j,k,h,i,a[l+11],14,643717713),i=e(i,j,k,h,a[l+0],20,-373897302),h=e(h,i,j,k,a[l+5],5,-701558691),k=e(k,h,i,j,a[l+10],9,38016083),j=e(j,k,h,i,a[l+15],14,-660478335),i=e(i,j,k,h,a[l+4],20,-405537848),h=e(h,i,j,k,a[l+9],5,568446438),k=e(k,h,i,j,a[l+14],9,-1019803690),j=e(j,k,h,i,a[l+3],14,-187363961),i=e(i,j,k,h,a[l+8],20,1163531501),h=e(h,i,j,k,a[l+13],5,-1444681467),k=e(k,h,i,j,a[l+2],9,-51403784),j=e(j,k,h,i,a[l+7],14,1735328473),i=e(i,j,k,h,a[l+12],20,-1926607734),h=f(h,i,j,k,a[l+5],4,-378558),k=f(k,h,i,j,a[l+8],11,-2022574463),j=f(j,k,h,i,a[l+11],16,1839030562),i=f(i,j,k,h,a[l+14],23,-35309556),h=f(h,i,j,k,a[l+1],4,-1530992060),k=f(k,h,i,j,a[l+4],11,1272893353),j=f(j,k,h,i,a[l+7],16,-155497632),i=f(i,j,k,h,a[l+10],23,-1094730640),h=f(h,i,j,k,a[l+13],4,681279174),k=f(k,h,i,j,a[l+0],11,-358537222),j=f(j,k,h,i,a[l+3],16,-722521979),i=f(i,j,k,h,a[l+6],23,76029189),h=f(h,i,j,k,a[l+9],4,-640364487),k=f(k,h,i,j,a[l+12],11,-421815835),j=f(j,k,h,i,a[l+15],16,530742520),i=f(i,j,k,h,a[l+2],23,-995338651),h=g(h,i,j,k,a[l+0],6,-198630844),k=g(k,h,i,j,a[l+7],10,1126891415),j=g(j,k,h,i,a[l+14],15,-1416354905),i=g(i,j,k,h,a[l+5],21,-57434055),h=g(h,i,j,k,a[l+12],6,1700485571),k=g(k,h,i,j,a[l+3],10,-1894986606),j=g(j,k,h,i,a[l+10],15,-1051523),i=g(i,j,k,h,a[l+1],21,-2054922799),h=g(h,i,j,k,a[l+8],6,1873313359),k=g(k,h,i,j,a[l+15],10,-30611744),j=g(j,k,h,i,a[l+6],15,-1560198380),i=g(i,j,k,h,a[l+13],21,1309151649),h=g(h,i,j,k,a[l+4],6,-145523070),k=g(k,h,i,j,a[l+11],10,-1120210379),j=g(j,k,h,i,a[l+2],15,718787259),i=g(i,j,k,h,a[l+9],21,-343485551),h=p(h,m),i=p(i,n),j=p(j,o),k=p(k,r)}return[h,i,j,k]},u=function(a){return e(t(d(a,{ibits:8,obits:32,obigendian:!1}),8*a.length),{ibits:32,ibigendian:!1})},v=0,w=0,x=function(){if(1===arguments.length&&"string"==typeof arguments[0])this.parse.apply(this,arguments);else if(arguments.length>=1&&"number"==typeof arguments[0])this.make.apply(this,arguments);else{if(arguments.length>=1)throw new Error("UUID: constructor: invalid arguments");for(var a=0;16>a;a++)this[a]=0}};return"undefined"!=typeof Uint8Array?x.prototype=new Uint8Array(16):Buffer?x.prototype=new Buffer(16):x.prototype=new Array(16),x.prototype.constructor=x,x.prototype.make=function(b){var c,d=this;if(1===b){var e=new Date,f=e.getTime();f!==v?w=0:w++,v=f;var g=k(f);n(g,1e4),m(g,i(1,178,29,210,19,129,64,0)),w>0&&m(g,k(w));var h;h=o(g,8),d[3]=255&h,h=o(g,8),d[2]=255&h,h=o(g,8),d[1]=255&h,h=o(g,8),d[0]=255&h,h=o(g,8),d[5]=255&h,h=o(g,8),d[4]=255&h,h=o(g,8),d[7]=255&h,h=o(g,8),d[6]=15&h;var j=a(2,255);d[8]=j[0],d[9]=j[1];var l=a(6,255);for(l[0]|=1,l[0]|=2,c=0;6>c;c++)d[10+c]=l[c]}else if(4===b){var p=a(16,255);for(c=0;16>c;c++)this[c]=p[c]}else{if(3!==b&&5!==b)throw new Error("UUID: make: invalid version");var q="",r="object"==typeof arguments[1]&&arguments[1]instanceof x?arguments[1]:(new x).parse(arguments[1]);for(c=0;16>c;c++)q+=String.fromCharCode(r[c]);q+=arguments[2];var t=3===b?u(q):s(q);for(c=0;16>c;c++)d[c]=t.charCodeAt(c)}return d[6]&=15,d[6]|=b<<4,d[8]&=63,d[8]|=128,d},x.prototype.format=function(){var a=Array(32);return b(this,0,3,!1,a,0),a[8]="-",b(this,4,5,!1,a,9),a[13]="-",b(this,6,7,!1,a,14),a[18]="-",b(this,8,9,!1,a,19),a[23]="-",b(this,10,15,!1,a,24),a.join("")},x.prototype.parse=function(a){var b={nil:"00000000-0000-0000-0000-000000000000","ns:DNS":"6ba7b810-9dad-11d1-80b4-00c04fd430c8","ns:URL":"6ba7b811-9dad-11d1-80b4-00c04fd430c8","ns:OID":"6ba7b812-9dad-11d1-80b4-00c04fd430c8","ns:X500":"6ba7b814-9dad-11d1-80b4-00c04fd430c8"};return void 0!==b[a]&&(a=b[a]),c(a,0,7,this,0),c(a,9,12,this,4),c(a,14,17,this,6),c(a,19,22,this,8),c(a,24,35,this,10),this},x.prototype["export"]=function(){for(var a=Array(16),b=0;16>b;b++)a[b]=this[b];return a},x.prototype["import"]=function(a){if(!("object"==typeof a&&a instanceof Array))throw new Error("UUID: import: invalid argument (type Array expected)");if(16!==a.length)throw new Error("UUID: import: invalid argument (Array of length 16 expected)");for(var b=0;16>b;b++){if("number"!=typeof a[b])throw new Error("UUID: import: invalid array element #"+b+" (type Number expected)");if(!isFinite(a[b])||Math.floor(a[b])!==a[b])throw new Error("UUID: import: invalid array element #"+b+" (Number with integer value expected)");if(!(a[b]>=0&&a[b]<=255))throw new Error("UUID: import: invalid array element #"+b+" (Number with integer value in range 0...255 expected)");this[b]=a[b]}return this},x});
|
import React from "react"
import { graphql, useStaticQuery } from "gatsby"
import Title from "./Title"
import styled from "styled-components"
import Image from "gatsby-image"
import { FaQuoteRight } from "react-icons/fa"
import { FiChevronRight, FiChevronLeft } from "react-icons/fi"
const Slider = () => {
return <h2>slider component</h2>
}
const Wrapper = styled.div`
background: var(--clr-grey-10);
.section-center {
margin-top: 4rem;
width: 80vw;
height: 450px;
max-width: 800px;
text-align: center;
position: relative;
display: flex;
overflow: hidden;
.img {
border-radius: 50%;
margin-bottom: 1rem;
}
h4 {
text-transform: uppercase;
color: var(--clr-primary-5);
margin-bottom: 0.25rem;
}
.title {
text-transform: capitalize;
margin-bottom: 0.75rem;
}
.text {
max-width: 45em;
margin: 0 auto;
line-height: 2;
color: var(--clr-grey-5);
}
.icon {
font-size: 3rem;
margin-top: 1rem;
color: var(--clr-primary-5);
}
.prev,
.next {
position: absolute;
top: 200px;
transform: translateY(-50%);
background: var(--clr-grey-5);
color: var(--clr-white);
width: 1.25rem;
height: 1.25rem;
display: grid;
place-items: center;
border-color: transparent;
font-size: 1rem;
border-radius: var(--radius);
cursor: pointer;
transition: var(--transition);
}
.prev:hover,
.next:hover {
background: var(--clr-primary-5);
}
.prev {
left: 0;
}
.next {
right: 0;
}
@media (min-width: 800px) {
.prev,
.next {
width: 2rem;
height: 2rem;
font-size: 1.5rem;
}
}
article {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
transition: var(--transition);
}
article.activeSlide {
opacity: 1;
transform: translateX(0);
}
article.lastSlide {
transform: translateX(-100%);
}
article.nextSlide {
transform: translateX(100%);
}
}
`
export default Slider
|
export * from './fundamentals'
export * from './time-series'
export * from './quotes'
export * from './search'
export * from './street-events'
|
const {
MIGRATIONS_COLLECTION_NAME
} = require("../constants.js");
async function updateDatabaseVersion({ db, namespace, runInfo, version }) {
await db.collection(MIGRATIONS_COLLECTION_NAME).updateOne({
namespace
}, {
$set: {
version
},
$push: {
runHistory: runInfo
}
}, {
upsert: true
});
}
module.exports = updateDatabaseVersion;
|
var TestData = (function () {
function TestData() {}
TestData.prototype.load = function (dictData) {
dictData.set('#USERNAME#', 'testuser1');
dictData.set('#PASSWORD#', '3X4mpl3');
dictData.set('#DATAITEM1#', 'data1');
dictData.set('#DATAITEM2#', 'data2');
dictData.set('#SESSION1.USERNAME#', 'John');
dictData.set('#NAME#', 'value');
dictData.set('#RANDOM1#', '{RANDOM(100, 20000, 10)}');
dictData.set('#{RANDOM1}#', 'RANDOM(100, 20000, 10)');
dictData.set('#RANDOM2#', '{RANDOM(10, 9999, 1)}');
dictData.set('#{RANDOM2}#', 'RANDOM(10, 9999, 1)');
dictData.set('#SEQUENCE1#', '{SEQUENCE(100, 2)}');
dictData.set('#{SEQUENCE1}#', 'SEQUENCE(100, 2)');
dictData.set('#ENVIRONMENT#', 'SYSTEST');
dictData.set('#VERSION#', '1');
dictData.set('#CREATEME#', 'True');
dictData.set('#SESSION1.USERNAME#', 'Jane');
};
return TestData;
})();
module.exports = TestData;
|
'use strict';
var User = require('../models/user').User;
module.exports = function(app) {
app.route('/movies')
.get(function(req, res, next) {
res.render('movies', {
title: 'Movies',
name: req.user.display_name,
picture: req.user.profile_picture
});
});
}
|
'use strict';
export const createAccountTab = '.login-form-nav .nav-item:nth-child(2)';
export const logInTab = '.login-form-nav .nav-item:nth-child(1)';
export const createAccountButton = '#register .btn-primary';
export const getRegisterFormFeedback = '#register .form-control-feedback';
export const getTrackOrderFormFeedback = '.trackorder .form-control-feedback';
export const checkStatusButton = '.trackorder .btn-primary';
|
define('node_modules/lodash/_baseKeys', function(require, exports, module) {
var isPrototype = require('node_modules/lodash/_isPrototype'),
nativeKeys = require('node_modules/lodash/_nativeKeys');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
*
* @private
* @param {Object} object The object to query.
* @returns {Array} Returns the array of property names.
*/
function baseKeys(object) {
if (!isPrototype(object)) {
return nativeKeys(object);
}
var result = [];
for (var key in Object(object)) {
if (hasOwnProperty.call(object, key) && key != 'constructor') {
result.push(key);
}
}
return result;
}
module.exports = baseKeys;
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.