diff --git a/.circleci/config.yml b/.circleci/config.yml
index dcc6d54aa..96f09c0df 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -7,7 +7,7 @@ jobs:
build:
docker:
# specify the version you desire here
- - image: circleci/node:8.11.2-browsers
+ - image: cimg/node:20.1.0-browsers
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
@@ -25,11 +25,11 @@ jobs:
# fallback to using the latest cache if no exact match is found
- openmbee-ve-
- - run: npm install
+ - run: yarn install
- save_cache:
paths:
- node_modules
key: openmbee-ve-{{ checksum "package.json" }}
- - run: ./node_modules/grunt/bin/grunt #--ARTIFACTORY_URL=https://oss.jfrog.org --ARTIFACTORY_USER=$ARTIFACTORY_USER --ARTIFACTORY_PASSWORD=$ARTIFACTORY_PASSWORD --SNAPSHOT_REPO=oss-snapshot-local --RELEASE_REPO=oss-release-local --GROUP_ID=org.openmbee deploy
\ No newline at end of file
+ - run: VE_ENV=example yarn test
diff --git a/.eslintignore b/.eslintignore
index fdc2532e0..1bb3e9bd8 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1 +1,3 @@
src/lib/**/*.js
+src/ve-extensions/present-plots/*
+src/ve-extensions/ts-diagram/*
diff --git a/.eslintrc b/.eslintrc
index 0a021a2ea..91d73ced4 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,105 +1,119 @@
{
- "settings": {
- "import/extensions": [".js", ".ts"],
- "import/parsers": {
- "@typescript-eslint/parser": [
- ".ts"
- ]
- },
- "import/resolver": {
- "typescript": {
- "alwaysCheckTypes": true,
- "project": "./tsconfig.json",
- "extensions": [".js", ".jsx", ".ts", ".tsx"]
- },
- "node": {
- "extensions": [".js", ".jsx", ".ts", ".tsx"],
- "moduleDirectory": ["node_modules"]
- }
- }
+ "root": true,
+ "extends": ["eslint:recommended"],
+ "env": {
+ "browser": true,
+ "es2021": true
},
- "parser": "@typescript-eslint/parser",
"parserOptions": {
- "project": "./tsconfig.json",
- "tsconfigRootDir": "./"
+ "ecmaVersion": 12,
+ "sourceType": "module"
},
- "plugins": ["unused-imports"],
- "extends": [
- "plugin:@typescript-eslint/recommended",
- "plugin:@typescript-eslint/recommended-requiring-type-checking",
- "plugin:import/errors",
- "plugin:import/warnings",
- "plugin:import/typescript",
- "plugin:prettier/recommended"
- ],
- "rules": {
- "@typescript-eslint/no-unused-vars": "off",
- "unused-imports/no-unused-imports": "error",
- "no-multiple-empty-lines": 2,
- "import/newline-after-import": [
- 2
- ],
- "@typescript-eslint/explicit-function-return-type": 2,
- "@typescript-eslint/no-inferrable-types": [
- 2,
- {
- "ignoreProperties": true
- }
- ],
- "import/order": ["error", {
- "newlines-between": "always",
- "alphabetize": {
- "order": "asc",
- "caseInsensitive": true
- },
- "pathGroups": [
- {
- "pattern": "@/**",
- "group": "external",
- "position": "after"
- },
- {
- "pattern": "@ve-app",
- "group": "internal",
- "position": "after"
- },
- {
- "pattern": "@ve-components",
- "group": "internal",
- "position": "after"
+ "overrides": [
+ {
+ "files": ["**/*.ts"],
+ "settings": {
+ "import/extensions": [".js", ".ts"],
+ "import/parsers": {
+ "@typescript-eslint/parser": [".ts"]
},
- {
- "pattern": "@ve-core",
- "group": "internal",
- "position": "after"
- },
- {
- "pattern": "@ve-utils",
- "group": "internal",
- "position": "after"
- },
- {
- "pattern": "@ve-types/**",
- "group": "type",
- "position": "after"
- },
- {
- "pattern": "../../lib/**",
- "group": "external",
- "position": "after"
+ "import/resolver": {
+ "typescript": {
+ "alwaysCheckTypes": true,
+ "project": "./tsconfig.json",
+ "extensions": [".ts", ".tsx"]
+ },
+ "node": {
+ "extensions": [".js", ".jsx", ".ts", ".tsx"],
+ "moduleDirectory": ["node_modules"]
+ }
}
+ },
+ "parser": "@typescript-eslint/parser",
+ "parserOptions": {
+ "project": "./tsconfig.json",
+ "tsconfigRootDir": "./"
+ },
+ "plugins": ["unused-imports"],
+ "extends": [
+ "plugin:@typescript-eslint/recommended",
+ "plugin:@typescript-eslint/recommended-requiring-type-checking",
+ "plugin:import/errors",
+ "plugin:import/warnings",
+ "plugin:import/typescript",
+ "plugin:prettier/recommended"
],
- "groups": [
- "builtin",
- "external",
- "internal",
- "unknown",
- "parent",
- "sibling",
- "index",
- "object",
- "type"
- ]
- }]
- }
+ "rules": {
+ "@typescript-eslint/no-unused-vars": "off",
+ "unused-imports/no-unused-imports": "error",
+ "no-multiple-empty-lines": 2,
+ "import/newline-after-import": [2],
+ "@typescript-eslint/explicit-function-return-type": 2,
+ "@typescript-eslint/no-inferrable-types": [
+ 2,
+ {
+ "ignoreProperties": true
+ }
+ ],
+ "import/order": [
+ "error",
+ {
+ "newlines-between": "always",
+ "alphabetize": {
+ "order": "asc",
+ "caseInsensitive": true
+ },
+ "pathGroups": [
+ {
+ "pattern": "@/**",
+ "group": "external",
+ "position": "after"
+ },
+ {
+ "pattern": "@ve-app",
+ "group": "internal",
+ "position": "after"
+ },
+ {
+ "pattern": "@ve-components",
+ "group": "internal",
+ "position": "after"
+ },
+ {
+ "pattern": "@ve-core",
+ "group": "internal",
+ "position": "after"
+ },
+ {
+ "pattern": "@ve-utils",
+ "group": "internal",
+ "position": "after"
+ },
+ {
+ "pattern": "@ve-types/**",
+ "group": "type",
+ "position": "after"
+ },
+ {
+ "pattern": "../../lib/**",
+ "group": "external",
+ "position": "after"
+ }
+ ],
+ "groups": [
+ "builtin",
+ "external",
+ "internal",
+ "unknown",
+ "parent",
+ "sibling",
+ "index",
+ "object",
+ "type"
+ ]
+ }
+ ]
+ }
+ }
+ ]
}
diff --git a/.prettierrc.js b/.prettierrc.js
index fc669ac24..03ce334bd 100644
--- a/.prettierrc.js
+++ b/.prettierrc.js
@@ -2,7 +2,6 @@
module.exports = {
trailingComma: 'es5',
tabWidth: 4,
- semi: false,
singleQuote: true,
printWidth: 120,
}
diff --git a/README.md b/README.md
index 6853db11b..fb564759d 100644
--- a/README.md
+++ b/README.md
@@ -1,278 +1,109 @@
-# View Editor (VE)
+
+
+
+
+
-## Usage
-https://github.com/Open-MBEE/ve/blob/develop/Documents/ViewEditorUserGuide.pdf
+# View Editor
-## File Structure
-* /package.json - Manifest file specifying node module dependencies required to build and bundle the app
-* /app/bower.json - Manifest file specifying bower dependencies (js/css library dependencies)
-* /Gruntfile.js - build file
-* /src/services - services for the mms module, these mostly wrap the rest services of the EMS
-* /src/directives - common components for mms.directives module, these provide common ui and behavior
-* /src/directives/templates - html templates for our directives plus common styling
-* /app - MDEV developed application, this will be separated out in the future
-## Configuration
-_(View Editor 4.0.0 and newer)_
+## About
+
+View Editor (VE) is a web-based environment designed to interact with a
+systems model. VE is a document oriented view of the model elements,
+which are stored in [OpenMBEE's Model Management Server (MMS)](https://github.com/Open-MBEE/mms). Its purpose is to provide real and
+true data through the web so that users may interact with actual model
+elements without having to open a modeling software (e.g. MagicDraw ).
+This allows users of all levels, including non-modelers, to view or
+modify live documents and values of a singular source of truth.
+
+## Users Guide
+http://docs.openmbee.org/projects/ve
+
+
+## Deployment Guide
+
+### Configuration
+
You can now configure view editor to work with external sites without using Grunt. This file also allows the configuration
of certain branding and other features that will be expanded in future versions
-1. In the `app/config` directory copy `config.example.js` into a new file and rename it to `config..js`
-2. You should update the `baseUrl` and `apiUrl` fields to point to your MMS server (eg. `apiURL: 'https://localhost:8080'`
-& (`baseUrl: ''`)
-3. To deploy view editor using this custom file, use `--env `
- appended to your `grunt` command (e.g. `grunt release:docker --env=prod`).
-3. For more information regarding the available configuration options see [Config](docs/Config.md).
-
-_Versions Prior to 4.0.0_
-5. Create a file named `angular-mms-grunt-servers.json`. This is where you will add server mappings.
- * The _grunt_ command will build with these default and fake values, but will not be runnable.
- * You should update "ems" key to point to the value of the **actual** hostname serving the Model Management Server (MMS).
-```json
-{
- "ems": "hostnameurl"
-}
-```
-## Installation and Building
-
-1. Install the latest stable version of Node ( at the time of this writing 8.9.4 )
-2. To install grunt cli:
-
- npm install -g grunt-cli
-
-3. cd into angular-mms directory
-4. to install all node module dependencies specified in package.json
-
- npm install
+#### For View Editor 5.x and newer
-6. In the root directory, run. . .
-* . . .to build and bundle the app in development mode. The final artifact will be available in the dist folder:
-
- grunt
+1. In the `config` directory copy `example.json` into a new file and rename it to `.json`
+2. You should update the `baseUrl` and `apiUrl` fields to point to your MMS server (eg. `apiURL: 'https://localhost:8080'`
+& (`baseUrl: ''`)
+3. To deploy view editor using this custom file, use `VE_ENV=`
+ prepended to your `npm` command (e.g. `export VE_ENV= & npm build --mode=production/development`).
-* . . .to build and bundle the app in production mode. The final artifact will be available in the dist folder:
-
- grunt release-build
-
-* . . .to build and bundle the app in development mode. This will also launch a web server at localhost:9000 for serving static resources from dist folder and a proxy server for any other resources with path starting with /alfresco. This allows us to test with real service endpoints defined in `angular-mms-grunt-servers.json`. The default server is opencaeuat:
+### Installation and Building
- grunt server
-
-* . . .to build a proxied service in develop mode with default configuration:
+1. Install the latest stable version of Node ( at the time of this writing 18.x )
- grunt server:docker
-
-* . . .to build and bundle the app in production mode as well as launching a web server locally and a proxy:
+2. (optional) To install yarn cli:
- grunt release
-
-* . . .to build and bundle the app in production mode as well as launching a webserver locally with default configuration:
+ npm install -g yarn-cli
- grunt release:docker
+3. to install all node module dependencies specified in package.json
-* . . .to build and bundle the app with a custom configuration in dev/production mode as well as launching a webserver locally (defaults to `example`):
+ npm install
- grunt :docker --env=
-
-* . . .to build and bundle the app in production modes, generate documentation and publish the final artifact to Artifactory:
+4. Use the following commands using webpack/npm to build and bundle the app in:
+ * . . . development mode. The final artifact will be available in the dist folder:
+
+ export VE_ENV= & npm build --mode=development
- grunt deploy
+ * . . .production mode. The final artifact will be available in the dist folder:
+
+ export VE_ENV= & npm build --mode=production
-* . . .to run unit tests:
+5. Use the following to test launch a web server at localhost:9000 for serving static resources from dist folder:
- grunt test
-
-7. To deploy, zip up the dist folder, it can be served as static files from a web server. For convenience, can unzip it to where mms is hosted (ex. {tomcatDir}/webapps/ve, {mmshost}/ve/mms.html to access)
+ npm start
-For more information, please consult the Gruntfile.js and the links at the bottom.
+### Building and Running standalone
+To deploy standalone, build in production mode & zip up the dist folder, it can be served as static files from a web server.
-## Building and Running with Docker
+### Building and Running with Docker
To build the container, run the following command: `docker build -t ve .`.
To run the container, run `docker run -it -p 80:9000 --name ve ve`.
-### Using the docker container
+#### Using the docker container
The docker container can be configured using a number of options
-#### Specifying Port
-To specify the port use `--env VE_ENV=` (default = 9000)
+##### Configuration Variables
+The View Editor container is based on the lightweight nginx:alpine container. See the nginx documentation for more details
+on how to configure nginx directly [here](https://hub.docker.com/_/nginx).
-#### Enabling HTTPS
-Use `--env VE_PROTOCOL='https'` in order for this to work you will need to mount your https certificates and key to
-`/run/secrets/cert.key` and `/run/secrets/cert.crt`
+- `VE_PORT` (default = 9000) Specify the desired port for VE to listen on \*
+- `VE_PROTOCOL` (accepts: 'http' | 'https') Enables SSL, you will additionally need to mount your https certificates and key to
+ `/run/secrets/cert.key` and `/run/secrets/cert.crt` \*
+- `VE_ENV` (default='example') specify a custom configuration file. Mount the desired file using a docker config
+ to `/opt/mbee/ve/config/.json` or volume mounted at `/opt/mbee/ve/config`.
-#### Config file (View Editor 4.0+)
-To use a custom configuration file with the docker container you can mount the desired file using a docker config (mounted to `/opt/mbee/ve/app/config/config..js`) or volume mounted at `/opt/mbee/ve/app/config`.
-Using your custom configuration can be done by specifying `--env VE_ENV=` or adding `VE_ENV` to your compose file.
+(* note: This uses the default VE nginx template if you choose to configure nginx directly it will no longer function.)
## Problems?
-If you see some error after updating, try cleaning out the bower_components and bower_components_target folders under /app and do a _grunt clean_
-
-### SASS Won't load
-If you get `Loading "sass.js" tasks...ERROR`
-
-Perform the following steps to resolve:
-1. cd to the project directory
-2. `npm update && npm install`
-3. Then `node ./node_modules/node-sass/scripts/install.js`
-4. Finally `npm rebuild node-sass`
-5. Execute Grunt
-
-### Rendering problems - clear bower cache
-If you're sure everything is right, try running _bower cache clean_
## Note on debugging
VE has source-mapping enabled. When developing and debugging it using Chrome, make sure to disable caching in the
Chrome's developer tool network tab to ensure that the source-mapping is updated when constantly modifying codes. ( Chrome caches source-mapping file by default ).
Firefox by default doesn't do that, so if you don't want to disable caching, use Firefox.
-## Testing
-Run:
- npm install -g protractor
- webdriver-manager update
-
-To execute Karma tests manually use
-
- ./node_modules/karma/bin/karma start config/develop/karma.develop.conf.js
-
-To avoid typing ./node_modules/karma/bin/karma everytime, install karma-cli globally, then karma should automatically use local karma
-
- npm install -g karma-cli
- karma start config/develop/karma.develop.conf.js
-
-To execute Protractor tests
-
- protractor config/develop/protractor.develop.conf.js
-
-For Karma - place new tests within test/develop/unit/DirectiveSpecs or test/develop/unit/ServiceSpecs
-
-For Protractor - place new tests within test/develop/e2e
-
## Generating Docs
-* _grunt ngdocs_ - this would generate html docs based on code comments written in ngdocs style into docs/. The generated files need to be served through a webserver to work.
-* _grunt docs_ - this would generate the docs and run the server at localhost:10000
-
-## Contributing and Experimenting, Add Components
-For general contributing guidelines, please see
-
-Fork this repo, switch to the develop branch and use our existing build process and structure to add in services/directives/apps - in the future will have a better repo structure for pulling in dependencies and module management
-
-### Services
-These are singletons. Angular will use dependency injection to give you whatever dependency you need if you declare them (these can be any built in Angular service or our other custom services in mms module)
-
-Put services under /src/services. For example, to add a service to do graph analysis:
-
- /src/services/GraphAnalysis.js
-
- 'use strict';
-
- angular.module('mms')
- .factory('GraphAnalysis', ['dependentService', GraphAnalysis]);
- /* GraphAnalysis is the name of this service, dependentService is the name of the service depended upon (there can be more than one comma separated strings for dependencies), the last argument is the actual service function
- */
-
- function GraphAnalysis(dependentService) {
- var privateVarState = "probably shouldn't do this";
-
- var detectCycles = function(graph) { //whatever graph format in js
- //logic
- };
-
- var privateFunc = function(stuff) {
- //logic
- };
-
- return { //this is like exposing a public method
- detectCycles: detectCycles
- };
- }
-
-### Directives
-Put core [Directives](https://docs.angularjs.org/guide/directive "Angular Documentation about Directives") under /src/directives. These should all be prefixed with 'mms' in file names, and will be utilized as 'mms-' in html. For example, this takes an element id argument and just displays the name.
-
- /src/directives/mmsElementName.js
-
- 'use strict';
-
- angular.module('veDirectives')
- .directive('mmsElementName', ['ElementService', mmsElementName]);
-
- function mmsElementName(ElementService) {
- var mmsElementNameLink = function(scope, element, attrs) {
- ElementService.getElement(scope.mmsId)
- .then(function(data) {
- scope.element = data;
- });
- };
-
- return {
- restrict: 'E',
- template: '{{element.name}}',
- scope: {
- mmsId: '@'
- },
- link: mmsElementNameLink
- };
- }
-
-To use this on an html page, use
-
-
-
-For a more complex template, put your template html in /src/directives/templates and they will be picked up in the compile process, and put into the $templateCache as 'mms/templates/template.html' (see other mms directives for examples or consult the angular docs)
-
-There are many more directive options to make complex directives, consult the Angular docs or other mms directives for examples.
-
-If you want to be able to type this into the view editor as the documentation of some element, you'll need to tell the tinymce editor to allow this custom tag. _Go to /src/directives/mmsTinymce.js and add your custom tag to the tinymce option custom_elements_.
-
-### App pages
-Put test pages under /app. The current build will look through bower dependencies and inject them into you page if you put in special tags. Example:
-#### html
-
- /app/test.html
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#### js
- /app/js/test/app.js
-
- 'use strict';
-
- angular.module('myApp', ['mms', 'mms.directives']);
- //declare module dependencies
+Docs are now automatically generated and posted to
### customize pdf css
-see src/services/UtilsService.getPrintCss
[princexml](https://www.princexml.com/)
## Links
* [node.js](http://nodejs.org/)
-* [angular](https://docs.angularjs.org/guide/directive)
-* [grunt](http://gruntjs.com/)
+* [angular,js](https://docs.angularjs.org/guide/directive)
+* [webpack](http://gruntjs.com/)
* [sass](http://sass-lang.com/)
* [ngdocs](https://github.com/idanush/ngdocs/wiki/API-Docs-Syntax)
* [grunt-ngdocs](https://github.com/m7r/grunt-ngdocs)
* [jasmine](http://jasmine.github.io/)
-## Rationale for using Karma for testing
-* [karma](http://karma-runner.github.io/0.12/index.html)
-* [thesis](https://github.com/karma-runner/karma/raw/master/thesis.pdf)
diff --git a/config/config.js b/config/config.js
index 586ba84a7..5adb15e4e 100644
--- a/config/config.js
+++ b/config/config.js
@@ -1,11 +1,11 @@
-(function () {
-
- $.ajax("config/config.json", {
+;(function () {
+ $.ajax('config/config.json', {
async: false,
global: false,
- dataType: "json",
+ dataType: 'json',
success: function (data) {
- window.__env = window.__env || {};
- window.__env = Object.assign(window.__env, data);
- }})
-}());
+ window.__env = window.__env || {}
+ window.__env = Object.assign(window.__env, data)
+ },
+ })
+})()
diff --git a/config/example.json b/config/example.json
index 1763ac75d..dc5cabe6c 100644
--- a/config/example.json
+++ b/config/example.json
@@ -2,7 +2,7 @@
"apiUrl": "http://localhost:8080",
"printUrl": "http://localhost:8081/convert",
"basePath": "",
- "enableDebug": true,
+ "enableDebug": false,
"customLabels": {
"pi": "PROPRIETARY: Proprietary Information",
"export_ctrl": "EXPORT WARNING: No export controlled documents allowed on this server",
diff --git a/package.json b/package.json
index 767baeb02..e90ece357 100644
--- a/package.json
+++ b/package.json
@@ -1,12 +1,17 @@
{
"name": "view-editor",
- "version": "5.0.0-alpha",
+ "version": "5.0.0",
"description": "View Editor Application",
"repository": "https://github.com/Open-MBEE/ve.git",
"main": "main.ts",
"scripts": {
"start": "cd dist && serve",
- "build": "webpack --bail --progress --profile"
+ "format": "prettier --write \"**/*.ts\" \"**/*.js\"",
+ "lint": "DEBUG=eslint:cli-engine eslint ./src",
+ "prebuild": "yarn lint && yarn format",
+ "build": "webpack --config webpack.config.ts --mode=production --bail",
+ "watch": "webpack --config webpack.config.ts --mode=development --watch --progress",
+ "test": "yarn prebuild && yarn build"
},
"devDependencies": {
"@babel/core": "^7.0.0",
@@ -87,7 +92,7 @@
"buffer": "^6.0.3",
"diff": "^3.5.0",
"flatpickr": "^4.6.9",
- "jquery": "^3.4.1",
+ "jquery": "^3.6.2",
"lodash": "^4.17.20",
"moment": "^2.29.1",
"ngstorage": "^0.3.11",
diff --git a/src/assets/logo-dark.svg b/src/assets/logo-dark.svg
new file mode 100644
index 000000000..79c0029b4
--- /dev/null
+++ b/src/assets/logo-dark.svg
@@ -0,0 +1,70 @@
+
+
+
diff --git a/src/assets/ve-logo-dark.svg b/src/assets/ve-logo-dark.svg
new file mode 100644
index 000000000..8a6755d99
--- /dev/null
+++ b/src/assets/ve-logo-dark.svg
@@ -0,0 +1,33 @@
+
+
+
diff --git a/src/assets/ve-logo.svg b/src/assets/ve-logo.svg
new file mode 100644
index 000000000..0dd59dc63
--- /dev/null
+++ b/src/assets/ve-logo.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/src/index.ejs b/src/index.ejs
index e3d19fd08..b94cc7d83 100644
--- a/src/index.ejs
+++ b/src/index.ejs
@@ -34,7 +34,7 @@
}
};
-
+
'
+ )
+ })
+
+ editor.on('paste', function (evt) {
+ // Firefox does remove iFrame elements from pasted content so this event do the same on other browsers.
+ // Also iFrame in paste content is reason of "Unspecified error" in IE9 (https://dev.ckeditor.com/ticket/10857).
+ var regex = new RegExp(']*?' + cls + '.*?', 'ig')
+ evt.data.dataValue = evt.data.dataValue.replace(regex, function (match) {
+ return match.replace(/()/i, '')
+ })
+ })
+ },
+ })
+
+ /**
+ * @private
+ * @singleton
+ * @class CKEDITOR.plugins.mathjax
+ */
+ CKEDITOR.plugins.mathjax = {}
+
+ /**
+ * A variable to fix problems with `iframe`. This variable is global
+ * because it is used in both the widget and the dialog window.
+ *
+ * @private
+ * @property {String} fixSrc
+ */
+ CKEDITOR.plugins.mathjax.fixSrc =
+ // In Firefox src must exist and be different than about:blank to emit load event.
+ CKEDITOR.env.gecko
+ ? 'javascript:true' // jshint ignore:line
+ : // Support for custom document.domain in IE.
+ CKEDITOR.env.ie
+ ? 'javascript:' + // jshint ignore:line
+ 'void((function(){' +
+ encodeURIComponent('document.open();' + '(' + CKEDITOR.tools.fixDomain + ')();' + 'document.close();') +
+ '})())'
+ : // In Chrome src must be undefined to emit load event.
+ 'javascript:void(0)' // jshint ignore:line
+
+ /**
+ * Loading indicator image generated by http://preloaders.net.
+ *
+ * @private
+ * @property {String} loadingIcon
+ */
+ CKEDITOR.plugins.mathjax.loadingIcon = CKEDITOR.plugins.get('mathjax').path + 'images/loader.gif'
+
+ /**
+ * Computes predefined styles and copies them to another element.
+ *
+ * @private
+ * @param {CKEDITOR.dom.element} from Copy source.
+ * @param {CKEDITOR.dom.element} to Copy target.
+ */
+ CKEDITOR.plugins.mathjax.copyStyles = function (from, to) {
+ var stylesToCopy = ['color', 'font-family', 'font-style', 'font-weight', 'font-variant', 'font-size']
+
+ for (var i = 0; i < stylesToCopy.length; i++) {
+ var key = stylesToCopy[i],
+ val = from.getComputedStyle(key)
+ if (val) to.setStyle(key, val)
+ }
+ }
+
+ /**
+ * Trims MathJax value from '\(1+1=2\)' to '1+1=2'.
+ *
+ * @private
+ * @param {String} value String to trim.
+ * @returns {String} Trimed string.
+ */
+ CKEDITOR.plugins.mathjax.trim = function (value) {
+ var begin = value.indexOf('\\(') + 2,
+ end = value.lastIndexOf('\\)')
+
+ return value.substring(begin, end)
+ }
+
+ /**
+ * FrameWrapper is responsible for communication between the MathJax library
+ * and the `iframe` element that is used for rendering mathematical formulas
+ * inside the editor.
+ * It lets you create visual mathematics by using the
+ * {@link CKEDITOR.plugins.mathjax.frameWrapper#setValue setValue} method.
+ *
+ * @private
+ * @class CKEDITOR.plugins.mathjax.frameWrapper
+ * @constructor Creates a class instance.
+ * @param {CKEDITOR.dom.element} iFrame The `iframe` element to be wrapped.
+ * @param {CKEDITOR.editor} editor The editor instance.
+ */
+ if (!(CKEDITOR.env.ie && CKEDITOR.env.version === 8)) {
+ CKEDITOR.plugins.mathjax.frameWrapper = function (iFrame, editor) {
+ var buffer,
+ preview,
+ value,
+ newValue,
+ doc = iFrame.getFrameDocument(),
+ // Is MathJax loaded and ready to work.
+ isInit = false,
+ // Is MathJax parsing Tex.
+ isRunning = false,
+ // Function called when MathJax is loaded.
+ loadedHandler = CKEDITOR.tools.addFunction(function () {
+ preview = doc.getById('preview')
+ buffer = doc.getById('buffer')
+ isInit = true
+
+ if (newValue) update()
+
+ // Private! For test usage only.
+ CKEDITOR.fire('mathJaxLoaded', iFrame)
+ }),
+ // Function called when MathJax finish his job.
+ updateDoneHandler = CKEDITOR.tools.addFunction(function () {
+ CKEDITOR.plugins.mathjax.copyStyles(iFrame, preview)
+
+ preview.setHtml(buffer.getHtml())
+
+ editor.fire('lockSnapshot')
+
+ iFrame.setStyles({
+ height: 0,
+ width: 0,
+ })
+
+ // Set iFrame dimensions.
+ var height = Math.max(doc.$.body.offsetHeight, doc.$.documentElement.offsetHeight),
+ width = Math.max(preview.$.offsetWidth, doc.$.body.scrollWidth)
+
+ iFrame.setStyles({
+ height: height + 'px',
+ width: width + 'px',
+ })
+
+ editor.fire('unlockSnapshot')
+
+ // Private! For test usage only.
+ CKEDITOR.fire('mathJaxUpdateDone', iFrame)
+
+ // If value changed in the meantime update it again.
+ if (value != newValue) update()
+ else isRunning = false
+ })
+ // Function called to run MathJax on update and star
+
+ iFrame.on('load', load)
+
+ load()
+
+ function load() {
+ doc = iFrame.getFrameDocument()
+
+ if (doc.getById('preview')) return
+
+ // Because of IE9 bug in a src attribute can not be javascript
+ // when you undo (https://dev.ckeditor.com/ticket/10930). If you have iFrame with javascript in src
+ // and call insertBefore on such element then IE9 will see crash.
+ if (CKEDITOR.env.ie) iFrame.removeAttribute('src')
+
+ doc.write(
+ `
+
+
+
+
+
+
+
+
+
+
+ `
+ )
+ }
+
+ // Run MathJax parsing Tex.
+ function update() {
+ isRunning = true
+
+ value = newValue
+
+ editor.fire('lockSnapshot')
+
+ buffer.setHtml(value)
+
+ // Set loading indicator.
+ preview.setHtml(
+ '
'
+ )
+
+ iFrame.setStyles({
+ height: '16px',
+ width: '16px',
+ display: 'inline',
+ 'vertical-align': 'middle',
+ })
+
+ editor.fire('unlockSnapshot')
+
+ // Run MathJax.
+ doc.getWindow().$.update(value)
+ }
+
+ return {
+ /**
+ * Sets the TeX value to be displayed in the `iframe` element inside
+ * the editor. This function will activate the MathJax
+ * library which interprets TeX expressions and converts them into
+ * their representation that is displayed in the editor.
+ *
+ * @param {String} value TeX string.
+ */
+ setValue: function (value) {
+ newValue = CKEDITOR.tools.htmlEncode(value)
+
+ if (isInit && !isRunning) update()
+ },
+ }
+ }
+ } else {
+ // In IE8 MathJax does not work stable so instead of using standard
+ // frame wrapper it is replaced by placeholder to show pure TeX in iframe.
+ CKEDITOR.plugins.mathjax.frameWrapper = function (iFrame, editor) {
+ iFrame
+ .getFrameDocument()
+ .write(
+ '' +
+ '' +
+ '' +
+ '' +
+ '' +
+ '' +
+ '' +
+ '' +
+ ''
+ )
+
+ return {
+ setValue: function (value) {
+ var doc = iFrame.getFrameDocument(),
+ tex = doc.getById('tex')
+
+ tex.setHtml(CKEDITOR.plugins.mathjax.trim(CKEDITOR.tools.htmlEncode(value)))
+
+ CKEDITOR.plugins.mathjax.copyStyles(iFrame, tex)
+
+ editor.fire('lockSnapshot')
+
+ iFrame.setStyles({
+ width: Math.min(250, tex.$.offsetWidth) + 'px',
+ height: doc.$.body.offsetHeight + 'px',
+ display: 'inline',
+ 'vertical-align': 'middle',
+ })
+
+ editor.fire('unlockSnapshot')
+ },
+ }
+ }
+ }
+})()
+
+/**
+ * Sets the path to the MathJax library. It can be both a local resource and a location different than the default CDN.
+ *
+ * Please note that this must be a full or absolute path.
+ *
+ * Read more in the {@glink features/mathjax documentation}
+ * and see the {@glink examples/mathjax example}.
+ *
+ * config.mathJaxLib = '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML';
+ *
+ * **Note:** Since CKEditor 4.5.0 this option does not have a default value, so it must
+ * be set in order to enable the MathJax plugin.
+ *
+ * @since 4.3.0
+ * @cfg {String} mathJaxLib
+ * @member CKEDITOR.config
+ */
+
+/**
+ * Sets the default class for `span` elements that will be
+ * converted into [Mathematical Formulas](https://ckeditor.com/cke4/addon/mathjax)
+ * widgets.
+ *
+ * If you set it to the following:
+ *
+ * config.mathJaxClass = 'my-math';
+ *
+ * The code below will be recognized as a Mathematical Formulas widget.
+ *
+ * \( \sqrt{4} = 2 \)
+ *
+ * Read more in the {@glink features/mathjax documentation}
+ * and see the {@glink examples/mathjax example}.
+ *
+ * @cfg {String} [mathJaxClass='math-tex']
+ * @member CKEDITOR.config
+ */
diff --git a/src/lib/ckeditor-plugins/mmscf/plugin.js b/src/lib/ckeditor-plugins/mmscf/plugin.js
index e0ef3328a..5bdc07577 100644
--- a/src/lib/ckeditor-plugins/mmscf/plugin.js
+++ b/src/lib/ckeditor-plugins/mmscf/plugin.js
@@ -1,5 +1,5 @@
/**
- * Plugin for inserting cross reference elements into the CKEditor editing area.
+ * Plugin for inserting cross-reference elements into the CKEditor editing area.
*/
// Register the plugin within the editor.
@@ -28,7 +28,7 @@ CKEDITOR.plugins.add('mmscf', {
upcast: (element) => {
// Return "true" (that element needs to converted to a mmscf widget)
// for all elements.
- return element.name === 'mms-cf'
+ return element.name === 'mms-cf' && element.attributes['mms-cf-type'] !== 'com'
},
})
},
diff --git a/src/lib/ckeditor-plugins/mmscomment/plugin.js b/src/lib/ckeditor-plugins/mmscomment/plugin.js
index 9b43bb69e..253e8cac3 100644
--- a/src/lib/ckeditor-plugins/mmscomment/plugin.js
+++ b/src/lib/ckeditor-plugins/mmscomment/plugin.js
@@ -13,18 +13,14 @@ CKEDITOR.plugins.add('mmscomment', {
editor.widgets.add('mmscomment', {
button: 'Insert Comment',
inline: true,
- allowedContent: 'mms-transclude-com[*];transclude-com[*]',
+ allowedContent: 'mms-cf[*];mms-transclude-com[*];transclude-com[*]',
insert: () => {
var defaultConfig = {
callbackModalFnc: () => {
console.log('There is no callback function defined')
},
}
- var config = CKEDITOR.tools.extend(
- defaultConfig,
- editor.config.mmscomment || {},
- true
- )
+ var config = CKEDITOR.tools.extend(defaultConfig, editor.config.mmscomment || {}, true)
var tag = config.callbackModalFnc(editor)
},
// Check the elements that need to be converted to widgets.
@@ -33,7 +29,8 @@ CKEDITOR.plugins.add('mmscomment', {
// for all elements.
return (
element.name === 'transclude-com' ||
- element.name === 'mms-transclude-com'
+ element.name === 'mms-transclude-com' ||
+ (element.name === 'mms-cf' && element.attributes['mms-cf-type'] === 'com')
)
},
})
diff --git a/src/lib/ckeditor/ckeditor4.js b/src/lib/ckeditor/ckeditor4.js
index 34e1873ef..83872ab71 100644
--- a/src/lib/ckeditor/ckeditor4.js
+++ b/src/lib/ckeditor/ckeditor4.js
@@ -28261,221 +28261,6 @@ For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
})()
CKEDITOR.config.magicline_keystrokePrevious = CKEDITOR.CTRL + CKEDITOR.SHIFT + 51
CKEDITOR.config.magicline_keystrokeNext = CKEDITOR.CTRL + CKEDITOR.SHIFT + 52
- ;(function () {
- CKEDITOR.plugins.add('mathjax', {
- requires: 'widget,dialog',
- icons: 'mathjax',
- isSupportedEnvironment: function () {
- return !CKEDITOR.env.ie || 8 < CKEDITOR.env.version
- },
- init: function (b) {
- var c = b.config.mathJaxClass || 'math-tex'
- b.config.mathJaxLib || CKEDITOR.error('mathjax-no-config')
- b.widgets.add('mathjax', {
- inline: !0,
- dialog: 'mathjax',
- button: b.lang.mathjax.button,
- mask: !0,
- allowedContent: 'span(!' + c + ')',
- styleToAllowedContentRules: function (a) {
- a = a.getClassesArray()
- if (!a) return null
- a.push('!' + c)
- return 'span(' + a.join(',') + ')'
- },
- pathName: b.lang.mathjax.pathName,
- template:
- '\x3cspan class\x3d"' +
- c +
- '" style\x3d"display:inline-block" data-cke-survive\x3d1\x3e\x3c/span\x3e',
- parts: { span: 'span' },
- defaults: {
- math: '\\(x \x3d {-b \\pm \\sqrt{b^2-4ac} \\over 2a}\\)',
- },
- init: function () {
- var a = this.parts.span.getChild(0)
- ;(a && a.type == CKEDITOR.NODE_ELEMENT && a.is('iframe')) ||
- ((a = new CKEDITOR.dom.element('iframe')),
- a.setAttributes({
- style: 'border:0;width:0;height:0',
- scrolling: 'no',
- frameborder: 0,
- allowTransparency: !0,
- src: CKEDITOR.plugins.mathjax.fixSrc,
- }),
- this.parts.span.append(a))
- this.once('ready', function () {
- CKEDITOR.env.ie && a.setAttribute('src', CKEDITOR.plugins.mathjax.fixSrc)
- this.frameWrapper = new CKEDITOR.plugins.mathjax.frameWrapper(a, b)
- this.frameWrapper.setValue(this.data.math)
- })
- },
- data: function () {
- this.frameWrapper && this.frameWrapper.setValue(this.data.math)
- },
- upcast: function (a, b) {
- if (
- 'span' == a.name &&
- a.hasClass(c) &&
- !(1 < a.children.length || a.children[0].type != CKEDITOR.NODE_TEXT)
- ) {
- b.math = CKEDITOR.tools.htmlDecode(a.children[0].value)
- var d = a.attributes
- d.style = d.style ? d.style + ';display:inline-block' : 'display:inline-block'
- d['data-cke-survive'] = 1
- a.children[0].remove()
- return a
- }
- },
- downcast: function (a) {
- a.children[0].replaceWith(
- new CKEDITOR.htmlParser.text(CKEDITOR.tools.htmlEncode(this.data.math))
- )
- var b = a.attributes
- b.style = b.style.replace(/display:\s?inline-block;?\s?/, '')
- '' === b.style && delete b.style
- return a
- },
- })
- CKEDITOR.dialog.add('mathjax', this.path + 'dialogs/mathjax.js')
- b.on('contentPreview', function (a) {
- a.data.dataValue = a.data.dataValue.replace(
- /<\/head>/,
- '\x3cscript src\x3d"' +
- CKEDITOR.getUrl(b.config.mathJaxLib) +
- '"\x3e\x3c/script\x3e\x3c/head\x3e'
- )
- })
- b.on('paste', function (a) {
- a.data.dataValue = a.data.dataValue.replace(
- new RegExp('\x3cspan[^\x3e]*?' + c + '.*?\x3c/span\x3e', 'ig'),
- function (a) {
- return a.replace(/()/i, '')
- }
- )
- })
- },
- })
- CKEDITOR.plugins.mathjax = {}
- CKEDITOR.plugins.mathjax.fixSrc = CKEDITOR.env.gecko
- ? 'javascript:true'
- : CKEDITOR.env.ie
- ? 'javascript:void((function(){' +
- encodeURIComponent('document.open();(' + CKEDITOR.tools.fixDomain + ')();document.close();') +
- '})())'
- : 'javascript:void(0)'
- CKEDITOR.plugins.mathjax.loadingIcon = CKEDITOR.plugins.get('mathjax').path + 'images/loader.gif'
- CKEDITOR.plugins.mathjax.copyStyles = function (b, c) {
- for (
- var a = 'color font-family font-style font-weight font-variant font-size'.split(' '), e = 0;
- e < a.length;
- e++
- ) {
- var d = a[e],
- g = b.getComputedStyle(d)
- g && c.setStyle(d, g)
- }
- }
- CKEDITOR.plugins.mathjax.trim = function (b) {
- var c = b.indexOf('\\(') + 2,
- a = b.lastIndexOf('\\)')
- return b.substring(c, a)
- }
- CKEDITOR.plugins.mathjax.frameWrapper =
- CKEDITOR.env.ie && 8 == CKEDITOR.env.version
- ? function (b, c) {
- b.getFrameDocument().write(
- '\x3c!DOCTYPE html\x3e\x3chtml\x3e\x3chead\x3e\x3cmeta charset\x3d"utf-8"\x3e\x3c/head\x3e\x3cbody style\x3d"padding:0;margin:0;background:transparent;overflow:hidden"\x3e\x3cspan style\x3d"white-space:nowrap;" id\x3d"tex"\x3e\x3c/span\x3e\x3c/body\x3e\x3c/html\x3e'
- )
- return {
- setValue: function (a) {
- var e = b.getFrameDocument(),
- d = e.getById('tex')
- d.setHtml(CKEDITOR.plugins.mathjax.trim(CKEDITOR.tools.htmlEncode(a)))
- CKEDITOR.plugins.mathjax.copyStyles(b, d)
- c.fire('lockSnapshot')
- b.setStyles({
- width: Math.min(250, d.$.offsetWidth) + 'px',
- height: e.$.body.offsetHeight + 'px',
- display: 'inline',
- 'vertical-align': 'middle',
- })
- c.fire('unlockSnapshot')
- },
- }
- }
- : function (b, c) {
- function a() {
- f = b.getFrameDocument()
- f.getById('preview') ||
- (CKEDITOR.env.ie && b.removeAttribute('src'),
- f.write(
- '\x3c!DOCTYPE html\x3e\x3chtml\x3e\x3chead\x3e\x3cmeta charset\x3d"utf-8"\x3e\x3cscript type\x3d"text/x-mathjax-config"\x3eMathJax.Hub.Config( {showMathMenu: false,messageStyle: "none"} );function getCKE() {if ( typeof window.parent.CKEDITOR \x3d\x3d \'object\' ) {return window.parent.CKEDITOR;} else {return window.parent.parent.CKEDITOR;}}function update() {MathJax.Hub.Queue([ \'Typeset\', MathJax.Hub, this.buffer ],function() {getCKE().tools.callFunction( ' +
- n +
- ' );});}MathJax.Hub.Queue( function() {getCKE().tools.callFunction(' +
- p +
- ');} );\x3c/script\x3e\x3cscript src\x3d"' +
- c.config.mathJaxLib +
- '"\x3e\x3c/script\x3e\x3c/head\x3e\x3cbody style\x3d"padding:0;margin:0;background:transparent;overflow:hidden"\x3e\x3cspan id\x3d"preview"\x3e\x3c/span\x3e\x3cspan id\x3d"buffer" style\x3d"display:none"\x3e\x3c/span\x3e\x3c/body\x3e\x3c/html\x3e'
- ))
- }
- function e() {
- m = !0
- h = k
- c.fire('lockSnapshot')
- d.setHtml(h)
- g.setHtml(
- '\x3cimg src\x3d' +
- CKEDITOR.plugins.mathjax.loadingIcon +
- ' alt\x3d' +
- c.lang.mathjax.loading +
- '\x3e'
- )
- b.setStyles({
- height: '16px',
- width: '16px',
- display: 'inline',
- 'vertical-align': 'middle',
- })
- c.fire('unlockSnapshot')
- f.getWindow().$.update(h)
- }
- var d,
- g,
- h,
- k,
- f = b.getFrameDocument(),
- l = !1,
- m = !1,
- p = CKEDITOR.tools.addFunction(function () {
- g = f.getById('preview')
- d = f.getById('buffer')
- l = !0
- k && e()
- CKEDITOR.fire('mathJaxLoaded', b)
- }),
- n = CKEDITOR.tools.addFunction(function () {
- CKEDITOR.plugins.mathjax.copyStyles(b, g)
- g.setHtml(d.getHtml())
- c.fire('lockSnapshot')
- b.setStyles({ height: 0, width: 0 })
- var a = Math.max(f.$.body.offsetHeight, f.$.documentElement.offsetHeight),
- l = Math.max(g.$.offsetWidth, f.$.body.scrollWidth)
- b.setStyles({ height: a + 'px', width: l + 'px' })
- c.fire('unlockSnapshot')
- CKEDITOR.fire('mathJaxUpdateDone', b)
- h != k ? e() : (m = !1)
- })
- b.on('load', a)
- a()
- return {
- setValue: function (a) {
- k = CKEDITOR.tools.htmlEncode(a)
- l && !m && e()
- },
- }
- }
- })()
;(function () {
function m(a) {
if (!a || a.type != CKEDITOR.NODE_ELEMENT || 'form' != a.getName()) return []
diff --git a/src/lib/ckeditor/config.js b/src/lib/ckeditor/config.js
index 2d1330d41..48a2ee05d 100644
--- a/src/lib/ckeditor/config.js
+++ b/src/lib/ckeditor/config.js
@@ -3,53 +3,222 @@
* For licensing, see https://ckeditor.com/legal/ckeditor-oss-license
*/
-CKEDITOR.editorConfig = function( config ) {
- // Define changes to default configuration here.
- // For complete reference see:
- // https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html
+CKEDITOR.editorConfig = function (config) {
+ // Define changes to default configuration here.
+ // For complete reference see:
+ // https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html
- config.disableNativeSpellChecker = false;
- config.fullPage = false;
- config.dialog_noConfirmCancel = true;
- //config.enableContextMenu = false;
- //config.tabSpaces = 4;
- //config.height = 350;
- // config.extraPlugins = 'autosave,iframe,mediaembed,embed,
- config.extraPlugins = 'liststyle,colordialog,autosave,autogrow,stylescombo,mmscf,mmscomment,mmsvlink,mmsreset,mmssignature,mmsdropdown,sourcedialog';
- config.autoGrow_minHeight = 200;
- config.autoGrow_maxHeight = 600;
- config.autoGrow_bottomSpace = 50;
- config.autoGrow_onStartup = true;
- config.startupFocus = 'end';
- config.mathJaxLib = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js';
- config.allowedContent = true;
- config.specialChars = ['€', '‘', '’', '“', '”', '–', '—', '¡', '¢', '£', '¤', '¥', '¦', '§', '¨', '©', 'ª', '«', '¬', '®', '¯', '°', '²', '³', '´', 'µ', '¶', '·', '¸', '¹', 'º', '»', '¼', '½', '¾', '¿', 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '×', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'Þ', 'ß', 'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', '÷', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', 'ÿ', 'Œ', 'œ', 'Ŵ', 'Ŷ', 'ŵ', 'ŷ', '‚', '‛', '„', '…', '™', '►', '•', '→', '⇒', '⇔', '♦', '≈','α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','π','ρ','σ','τ','υ','φ','χ','ψ','ω','Α','Β','Γ','Δ','Ε','Ζ','Η','Θ','Ι','Κ','Λ','Μ','Ν','Ξ','Ο','Π','Ρ','Σ','Τ','Υ','Φ','Χ','Ψ','Ω'];
- //config.protectedSource.push( /]*><\/i>/g );
+ config.disableNativeSpellChecker = false
+ config.fullPage = false
+ config.dialog_noConfirmCancel = true
+ //config.enableContextMenu = false;
+ //config.tabSpaces = 4;
+ //config.height = 350;
+ // config.extraPlugins = 'autosave,iframe,mediaembed,embed,
+ config.extraPlugins =
+ 'liststyle,colordialog,autosave,autogrow,stylescombo,mathjax,mmscf,mmscomment,mmsvlink,mmsreset,mmssignature,mmsdropdown,sourcedialog'
+ config.autoGrow_minHeight = 200
+ config.autoGrow_maxHeight = 600
+ config.autoGrow_bottomSpace = 50
+ config.autoGrow_onStartup = true
+ config.startupFocus = 'end'
+ config.mathJaxLib = 'mathjax/tex-mml-chtml.js'
+ config.mathJaxVer = 'v3'
+ config.allowedContent = true
+ config.specialChars = [
+ '€',
+ '‘',
+ '’',
+ '“',
+ '”',
+ '–',
+ '—',
+ '¡',
+ '¢',
+ '£',
+ '¤',
+ '¥',
+ '¦',
+ '§',
+ '¨',
+ '©',
+ 'ª',
+ '«',
+ '¬',
+ '®',
+ '¯',
+ '°',
+ '²',
+ '³',
+ '´',
+ 'µ',
+ '¶',
+ '·',
+ '¸',
+ '¹',
+ 'º',
+ '»',
+ '¼',
+ '½',
+ '¾',
+ '¿',
+ 'À',
+ 'Á',
+ 'Â',
+ 'Ã',
+ 'Ä',
+ 'Å',
+ 'Æ',
+ 'Ç',
+ 'È',
+ 'É',
+ 'Ê',
+ 'Ë',
+ 'Ì',
+ 'Í',
+ 'Î',
+ 'Ï',
+ 'Ð',
+ 'Ñ',
+ 'Ò',
+ 'Ó',
+ 'Ô',
+ 'Õ',
+ 'Ö',
+ '×',
+ 'Ø',
+ 'Ù',
+ 'Ú',
+ 'Û',
+ 'Ü',
+ 'Ý',
+ 'Þ',
+ 'ß',
+ 'à',
+ 'á',
+ 'â',
+ 'ã',
+ 'ä',
+ 'å',
+ 'æ',
+ 'ç',
+ 'è',
+ 'é',
+ 'ê',
+ 'ë',
+ 'ì',
+ 'í',
+ 'î',
+ 'ï',
+ 'ð',
+ 'ñ',
+ 'ò',
+ 'ó',
+ 'ô',
+ 'õ',
+ 'ö',
+ '÷',
+ 'ø',
+ 'ù',
+ 'ú',
+ 'û',
+ 'ü',
+ 'ý',
+ 'þ',
+ 'ÿ',
+ 'Œ',
+ 'œ',
+ 'Ŵ',
+ 'Ŷ',
+ 'ŵ',
+ 'ŷ',
+ '‚',
+ '‛',
+ '„',
+ '…',
+ '™',
+ '►',
+ '•',
+ '→',
+ '⇒',
+ '⇔',
+ '♦',
+ '≈',
+ 'α',
+ 'β',
+ 'γ',
+ 'δ',
+ 'ε',
+ 'ζ',
+ 'η',
+ 'θ',
+ 'ι',
+ 'κ',
+ 'λ',
+ 'μ',
+ 'ν',
+ 'ξ',
+ 'ο',
+ 'π',
+ 'ρ',
+ 'σ',
+ 'τ',
+ 'υ',
+ 'φ',
+ 'χ',
+ 'ψ',
+ 'ω',
+ 'Α',
+ 'Β',
+ 'Γ',
+ 'Δ',
+ 'Ε',
+ 'Ζ',
+ 'Η',
+ 'Θ',
+ 'Ι',
+ 'Κ',
+ 'Λ',
+ 'Μ',
+ 'Ν',
+ 'Ξ',
+ 'Ο',
+ 'Π',
+ 'Ρ',
+ 'Σ',
+ 'Τ',
+ 'Υ',
+ 'Φ',
+ 'Χ',
+ 'Ψ',
+ 'Ω',
+ ]
+ //config.protectedSource.push( /]*><\/i>/g );
- // Enhanced Image config
- config.image2_alignClasses = [ 'image-left', 'image-center', 'image-right' ];
- config.filebrowserUploadUrl = "/alfresco.php";
- config.uploadUrl = "/alfresco.php";
+ // Enhanced Image config
+ config.image2_alignClasses = ['image-left', 'image-center', 'image-right']
+ config.filebrowserUploadUrl = '/alfresco.php'
+ config.uploadUrl = '/alfresco.php'
- // Remove some buttons provided by the standard plugins, which are
- // not needed in the Standard(s) toolbar.
- config.removeButtons = 'Underline,Subscript,Superscript,Blockquote';
+ // Remove some buttons provided by the standard plugins, which are
+ // not needed in the Standard(s) toolbar.
+ config.removeButtons = 'Underline,Subscript,Superscript,Blockquote'
- // Set the most common block elements.
- config.format_tags = 'p;h1;h2;h3;pre';
+ // Set the most common block elements.
+ config.format_tags = 'p;h1;h2;h3;pre'
- // Simplify the dialog windows.
- config.removeDialogTabs = 'image:advanced;link:advanced';
+ // Simplify the dialog windows.
+ config.removeDialogTabs = 'image:advanced;link:advanced'
- config.stylesSet = [
- { name: 'Paragraph', element: 'p' },
- { name: 'Heading 1', element: 'h1' },
- { name: 'Heading 2', element: 'h2' },
- { name: 'Heading 3', element: 'h3' },
- { name: 'Heading 4', element: 'h4' },
- { name: 'Heading 5', element: 'h5' },
- { name: 'Heading 6', element: 'h6' },
- { name: 'Preformatted Text',element: 'pre' },
- { name: 'Computer Code', element: 'code' }
- ];
-};
+ config.stylesSet = [
+ { name: 'Paragraph', element: 'p' },
+ { name: 'Heading 1', element: 'h1' },
+ { name: 'Heading 2', element: 'h2' },
+ { name: 'Heading 3', element: 'h3' },
+ { name: 'Heading 4', element: 'h4' },
+ { name: 'Heading 5', element: 'h5' },
+ { name: 'Heading 6', element: 'h6' },
+ { name: 'Preformatted Text', element: 'pre' },
+ { name: 'Computer Code', element: 'code' },
+ ]
+}
diff --git a/src/lib/environment.ts b/src/lib/environment.ts
index f3d90ad92..caebc2f68 100644
--- a/src/lib/environment.ts
+++ b/src/lib/environment.ts
@@ -5,6 +5,6 @@ const environment = {
modules: './node_modules/',
},
mode: 'local',
-}
+};
-export default environment
+export default environment;
diff --git a/src/styles/ve-app/layout/_pane-right.scss b/src/styles/ve-app/layout/_pane-right.scss
index 267856030..d36be2d06 100644
--- a/src/styles/ve-app/layout/_pane-right.scss
+++ b/src/styles/ve-app/layout/_pane-right.scss
@@ -4,7 +4,9 @@
/*************************
Styles for the View Editor right pane
*************************/
-
+#spec-element-id-copy {
+ padding: 2px;
+}
.pane-right {
> .pane-right {
@include globals.box-shadow(-1px 0 1px 0 rgba(0, 0, 0, 0.2));
diff --git a/src/ve-app/events.d.ts b/src/ve-app/events.d.ts
index fcded09bb..d0e020ff6 100644
--- a/src/ve-app/events.d.ts
+++ b/src/ve-app/events.d.ts
@@ -1,15 +1,15 @@
-import { TreeBranch } from '@ve-types/tree'
+import { TreeBranch } from '@ve-types/tree';
export namespace veAppEvents {
interface viewAddedData {
- vId: string
- curSec: string
- prevSibId?: string
+ vId: string;
+ curSec: string;
+ prevSibId?: string;
}
interface viewDeletedData {
- parentBranch: TreeBranch
- prevBranch: TreeBranch
- branch: TreeBranch
+ parentBranch: TreeBranch;
+ prevBranch: TreeBranch;
+ branch: TreeBranch;
}
}
diff --git a/src/ve-app/index.ts b/src/ve-app/index.ts
index cda2b5097..6066eec0c 100644
--- a/src/ve-app/index.ts
+++ b/src/ve-app/index.ts
@@ -4,47 +4,47 @@
//Shared Dependencies
-import 'angular'
-import 'lodash'
-import 'angular-ui-bootstrap'
-import 'rx-lite'
-import 'flatpickr'
-
-import 'angular-animate'
-import 'angular-cookies'
-import 'angular-growl-v2'
-import 'angular-hotkeys'
-import '@uirouter/angularjs'
-import 'angular-sanitize'
-import 'angular-ui-tree'
-import '@openmbee/pane-layout'
-import '@openmbee/angularjs-dropdown-multiselect'
-
-import 'ui-router-visualizer'
-
-import 'angulartics'
-import 'angulartics-piwik'
-
-import 'moment'
-import 'ngstorage'
-
-import '../lib/angular-promise-extras/angular-promise-extras'
-import '../lib/angular-flatpickr/ngFlatpickr.main'
-import '../lib/html-rendered-diff/index'
-import '../lib/angular-ui-tree-filter/angular-ui-tree-filter'
+import 'angular';
+import 'lodash';
+import 'angular-ui-bootstrap';
+import 'rx-lite';
+import 'flatpickr';
+
+import 'angular-animate';
+import 'angular-cookies';
+import 'angular-growl-v2';
+import 'angular-hotkeys';
+import '@uirouter/angularjs';
+import 'angular-sanitize';
+import 'angular-ui-tree';
+import '@openmbee/pane-layout';
+import '@openmbee/angularjs-dropdown-multiselect';
+
+import 'ui-router-visualizer';
+
+import 'angulartics';
+import 'angulartics-piwik';
+
+import 'moment';
+import 'ngstorage';
+
+import '../lib/angular-promise-extras/angular-promise-extras';
+import '../lib/angular-flatpickr/ngFlatpickr.main';
+import '../lib/html-rendered-diff/index';
+import '../lib/angular-ui-tree-filter/angular-ui-tree-filter';
//VE Modules
-import '@ve-utils'
-import '@ve-core'
-import '@ve-components'
+import '@ve-utils';
+import '@ve-core';
+import '@ve-components';
-import './ve-app.module'
+import './ve-app.module';
-import './main'
+import './main';
-import './login'
-import './pane-center'
-import './pane-left'
-import './pane-right'
+import './login';
+import './pane-center';
+import './pane-left';
+import './pane-right';
-export * from './ve-app.module'
+export * from './ve-app.module';
diff --git a/src/ve-app/login/index.ts b/src/ve-app/login/index.ts
index be3a104e3..d21cc38d7 100644
--- a/src/ve-app/login/index.ts
+++ b/src/ve-app/login/index.ts
@@ -1,10 +1,10 @@
//Components
-import './login.component'
-import './login-banner.component'
-import './redirect.component'
-import './select.component'
-import './short-url.component'
+import './login.component';
+import './login-banner.component';
+import './redirect.component';
+import './select.component';
+import './short-url.component';
//Modals
-import './modals/login-warning.modal'
+import './modals/login-warning.modal';
diff --git a/src/ve-app/login/login-banner.component.ts b/src/ve-app/login/login-banner.component.ts
index 71e645bb6..00e2b9fe7 100644
--- a/src/ve-app/login/login-banner.component.ts
+++ b/src/ve-app/login/login-banner.component.ts
@@ -1,11 +1,11 @@
-import { IComponentController } from 'angular'
+import { IComponentController } from 'angular';
-import { BrandingStyle } from '@ve-utils/application'
-import { handleChange } from '@ve-utils/utils'
+import { BrandingStyle } from '@ve-utils/application';
+import { handleChange } from '@ve-utils/utils';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { VeComponentOptions } from '@ve-types/angular'
+import { VeComponentOptions } from '@ve-types/angular';
const LoginBannerComponent: VeComponentOptions = {
selector: 'loginBanner',
@@ -23,25 +23,25 @@ const LoginBannerComponent: VeComponentOptions = {
mmsLoginBanner: '<',
},
controller: class LoginBannerController implements IComponentController {
- private mmsLoginBanner: BrandingStyle
- public message: string[] | string
- protected spin: boolean = true
+ private mmsLoginBanner: BrandingStyle;
+ public message: string[] | string;
+ protected spin: boolean = true;
$onChanges(onChangesObj: angular.IOnChangesObject): void {
handleChange(onChangesObj, 'mmsLoginBanner', () => {
if (this.mmsLoginBanner) {
- this.spin = false
- this.message = this.mmsLoginBanner ? this.mmsLoginBanner.message : ''
+ this.spin = false;
+ this.message = this.mmsLoginBanner ? this.mmsLoginBanner.message : '';
} else {
- this.spin = true
- this.message = ''
+ this.spin = true;
+ this.message = '';
}
if (!Array.isArray(this.message)) {
- this.message = [this.message]
+ this.message = [this.message];
}
- })
+ });
}
},
-}
+};
-veApp.component(LoginBannerComponent.selector, LoginBannerComponent)
+veApp.component(LoginBannerComponent.selector, LoginBannerComponent);
diff --git a/src/ve-app/login/login.component.ts b/src/ve-app/login/login.component.ts
index f54ccd8d3..cf7b2846d 100644
--- a/src/ve-app/login/login.component.ts
+++ b/src/ve-app/login/login.component.ts
@@ -1,14 +1,14 @@
-import { StateService, TransitionPromise, UIRouterGlobals, UrlService } from '@uirouter/angularjs'
-import angular, { IComponentController, IQService } from 'angular'
+import { StateService, TransitionPromise, UIRouterGlobals, UrlService } from '@uirouter/angularjs';
+import angular, { IComponentController, IQService } from 'angular';
-import { BrandingService, BrandingStyle, RootScopeService } from '@ve-utils/application'
-import { AuthService } from '@ve-utils/mms-api-client'
+import { BrandingService, BrandingStyle, RootScopeService } from '@ve-utils/application';
+import { AuthService } from '@ve-utils/mms-api-client';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { VeComponentOptions, VePromiseReason } from '@ve-types/angular'
-import { ParamsObject } from '@ve-types/mms'
-import { VeModalResolveFn, VeModalService, VeModalSettings } from '@ve-types/view-editor'
+import { VeComponentOptions, VePromiseReason } from '@ve-types/angular';
+import { ParamsObject } from '@ve-types/mms';
+import { VeModalResolveFn, VeModalService, VeModalSettings } from '@ve-types/view-editor';
const LoginComponent: VeComponentOptions = {
selector: 'login',
@@ -49,14 +49,14 @@ const LoginComponent: VeComponentOptions = {
'AuthService',
'RootScopeService',
'BrandingService',
- ]
+ ];
- public spin: boolean = false
- loginBanner: BrandingStyle
+ public spin: boolean = false;
+ loginBanner: BrandingStyle;
//Bindings
- private mmsParams: ParamsObject
- private mmsLoginBanner: BrandingStyle
+ private mmsParams: ParamsObject;
+ private mmsLoginBanner: BrandingStyle;
constructor(
private $q: IQService,
@@ -71,42 +71,42 @@ const LoginComponent: VeComponentOptions = {
) {}
$onInit(): void {
- this.rootScopeSvc.veTitle('Login')
- this.rootScopeSvc.veShowLogin(true)
- this.loginBanner = this.mmsLoginBanner
+ this.rootScopeSvc.veTitle('Login');
+ this.rootScopeSvc.veShowLogin(true);
+ this.loginBanner = this.mmsLoginBanner;
if (!this.rootScopeSvc.veWarningOk()) {
- this.warning()
+ this.warning();
}
}
login(credentials: { password: string; username: string }): angular.IPromise {
- const deferred = this.$q.defer()
- this.spin = true
+ const deferred = this.$q.defer();
+ this.spin = true;
if (!credentials || !credentials.password || !credentials.username) {
- let message = 'Missing: '
- message += !credentials || !credentials.username ? 'Username' : ''
- message += !credentials ? ' and ' : ''
- message += !credentials || !credentials.password ? 'Password' : ''
- this.growl.error(message)
+ let message = 'Missing: ';
+ message += !credentials || !credentials.username ? 'Username' : '';
+ message += !credentials ? ' and ' : '';
+ message += !credentials || !credentials.password ? 'Password' : '';
+ this.growl.error(message);
} else {
const credentialsJSON = {
username: credentials.username,
password: credentials.password,
- }
+ };
this.authSvc.getAuthorized(credentialsJSON).then(
(user) => {
if (this.rootScopeSvc.veRedirect()) {
- const veRedirect = this.rootScopeSvc.veRedirect()
- const toState = veRedirect.toState
- const toParams = veRedirect.toParams
- toParams.next = undefined
+ const veRedirect = this.rootScopeSvc.veRedirect();
+ const toState = veRedirect.toState;
+ const toParams = veRedirect.toParams;
+ toParams.next = undefined;
deferred.resolve(
this.$state.go(toState.name, toParams, {
reload: true,
})
- )
+ );
} else if (this.mmsParams.next) {
- this.$urlService.url(this.mmsParams.next, true)
+ this.$urlService.url(this.mmsParams.next, true);
} else {
this.$state
.go('main.login.select', {
@@ -114,17 +114,17 @@ const LoginComponent: VeComponentOptions = {
})
.catch(() => {
/* Handled by UIRouter */
- })
+ });
}
},
(reason: VePromiseReason) => {
- this.spin = false
- this.growl.error(reason.message)
- deferred.reject(reason)
+ this.spin = false;
+ this.growl.error(reason.message);
+ deferred.reject(reason);
}
- )
+ );
}
- return deferred.promise
+ return deferred.promise;
}
warning(): void {
@@ -135,13 +135,13 @@ const LoginComponent: VeComponentOptions = {
windowTopClass: 'modal-center-override',
resolve: {
loginWarning: () => {
- return this.brandingSvc.loginWarning
+ return this.brandingSvc.loginWarning;
},
},
- }
- this.$uibModal.open(settings)
+ };
+ this.$uibModal.open(settings);
}
},
-}
+};
-veApp.component(LoginComponent.selector, LoginComponent)
+veApp.component(LoginComponent.selector, LoginComponent);
diff --git a/src/ve-app/login/modals/login-warning.modal.ts b/src/ve-app/login/modals/login-warning.modal.ts
index 46f861cb9..c40c1f9fa 100644
--- a/src/ve-app/login/modals/login-warning.modal.ts
+++ b/src/ve-app/login/modals/login-warning.modal.ts
@@ -1,47 +1,47 @@
-import { BrandingStyle, RootScopeService } from '@ve-utils/application'
-import { VeModalControllerImpl } from '@ve-utils/modals/ve-modal.controller'
+import { BrandingStyle, RootScopeService } from '@ve-utils/application';
+import { VeModalControllerImpl } from '@ve-utils/modals/ve-modal.controller';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { VeModalComponent, VeModalController, VeModalResolve, VeModalResolveFn } from '@ve-types/view-editor'
+import { VeModalComponent, VeModalController, VeModalResolve, VeModalResolveFn } from '@ve-types/view-editor';
export interface LoginWarningResolve extends VeModalResolve {
- loginWarning: BrandingStyle
+ loginWarning: BrandingStyle;
}
export interface LoginWarningResolveFn extends VeModalResolveFn {
- loginWarning(): BrandingStyle
+ loginWarning(): BrandingStyle;
}
class LoginWarningModalController
extends VeModalControllerImpl
implements VeModalController
{
- static $inject = ['RootScopeService']
+ static $inject = ['RootScopeService'];
- private warningMessage: string[]
- private loading: boolean
- private disabled: boolean
- private warningHeader: string = 'Warning'
+ private warningMessage: string[];
+ private loading: boolean;
+ private disabled: boolean;
+ private warningHeader: string = 'Warning';
constructor(private rootScopeSvc: RootScopeService) {
- super()
+ super();
}
$onInit(): void {
if (Array.isArray(this.resolve.loginWarning.message)) {
- this.warningMessage = this.resolve.loginWarning.message
- } else this.warningMessage = [this.resolve.loginWarning.message]
- this.disabled = this.resolve.loginWarning.disabled ? this.resolve.loginWarning.disabled : false
- this.loading = false
+ this.warningMessage = this.resolve.loginWarning.message;
+ } else this.warningMessage = [this.resolve.loginWarning.message];
+ this.disabled = this.resolve.loginWarning.disabled ? this.resolve.loginWarning.disabled : false;
+ this.loading = false;
if (this.rootScopeSvc.veWarningOk() || this.disabled) {
- this.modalInstance.dismiss()
+ this.modalInstance.dismiss();
}
}
continue(): void {
- this.rootScopeSvc.veWarningOk(true)
- this.modalInstance.close(true)
+ this.rootScopeSvc.veWarningOk(true);
+ this.modalInstance.close(true);
}
}
@@ -63,6 +63,6 @@ const LoginWarningModal: VeModalComponent = {
resolve: '<',
},
controller: LoginWarningModalController,
-}
+};
-veApp.component(LoginWarningModal.selector, LoginWarningModal)
+veApp.component(LoginWarningModal.selector, LoginWarningModal);
diff --git a/src/ve-app/login/redirect.component.ts b/src/ve-app/login/redirect.component.ts
index 948cb996a..ea69b8951 100644
--- a/src/ve-app/login/redirect.component.ts
+++ b/src/ve-app/login/redirect.component.ts
@@ -1,15 +1,15 @@
-import { StateService } from '@uirouter/angularjs'
-import angular, { IComponentController } from 'angular'
-import Rx from 'rx-lite'
+import { StateService } from '@uirouter/angularjs';
+import angular, { IComponentController } from 'angular';
+import Rx from 'rx-lite';
-import { RootScopeService } from '@ve-utils/application'
-import { EventService } from '@ve-utils/core'
-import { ProjectService, ElementService } from '@ve-utils/mms-api-client'
+import { RootScopeService } from '@ve-utils/application';
+import { EventService } from '@ve-utils/core';
+import { ProjectService, ElementService } from '@ve-utils/mms-api-client';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { VeComponentOptions, VePromiseReason, VePromisesResponse, VeQService } from '@ve-types/angular'
-import { ElementObject, QueryObject, RequestObject, ViewObject } from '@ve-types/mms'
+import { VeComponentOptions, VePromiseReason, VePromisesResponse, VeQService } from '@ve-types/angular';
+import { ElementObject, QueryObject, RequestObject, ViewObject } from '@ve-types/mms';
const RedirectComponent: VeComponentOptions = {
selector: 'redirect',
@@ -54,16 +54,16 @@ const RedirectComponent: VeComponentOptions = {
`,
controller: class RedirectController implements IComponentController {
- public subs: Rx.IDisposable[]
+ public subs: Rx.IDisposable[];
- public redirect_from_old: boolean
- redirect_noResults: boolean = false
- redirect_element: { name: string; type: string; link: string }
- spin: boolean = false
- elem: ElementObject
- redirect_relatedDocs: ViewObject[]
- projectIds: string[] = []
- reqOb: RequestObject
+ public redirect_from_old: boolean;
+ redirect_noResults: boolean = false;
+ redirect_element: { name: string; type: string; link: string };
+ spin: boolean = false;
+ elem: ElementObject;
+ redirect_relatedDocs: ViewObject[];
+ projectIds: string[] = [];
+ reqOb: RequestObject;
static $inject = [
'$q',
@@ -75,7 +75,7 @@ const RedirectComponent: VeComponentOptions = {
'ElementService',
'RootScopeService',
'EventService',
- ]
+ ];
constructor(
private $q: VeQService,
@@ -90,40 +90,40 @@ const RedirectComponent: VeComponentOptions = {
) {}
$onInit(): void {
- this.eventSvc.$init(this)
+ this.eventSvc.$init(this);
- this.rootScopeSvc.veTitle('Redirecting... | View Editor') //what to name this?
+ this.rootScopeSvc.veTitle('Redirecting... | View Editor'); //what to name this?
- this.redirect_from_old = this.rootScopeSvc.veRedirectFromOld()
+ this.redirect_from_old = this.rootScopeSvc.veRedirectFromOld();
this.subs.push(
this.eventSvc.binding(this.rootScopeSvc.constants.VEREDIRECTFROMOLD, (data: boolean) => {
- this.redirect_from_old = data
+ this.redirect_from_old = data;
})
- )
+ );
this.projectSvc.getProjects().then(
(projectObs) => {
this.projectIds = projectObs.map((a) => {
- return a.id
- })
+ return a.id;
+ });
this.reqOb = {
projectId: this.projectIds[0],
refId: 'master',
- }
- this.oldUrlTest(this.rootScopeSvc.veCrushUrl())
+ };
+ this.oldUrlTest(this.rootScopeSvc.veCrushUrl());
},
(reason) => {
- this.growl.error('Error getting projects: ' + reason.message)
+ this.growl.error('Error getting projects: ' + reason.message);
}
- )
+ );
}
public resetSelectPage = (): void => {
- void this.$state.go('main.login.select')
- }
+ void this.$state.go('main.login.select');
+ };
public buildQuery(idList: string[], projectIds: string[]): QueryObject[] {
- const queryObs: QueryObject[] = []
+ const queryObs: QueryObject[] = [];
//Filter master ref
for (const id of idList) {
for (const projectId of projectIds) {
@@ -133,32 +133,32 @@ const RedirectComponent: VeComponentOptions = {
_projectId: projectId,
_inRefIds: 'master',
},
- }
- queryObs.push(queryOb)
+ };
+ queryObs.push(queryOb);
}
}
- return queryObs
+ return queryObs;
}
public errorHandler = (reason: VePromiseReason>): void => {
- this.growl.error(reason.message)
- void this.$state.go('main.login.select')
- }
+ this.growl.error(reason.message);
+ void this.$state.go('main.login.select');
+ };
public oldUrlTest = (location: string): void => {
- const segments: string[] = location.split('/')
- let successRedirectFnc: (data: ViewObject[]) => void
- const searchTermList: string[] = []
+ const segments: string[] = location.split('/');
+ let successRedirectFnc: (data: ViewObject[]) => void;
+ const searchTermList: string[] = [];
const noResultFnc = (): void => {
// TODO - Search for document was unsucessful. Please select from the following or contact admin to verify that document exists.
- this.redirect_noResults = true
- }
- let redirectFnc: () => void = noResultFnc
+ this.redirect_noResults = true;
+ };
+ let redirectFnc: () => void = noResultFnc;
if (segments.length === 5) {
if (location.includes('sites')) {
//Search for site
- searchTermList.push(segments[4] + '_cover')
+ searchTermList.push(segments[4] + '_cover');
successRedirectFnc = (data): void => {
if (data.length > 0) {
this.redirect_element = {
@@ -170,24 +170,24 @@ const RedirectComponent: VeComponentOptions = {
"',refId:'master',preview:'" +
data[0].id +
"'})",
- }
+ };
redirectFnc = (): void => {
void this.$state.go('main.project.ref.portal.preview', {
projectId: data[0]._projectId,
refId: 'master',
preview: data[0].id,
- })
- }
+ });
+ };
} else {
- noResultFnc()
+ noResultFnc();
}
- }
+ };
}
} else if (segments.length === 7) {
//Search for document
if (location.includes('documents')) {
// ["", "workspaces", "master", "sites", "site__18_0_6_eda034b_1489006578377_52061_121780", "document", "_18_0_6_bec02f9_1489697812908_180368_252005"]
- searchTermList.push(segments[6])
+ searchTermList.push(segments[6]);
successRedirectFnc = (data): void => {
if (data.length > 0) {
this.redirect_element = {
@@ -199,20 +199,20 @@ const RedirectComponent: VeComponentOptions = {
"',refId:'master',documentId:'" +
data[0].id +
"'})",
- }
+ };
redirectFnc = (): void => {
void this.$state.go('main.project.ref.view.present', {
projectId: data[0]._projectId,
refId: 'master',
documentId: data[0].id,
- })
- }
+ });
+ };
} else {
- noResultFnc()
+ noResultFnc();
}
- }
+ };
} else if (location.includes('document')) {
- searchTermList.push(segments[6])
+ searchTermList.push(segments[6]);
successRedirectFnc = (data): void => {
if (data.length > 0) {
this.redirect_element = {
@@ -224,25 +224,25 @@ const RedirectComponent: VeComponentOptions = {
"',refId:'master',preview:'" +
data[0].id +
"'})",
- }
+ };
redirectFnc = (): void => {
void this.$state.go('main.project.ref.portal.preview', {
projectId: data[0]._projectId,
refId: 'master',
preview: data[0].id,
- })
- }
+ });
+ };
} else {
- noResultFnc()
+ noResultFnc();
}
- }
+ };
}
} else if (segments.length === 9) {
//Search for view
if (location.includes('views')) {
// ["", "workspaces", "master", "sites", "site__18_0_6_eda034b_1489006578377_52061_121780", "documents", "_18_0_6_bec02f9_1489697812908_180368_252005", "views", "MMS_1474405796233_0887698d-1fc7-47ac-87ac-b0f6e7b69d35"]
if (segments[6] == segments[8]) {
- searchTermList.push(segments[6])
+ searchTermList.push(segments[6]);
successRedirectFnc = (data): void => {
if (data.length > 0) {
this.redirect_element = {
@@ -256,22 +256,22 @@ const RedirectComponent: VeComponentOptions = {
"',viewId:'" +
data[0].id +
"'})",
- }
+ };
redirectFnc = (): void => {
void this.$state.go('main.project.ref.view.present', {
projectId: data[0]._projectId,
refId: 'master',
documentId: data[0].id,
viewId: data[0].id,
- })
- }
+ });
+ };
} else {
- noResultFnc()
+ noResultFnc();
}
- }
+ };
} else {
- searchTermList.push(segments[6])
- searchTermList.push(segments[8])
+ searchTermList.push(segments[6]);
+ searchTermList.push(segments[8]);
successRedirectFnc = (data): void => {
if (data.length > 1) {
if (data[0].id === segments[6] && data[1].id === segments[8]) {
@@ -287,15 +287,15 @@ const RedirectComponent: VeComponentOptions = {
"',viewId:'" +
data[1].id +
"'})",
- }
+ };
redirectFnc = (): void => {
void this.$state.go('main.project.ref.view.present', {
projectId: data[0]._projectId,
refId: 'master',
documentId: data[0].id,
viewId: data[1].id,
- })
- }
+ });
+ };
} else if (data[0].id === segments[8] && data[1].id === segments[6]) {
//should check case if data[1] is segent[6] also
this.redirect_element = {
@@ -309,20 +309,20 @@ const RedirectComponent: VeComponentOptions = {
"',viewId:'" +
data[0].id +
"'})",
- }
+ };
redirectFnc = (): void => {
void this.$state.go('main.project.ref.view.present', {
projectId: data[0]._projectId,
refId: 'master',
documentId: data[1].id,
viewId: data[0].id,
- })
- }
+ });
+ };
}
} else if (data.length > 0) {
if (data[0].id === segments[8]) {
- this.elem = data[0]
- this.redirect_relatedDocs = data[0]._relatedDocuments
+ this.elem = data[0];
+ this.redirect_relatedDocs = data[0]._relatedDocuments;
} else if (data[0].id === segments[6]) {
this.redirect_element = {
name: data[0].name,
@@ -333,25 +333,25 @@ const RedirectComponent: VeComponentOptions = {
"',refId:'master',documentId:'" +
data[0].id +
"'})",
- }
+ };
redirectFnc = (): void => {
void this.$state.go('main.project.ref.view.present', {
projectId: data[0]._projectId,
refId: 'master',
documentId: data[0].id,
- })
- }
+ });
+ };
}
} else {
- noResultFnc()
+ noResultFnc();
}
- }
+ };
}
}
} else if (segments.length === 8) {
//Search for full doc
if (location.includes('full')) {
- searchTermList.push(segments[6])
+ searchTermList.push(segments[6]);
successRedirectFnc = (data): void => {
if (data.length > 0) {
this.redirect_element = {
@@ -363,34 +363,34 @@ const RedirectComponent: VeComponentOptions = {
"',refId:'master',documentId:'" +
data[0].id +
"'})",
- }
+ };
redirectFnc = (): void => {
void this.$state.go('main.project.ref.view.present.document', {
projectId: data[0]._projectId,
refId: 'master',
documentId: data[0].id,
- })
- }
+ });
+ };
} else {
- noResultFnc()
+ noResultFnc();
}
- }
+ };
}
}
// console.log(segments);
- const queryObs: QueryObject[] = this.buildQuery(searchTermList, this.projectIds)
- const promises: angular.IPromise[] = []
+ const queryObs: QueryObject[] = this.buildQuery(searchTermList, this.projectIds);
+ const promises: angular.IPromise[] = [];
for (const queryOb of queryObs) {
- promises.push(this.elementSvc.search(this.reqOb, queryOb))
+ promises.push(this.elementSvc.search(this.reqOb, queryOb));
}
this.$q
.all(promises)
.then(successRedirectFnc, this.errorHandler)
.finally(() => {
- redirectFnc()
- })
- }
+ redirectFnc();
+ });
+ };
},
-}
+};
-veApp.component(RedirectComponent.selector, RedirectComponent)
+veApp.component(RedirectComponent.selector, RedirectComponent);
diff --git a/src/ve-app/login/select.component.ts b/src/ve-app/login/select.component.ts
index 95af036a8..1486acad5 100644
--- a/src/ve-app/login/select.component.ts
+++ b/src/ve-app/login/select.component.ts
@@ -1,16 +1,16 @@
-import { StateService, TransitionService, UIRouter, UIRouterGlobals } from '@uirouter/angularjs'
-import { IComponentController } from 'angular'
-import Rx from 'rx-lite'
+import { StateService, TransitionService, UIRouter, UIRouterGlobals } from '@uirouter/angularjs';
+import { IComponentController } from 'angular';
+import Rx from 'rx-lite';
-import { BrandingStyle, RootScopeService } from '@ve-utils/application'
-import { EventService } from '@ve-utils/core'
-import { ProjectService, AuthService } from '@ve-utils/mms-api-client'
+import { BrandingStyle, RootScopeService } from '@ve-utils/application';
+import { EventService } from '@ve-utils/core';
+import { ProjectService, AuthService } from '@ve-utils/mms-api-client';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { VeComponentOptions } from '@ve-types/angular'
-import { OrgObject, ParamsObject, ProjectObject } from '@ve-types/mms'
-import { VeStorageService } from '@ve-types/view-editor'
+import { VeComponentOptions } from '@ve-types/angular';
+import { OrgObject, ParamsObject, ProjectObject } from '@ve-types/mms';
+import { VeStorageService } from '@ve-types/view-editor';
class SelectController implements IComponentController {
static $inject = [
@@ -23,33 +23,33 @@ class SelectController implements IComponentController {
'AuthService',
'RootScopeService',
'EventService',
- ]
+ ];
//injectables
- private $uiRouterGlobals: UIRouterGlobals = this.$uiRouter.globals
- public subs: Rx.IDisposable[]
+ private $uiRouterGlobals: UIRouterGlobals = this.$uiRouter.globals;
+ public subs: Rx.IDisposable[];
//Bindings
- public mmsOrgs: OrgObject[]
- mmsLoginBanner: BrandingStyle
- mmsProjects: ProjectObject[]
+ public mmsOrgs: OrgObject[];
+ mmsLoginBanner: BrandingStyle;
+ mmsProjects: ProjectObject[];
//local
- public redirect_from_old: boolean
- pageTitle: string
- fromLogin: boolean
- spin: boolean = false
- logout_spin: boolean = false
- orgs: OrgObject[]
- projects: ProjectObject[]
- orgId: string
- projectId: string
- selectedOrg: string
- selectedProject: string
- loginBanner: BrandingStyle
- protected orgSpin: boolean
- protected projSpin: boolean
- protected bannerSpin: boolean
+ public redirect_from_old: boolean;
+ pageTitle: string;
+ fromLogin: boolean;
+ spin: boolean = false;
+ logout_spin: boolean = false;
+ orgs: OrgObject[];
+ projects: ProjectObject[];
+ orgId: string;
+ projectId: string;
+ selectedOrg: string;
+ selectedProject: string;
+ loginBanner: BrandingStyle;
+ protected orgSpin: boolean;
+ protected projSpin: boolean;
+ protected bannerSpin: boolean;
constructor(
private $uiRouter: UIRouter,
@@ -64,143 +64,143 @@ class SelectController implements IComponentController {
) {}
$onInit(): void {
- this.rootScopeSvc.veShowLogin(true)
+ this.rootScopeSvc.veShowLogin(true);
if (!this.mmsLoginBanner) {
this.mmsLoginBanner = {
labels: ['Select Desired Org/Project Above'],
disabled: false,
- }
+ };
}
- this.loginBanner = this.mmsLoginBanner
+ this.loginBanner = this.mmsLoginBanner;
- this.eventSvc.$init(this)
- this.rootScopeSvc.veTitle('View Editor') //what to name this?
- this.redirect_from_old = this.rootScopeSvc.veRedirectFromOld()
+ this.eventSvc.$init(this);
+ this.rootScopeSvc.veTitle('View Editor'); //what to name this?
+ this.redirect_from_old = this.rootScopeSvc.veRedirectFromOld();
this.subs.push(
this.eventSvc.binding(this.rootScopeSvc.constants.VEREDIRECTFROMOLD, (data: boolean) => {
- this.redirect_from_old = data
+ this.redirect_from_old = data;
})
- )
- this.rootScopeSvc.veTitle('Projects')
- this.pageTitle = 'View Editor'
- this.fromLogin = (this.$uiRouterGlobals.params as ParamsObject).fromLogin
- this.$localStorage.$default({ org: this.mmsOrgs[0] })
- this.orgs = this.mmsOrgs
+ );
+ this.rootScopeSvc.veTitle('Projects');
+ this.pageTitle = 'View Editor';
+ this.fromLogin = (this.$uiRouterGlobals.params as ParamsObject).fromLogin;
+ this.$localStorage.$default({ org: this.mmsOrgs[0] });
+ this.orgs = this.mmsOrgs;
if (this.$localStorage.org) {
- this.selectOrg(this.$localStorage.org)
+ this.selectOrg(this.$localStorage.org);
}
}
public selectOrg = (org: OrgObject): void => {
if (org) {
- this.$localStorage.org = org
- this.orgId = org.id
- this.$localStorage.org.orgName = org.name
- this.selectedOrg = this.$localStorage.org.name
- this.selectedProject = '$resolve.Ob' // default here?
+ this.$localStorage.org = org;
+ this.orgId = org.id;
+ this.$localStorage.org.orgName = org.name;
+ this.selectedOrg = this.$localStorage.org.name;
+ this.selectedProject = '$resolve.Ob'; // default here?
this.projectSvc.getProjects(this.orgId).then(
(data) => {
- this.projects = data
+ this.projects = data;
if (data && data.length > 0) {
if (this.$localStorage.project && this.checkForProject(data, this.$localStorage.project)) {
- this.selectedProject = this.$localStorage.project.name
- this.projectId = this.$localStorage.project.id
+ this.selectedProject = this.$localStorage.project.name;
+ this.projectId = this.$localStorage.project.id;
} else {
- this.selectProject(data[0])
+ this.selectProject(data[0]);
}
}
},
(reason) => {
- this.growl.error('Error getting project data: ' + reason.message)
+ this.growl.error('Error getting project data: ' + reason.message);
}
- )
+ );
}
- }
+ };
public selectProject = (project: ProjectObject): void => {
if (project) {
- this.$localStorage.project = project
- this.selectedProject = this.$localStorage.project.name
- this.projectId = this.$localStorage.project.id
+ this.$localStorage.project = project;
+ this.selectedProject = this.$localStorage.project.name;
+ this.projectId = this.$localStorage.project.id;
}
- }
+ };
public refreshOrgs = (): void => {
- this.orgSpin = true
- this.orgs.length = 0
+ this.orgSpin = true;
+ this.orgs.length = 0;
this.projectSvc
.getOrgs(true)
.then((data) => {
- this.orgs.push(...data)
+ this.orgs.push(...data);
})
.finally(() => {
- this.orgSpin = false
- })
- }
+ this.orgSpin = false;
+ });
+ };
public refreshProjects = (): void => {
- this.projSpin = true
- this.projects.length = 0
+ this.projSpin = true;
+ this.projects.length = 0;
this.projectSvc
.getProjects(this.orgId, true)
.then((data) => {
- this.projects.push(...data)
+ this.projects.push(...data);
if (
data &&
data.length > 0 &&
this.projects.filter((p) => {
- return p.id === this.projectId
+ return p.id === this.projectId;
}).length === 0
) {
- this.selectProject(data[0])
+ this.selectProject(data[0]);
} else {
//no projects
}
})
.finally(() => {
- this.projSpin = false
- })
- }
+ this.projSpin = false;
+ });
+ };
public checkForProject(projectArray: ProjectObject[], project: ProjectObject): boolean {
for (let i = 0; i < projectArray.length; i++) {
if (projectArray[i].id === project.id) {
- return true
+ return true;
}
}
- return false
+ return false;
}
public continue = (): void => {
if (this.orgId && this.projectId) {
- this.spin = true
- this.rootScopeSvc.veRedirectFromOld(false)
+ this.spin = true;
+ this.rootScopeSvc.veRedirectFromOld(false);
void this.$state
.go('main.project.ref.portal', {
orgId: this.orgId,
projectId: this.projectId,
refId: 'master',
})
- .finally(() => (this.spin = false))
+ .finally(() => (this.spin = false));
}
- }
+ };
public logout = (): void => {
- this.logout_spin = true
+ this.logout_spin = true;
this.authSvc
.logout()
.then(
() => {
- void this.$state.go('main.login', {})
+ void this.$state.go('main.login', {});
},
() => {
- this.growl.error('You were not logged out')
+ this.growl.error('You were not logged out');
}
)
.finally(() => {
- this.logout_spin = false
- })
- }
+ this.logout_spin = false;
+ });
+ };
}
const SelectComponent: VeComponentOptions = {
@@ -277,6 +277,6 @@ const SelectComponent: VeComponentOptions = {
mmsLoginBanner: '<',
},
controller: SelectController,
-}
+};
-veApp.component(SelectComponent.selector, SelectComponent)
+veApp.component(SelectComponent.selector, SelectComponent);
diff --git a/src/ve-app/login/short-url.component.ts b/src/ve-app/login/short-url.component.ts
index cff63aed3..19efa5273 100644
--- a/src/ve-app/login/short-url.component.ts
+++ b/src/ve-app/login/short-url.component.ts
@@ -1,13 +1,13 @@
-import { StateService } from '@uirouter/angularjs'
-import { IComponentController } from 'angular'
-import Rx from 'rx-lite'
+import { StateService } from '@uirouter/angularjs';
+import { IComponentController } from 'angular';
+import Rx from 'rx-lite';
-import { RootScopeService, ShortUrlService } from '@ve-utils/application'
+import { RootScopeService, ShortUrlService } from '@ve-utils/application';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { VeComponentOptions } from '@ve-types/angular'
-import { ParamsObject } from '@ve-types/mms'
+import { VeComponentOptions } from '@ve-types/angular';
+import { ParamsObject } from '@ve-types/mms';
const ShortUrlComponent: VeComponentOptions = {
selector: 'shortUrl',
@@ -29,15 +29,15 @@ const ShortUrlComponent: VeComponentOptions = {
paramsOb: '<',
},
controller: class ShortUrlController implements IComponentController {
- private paramsOb: ParamsObject
- public subs: Rx.IDisposable[]
+ private paramsOb: ParamsObject;
+ public subs: Rx.IDisposable[];
- decodedUrl: ParamsObject
- redirect_noResults: boolean = false
- spin: boolean = true
- error: string = ''
+ decodedUrl: ParamsObject;
+ redirect_noResults: boolean = false;
+ spin: boolean = true;
+ error: string = '';
- static $inject = ['$state', 'growl', 'ShortUrlService', 'RootScopeService']
+ static $inject = ['$state', 'growl', 'ShortUrlService', 'RootScopeService'];
constructor(
private $state: StateService,
@@ -47,45 +47,45 @@ const ShortUrlComponent: VeComponentOptions = {
) {}
$onInit(): void {
- this.rootScopeSvc.veTitle('Redirecting... | View Editor') //what to name this?
+ this.rootScopeSvc.veTitle('Redirecting... | View Editor'); //what to name this?
if (this.paramsOb && this.paramsOb.shortUrl) {
this.shortUrlSvc.decodeShortUrl(this.paramsOb.shortUrl).then(
(result) => {
- this.decodedUrl = result
+ this.decodedUrl = result;
if (this.decodedUrl.viewId) {
- void this.$state.go('main.project.ref.view.present', this.decodedUrl)
- return
+ void this.$state.go('main.project.ref.view.present', this.decodedUrl);
+ return;
}
if (this.decodedUrl.documentId) {
- void this.$state.go('main.project.ref.view.present', this.decodedUrl)
- return
+ void this.$state.go('main.project.ref.view.present', this.decodedUrl);
+ return;
}
if (this.decodedUrl.refId) {
- void this.$state.go('main.project.ref.portal', this.decodedUrl)
- return
+ void this.$state.go('main.project.ref.portal', this.decodedUrl);
+ return;
}
if (this.decodedUrl.projectId) {
- void this.$state.go('main.project.refs', this.decodedUrl)
- return
+ void this.$state.go('main.project.refs', this.decodedUrl);
+ return;
}
},
(reason) => {
- this.spin = false
- this.redirect_noResults = true
- this.growl.error(reason.message)
+ this.spin = false;
+ this.redirect_noResults = true;
+ this.growl.error(reason.message);
}
- )
+ );
} else {
- this.spin = false
- this.redirect_noResults = true
- this.growl.error('No short URL found.')
+ this.spin = false;
+ this.redirect_noResults = true;
+ this.growl.error('No short URL found.');
}
}
public resetSelectPage = (): void => {
- void this.$state.go('main.login.select')
- }
+ void this.$state.go('main.login.select');
+ };
},
-}
+};
-veApp.component(ShortUrlComponent.selector, ShortUrlComponent)
+veApp.component(ShortUrlComponent.selector, ShortUrlComponent);
diff --git a/src/ve-app/main/components/index.ts b/src/ve-app/main/components/index.ts
index 71f2bf476..71aed639d 100644
--- a/src/ve-app/main/components/index.ts
+++ b/src/ve-app/main/components/index.ts
@@ -1,4 +1,4 @@
-import './system-footer.component'
-import './main-menu.component'
-import './nav-bar.component'
-import './system-banner.component'
+import './system-footer.component';
+import './main-menu.component';
+import './nav-bar.component';
+import './system-banner.component';
diff --git a/src/ve-app/main/components/main-menu.component.ts b/src/ve-app/main/components/main-menu.component.ts
index 85b075a77..0e33fca29 100644
--- a/src/ve-app/main/components/main-menu.component.ts
+++ b/src/ve-app/main/components/main-menu.component.ts
@@ -1,55 +1,55 @@
-import { StateService, TransitionService, UIRouterGlobals } from '@uirouter/angularjs'
-import angular, { IComponentController } from 'angular'
+import { StateService, TransitionService, UIRouterGlobals } from '@uirouter/angularjs';
+import angular, { IComponentController } from 'angular';
-import { ApplicationService, RootScopeService, UtilsService } from '@ve-utils/application'
-import { EventService } from '@ve-utils/core'
-import { onChangesCallback } from '@ve-utils/utils'
+import { ApplicationService, RootScopeService, UtilsService } from '@ve-utils/application';
+import { EventService } from '@ve-utils/core';
+import { onChangesCallback } from '@ve-utils/utils';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { VeComponentOptions, VeQService } from '@ve-types/angular'
-import { DocumentObject, GroupObject, ParamsObject, ProjectObject, RefObject, ViewObject } from '@ve-types/mms'
+import { VeComponentOptions, VeQService } from '@ve-types/angular';
+import { DocumentObject, GroupObject, ParamsObject, ProjectObject, RefObject, ViewObject } from '@ve-types/mms';
interface BreadcrumbObject {
- name: string
- id: string
- type: string
- link: string
+ name: string;
+ id: string;
+ type: string;
+ link: string;
}
class MenuController implements IComponentController {
//bindings
- public params: ParamsObject
- public mmsProject: ProjectObject
- public mmsProjects: ProjectObject[]
- public mmsGroup: GroupObject
- public mmsGroups: GroupObject[]
- public mmsRef: RefObject
- public mmsRefs: RefObject[]
- public mmsDocument: DocumentObject
+ public params: ParamsObject;
+ public mmsProject: ProjectObject;
+ public mmsProjects: ProjectObject[];
+ public mmsGroup: GroupObject;
+ public mmsGroups: GroupObject[];
+ public mmsRef: RefObject;
+ public mmsRefs: RefObject[];
+ public mmsDocument: DocumentObject;
//Locals
- spin: boolean
- public child: DocumentObject | GroupObject
- crumbs: BreadcrumbObject[] = []
- groups: GroupObject[]
- projects: ProjectObject[]
- refs: RefObject[]
- tags: RefObject[]
- document: DocumentObject
- view: ViewObject
+ spin: boolean;
+ public child: DocumentObject | GroupObject;
+ crumbs: BreadcrumbObject[] = [];
+ groups: GroupObject[];
+ projects: ProjectObject[];
+ refs: RefObject[];
+ tags: RefObject[];
+ document: DocumentObject;
+ view: ViewObject;
groupsMap: {
- [id: string]: { id: string; name: string; parentId: string }
- } = {}
- isRefsView: boolean = false
- public htmlTooltip
- public currentProject: string
- public currentRef: RefObject
- public currentBranch: string
- public currentTag: string
- public breadcrumbs: BreadcrumbObject[]
- public truncateStyle
- public subs: Rx.IDisposable[]
+ [id: string]: { id: string; name: string; parentId: string };
+ } = {};
+ isRefsView: boolean = false;
+ public htmlTooltip;
+ public currentProject: string;
+ public currentRef: RefObject;
+ public currentBranch: string;
+ public currentTag: string;
+ public breadcrumbs: BreadcrumbObject[];
+ public truncateStyle;
+ public subs: Rx.IDisposable[];
static $inject = [
'$q',
@@ -62,7 +62,7 @@ class MenuController implements IComponentController {
'UtilsService',
'RootScopeService',
'EventService',
- ]
+ ];
constructor(
public $q: VeQService,
private $uiRouterGlobals: UIRouterGlobals,
@@ -75,77 +75,77 @@ class MenuController implements IComponentController {
private rootScopeSvc: RootScopeService,
public eventSvc: EventService
) {
- this.htmlTooltip = 'Branch temporarily unavailable during duplication.'
+ this.htmlTooltip = 'Branch temporarily unavailable during duplication.';
}
$onInit(): void {
- this.eventSvc.$init(this)
- this.projects = this.mmsProjects
- this.groups = this.mmsGroups
- this.refs = this.mmsRefs
+ this.eventSvc.$init(this);
+ this.projects = this.mmsProjects;
+ this.groups = this.mmsGroups;
+ this.refs = this.mmsRefs;
if (this.mmsProject && !this.currentProject) {
- this.currentProject = this.mmsProject.name
+ this.currentProject = this.mmsProject.name;
}
if (this.mmsRef && !this.currentRef) {
- this.currentRef = this.mmsRef
+ this.currentRef = this.mmsRef;
if (this.mmsRef.type === 'Branch') {
- this.currentBranch = this.mmsRef.name
+ this.currentBranch = this.mmsRef.name;
} else if (this.mmsRef.type === 'Tag') {
- this.currentTag = this.mmsRef.name
+ this.currentTag = this.mmsRef.name;
}
}
this.tags = this.mmsRefs.filter((ref) => {
- return ref.type === 'Tag'
- })
- this.updateGroups()
+ return ref.type === 'Tag';
+ });
+ this.updateGroups();
this.$transitions.onSuccess({}, () => {
- this.spin = true
- this.updateBreadcrumbs()
- })
+ this.spin = true;
+ this.updateBreadcrumbs();
+ });
}
updateGroups: onChangesCallback = () => {
- this.groupsMap = {}
- this.spin = true
+ this.groupsMap = {};
+ this.spin = true;
if (typeof this.mmsGroups !== 'undefined') {
- this.groups = this.mmsGroups
+ this.groups = this.mmsGroups;
for (let i = 0; i < this.groups.length; i++) {
this.groupsMap[this.groups[i].id] = {
id: this.groups[i].id,
name: this.groups[i].name,
parentId: this.groups[i]._parentId,
- }
+ };
}
- this.updateBreadcrumbs()
+ this.updateBreadcrumbs();
} else {
- this.updateBreadcrumbs()
+ this.updateBreadcrumbs();
}
- }
+ };
public updateBreadcrumbs: onChangesCallback = () => {
- let parentId = ''
- let oldChild = null
- if (this.child) oldChild = this.child
+ let parentId = '';
+ let oldChild = null;
+ if (this.child) oldChild = this.child;
if (this.mmsDocument) {
- this.child = this.mmsDocument
- this.rootScopeSvc.veTitle(this.mmsDocument.name)
+ this.child = this.mmsDocument;
+ this.rootScopeSvc.veTitle(this.mmsDocument.name);
} else if (this.mmsGroup) {
- this.rootScopeSvc.veTitle(this.mmsGroup.name)
- this.child = this.mmsGroup
+ this.rootScopeSvc.veTitle(this.mmsGroup.name);
+ this.child = this.mmsGroup;
} else {
- this.rootScopeSvc.veTitle(this.currentProject)
+ this.rootScopeSvc.veTitle(this.currentProject);
}
// Check for Refs View, Skip the rest if it is
if (this.$state.includes('main.project.ref.refs')) {
- this.isRefsView = true
- return
+ this.isRefsView = true;
+ return;
}
if (this.child && this.child != oldChild) {
- this.crumbs = []
+ this.crumbs = [];
if (this.child.type === 'Package') {
//child.hasOwnProperty('_id')) {
this.crumbs.push({
@@ -153,9 +153,9 @@ class MenuController implements IComponentController {
id: this.child.id,
type: 'group',
link: "main.project.ref.portal.preview({preview: 'site_' + breadcrumb.id + '_cover', keywords: undefined})",
- })
+ });
if (this.child._parentId) {
- parentId = (this.child as GroupObject)._parentId
+ parentId = (this.child as GroupObject)._parentId;
}
} else {
this.crumbs.push({
@@ -163,41 +163,41 @@ class MenuController implements IComponentController {
id: this.child.id,
type: 'doc',
link: 'main.project.ref.view.present({documentId: breadcrumb.id, keywords: undefined})',
- })
+ });
if (this.child._groupId) {
- parentId = (this.child as DocumentObject)._groupId
+ parentId = (this.child as DocumentObject)._groupId;
}
}
if (parentId) {
while (this.groupsMap[parentId] !== undefined) {
- const id = this.groupsMap[parentId].id
+ const id = this.groupsMap[parentId].id;
this.crumbs.push({
name: this.groupsMap[id].name,
id: id,
type: 'group',
link: "main.project.ref.portal.preview({preview: 'site_' + breadcrumb.id + '_cover', keywords: undefined})",
- })
- parentId = this.groupsMap[id].parentId
+ });
+ parentId = this.groupsMap[id].parentId;
}
}
- this.breadcrumbs = this.crumbs.reverse()
+ this.breadcrumbs = this.crumbs.reverse();
void this.$timeout(() => {
- const eltChildren = this.$element.children().children()
- const eltParent = this.$element.parent()[0]
- const eltWidth = eltParent.clientWidth - eltChildren[1].scrollWidth - eltChildren[3].scrollWidth
- const crumbcount = this.breadcrumbs.length
- const liWidth = (eltWidth * 0.85) / crumbcount
+ const eltChildren = this.$element.children().children();
+ const eltParent = this.$element.parent()[0];
+ const eltWidth = eltParent.clientWidth - eltChildren[1].scrollWidth - eltChildren[3].scrollWidth;
+ const crumbcount = this.breadcrumbs.length;
+ const liWidth = (eltWidth * 0.85) / crumbcount;
this.truncateStyle = {
'max-width': liWidth,
'white-space': 'nowrap',
overflow: 'hidden',
'text-overflow': 'ellipsis',
display: 'inline-block',
- }
- })
+ };
+ });
}
- this.spin = false
- }
+ this.spin = false;
+ };
updateProject(project: ProjectObject): void {
if (project) {
@@ -209,7 +209,7 @@ class MenuController implements IComponentController {
keywords: undefined,
},
{ reload: true }
- )
+ );
}
}
@@ -223,7 +223,7 @@ class MenuController implements IComponentController {
keywords: undefined,
},
{ reload: true }
- )
+ );
}
}
@@ -232,14 +232,14 @@ class MenuController implements IComponentController {
'main.project.ref.refs',
{ projectId: this.params.projectId, refId: this.params.refId },
{ reload: true }
- )
+ );
}
goHome(): void {
void this.$state.go('main.project.ref.portal', {
field: undefined,
keywords: undefined,
- })
+ });
}
}
@@ -328,6 +328,6 @@ const MainMenuComponent: VeComponentOptions = {
mmsDocument: '<',
},
controller: MenuController,
-}
+};
-veApp.component(MainMenuComponent.selector, MainMenuComponent)
+veApp.component(MainMenuComponent.selector, MainMenuComponent);
diff --git a/src/ve-app/main/components/nav-bar.component.ts b/src/ve-app/main/components/nav-bar.component.ts
index 141a68bcc..291fb2ff1 100644
--- a/src/ve-app/main/components/nav-bar.component.ts
+++ b/src/ve-app/main/components/nav-bar.component.ts
@@ -1,15 +1,15 @@
-import { StateService, UIRouter } from '@uirouter/angularjs'
+import { StateService, UIRouter } from '@uirouter/angularjs';
-import { SelectModalResolveFn } from '@ve-app/main/modals/select-modal.component'
-import { RootScopeService } from '@ve-utils/application'
-import { EventService } from '@ve-utils/core'
-import { AuthService, UserService } from '@ve-utils/mms-api-client'
+import { SelectModalResolveFn } from '@ve-app/main/modals/select-modal.component';
+import { RootScopeService } from '@ve-utils/application';
+import { EventService } from '@ve-utils/core';
+import { AuthService, UserService } from '@ve-utils/mms-api-client';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { VeComponentOptions } from '@ve-types/angular'
-import { OrgObject, ProjectObject, RefObject, UserObject } from '@ve-types/mms'
-import { VeModalService, VeModalSettings } from '@ve-types/view-editor'
+import { VeComponentOptions } from '@ve-types/angular';
+import { OrgObject, ProjectObject, RefObject, UserObject } from '@ve-types/mms';
+import { VeModalService, VeModalSettings } from '@ve-types/view-editor';
class NavBarController implements angular.IComponentController {
static $inject = [
@@ -24,32 +24,32 @@ class NavBarController implements angular.IComponentController {
'UserService',
'EventService',
'RootScopeService',
- ]
+ ];
//bindings
- public mmsOrg: OrgObject
- public mmsProject: ProjectObject
- public mmsProjects: ProjectObject[]
- public mmsRef: RefObject
- public mmsOrgs: OrgObject[]
+ public mmsOrg: OrgObject;
+ public mmsProject: ProjectObject;
+ public mmsProjects: ProjectObject[];
+ public mmsRef: RefObject;
+ public mmsOrgs: OrgObject[];
//injectables
- public subs: Rx.IDisposable[]
+ public subs: Rx.IDisposable[];
//local
- public isNavCollapsed: boolean
- public about: string
- public searchClass: string
- public username: string
- public user: UserObject
- public userBadge: string
-
- protected showSearch: boolean = true
- private project: ProjectObject
- private org: OrgObject
- private ref: RefObject
- private projects: ProjectObject[]
- private orgs: OrgObject[]
+ public isNavCollapsed: boolean;
+ public about: string;
+ public searchClass: string;
+ public username: string;
+ public user: UserObject;
+ public userBadge: string;
+
+ protected showSearch: boolean = true;
+ private project: ProjectObject;
+ private org: OrgObject;
+ private ref: RefObject;
+ private projects: ProjectObject[];
+ private orgs: OrgObject[];
constructor(
private $uiRouter: UIRouter,
@@ -64,44 +64,44 @@ class NavBarController implements angular.IComponentController {
private eventSvc: EventService,
private rootScopeSvc: RootScopeService
) {
- this.isNavCollapsed = true
+ this.isNavCollapsed = true;
- this.searchClass = ''
+ this.searchClass = '';
}
$onInit(): void {
- this.eventSvc.$init(this)
+ this.eventSvc.$init(this);
- this.project = this.mmsProject
- this.ref = this.mmsRef
- this.org = this.mmsOrg
+ this.project = this.mmsProject;
+ this.ref = this.mmsRef;
+ this.org = this.mmsOrg;
- this.showSearch = !this.$state.includes('**.search.**')
+ this.showSearch = !this.$state.includes('**.search.**');
void this.authSvc.checkLogin().then(
(data) => {
- this.username = data.username
+ this.username = data.username;
this.userSvc.getUserData(data.username).then(
(userData) => {
- this.user = userData
+ this.user = userData;
if (this.user.firstName) {
- this.userBadge = this.user.firstName.substring(0, 1).toUpperCase()
- this.userBadge += this.user.lastName.substring(0, 1).toUpperCase()
+ this.userBadge = this.user.firstName.substring(0, 1).toUpperCase();
+ this.userBadge += this.user.lastName.substring(0, 1).toUpperCase();
} else {
this.userBadge = this.user.username
? this.user.username.substring(0, 2).toUpperCase()
- : 'VE'
+ : 'VE';
}
},
() => {
- this.userBadge = this.username.substring(0, 1).toUpperCase()
+ this.userBadge = this.username.substring(0, 1).toUpperCase();
}
- )
+ );
},
() => {
- this.eventSvc.$broadcast('mms.unauthorized')
+ this.eventSvc.$broadcast('mms.unauthorized');
}
- )
+ );
}
updateOrg(): void {
@@ -110,56 +110,56 @@ class NavBarController implements angular.IComponentController {
windowClass: 've-dropdown-short-modal',
resolve: {
mmsOrgs: () => {
- return this.mmsOrgs
+ return this.mmsOrgs;
},
mmsOrg: () => {
- return this.org
+ return this.org;
},
mmsProjects: () => {
- return this.mmsProjects
+ return this.mmsProjects;
},
mmsProject: () => {
- return this.project
+ return this.project;
},
},
- }
- this.$uibModal.open(settings)
+ };
+ this.$uibModal.open(settings);
}
toggleHelp(): void {
- this.hotkeys.toggleCheatSheet()
+ this.hotkeys.toggleCheatSheet();
}
toggleAbout(): void {
this.$uibModal.open({
component: 'aboutModal',
- })
+ });
}
logout(): void {
this.authSvc.logout().then(
() => {
- void this.$state.go('main.login')
+ void this.$state.go('main.login');
},
() => {
- this.growl.error('You were not logged out')
+ this.growl.error('You were not logged out');
}
- )
+ );
}
search(searchText: string): void {
if (this.$state.includes('main.project.ref.view.reorder')) {
- this.growl.warning('Please finish reorder action first.')
- return
+ this.growl.warning('Please finish reorder action first.');
+ return;
// } else if ($state.includes('main.project.diff')) {
// growl.warning("Please finish diff action first.");
// return;
} else {
- this.searchClass = 'fa fa-spin fa-spinner'
+ this.searchClass = 'fa fa-spin fa-spinner';
void this.$state.go('main.project.ref.search', {
keywords: searchText,
field: 'name',
- })
+ });
}
}
}
@@ -214,7 +214,7 @@ const NavBarComponent: VeComponentOptions = {
View Editor Help
- Report Issue
+ Report Issue
@@ -245,6 +245,6 @@ const NavBarComponent: VeComponentOptions = {
`,
controller: NavBarController,
-}
+};
-veApp.component(NavBarComponent.selector, NavBarComponent)
+veApp.component(NavBarComponent.selector, NavBarComponent);
diff --git a/src/ve-app/main/components/system-banner.component.ts b/src/ve-app/main/components/system-banner.component.ts
index 6da0f2fab..5ee0cce56 100644
--- a/src/ve-app/main/components/system-banner.component.ts
+++ b/src/ve-app/main/components/system-banner.component.ts
@@ -1,10 +1,10 @@
-import { IComponentController } from 'angular'
+import { IComponentController } from 'angular';
-import { BrandingStyle } from '@ve-utils/application'
+import { BrandingStyle } from '@ve-utils/application';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { VeComponentOptions } from '@ve-types/angular'
+import { VeComponentOptions } from '@ve-types/angular';
const SystemBannerComponent: VeComponentOptions = {
selector: 'systemBanner',
@@ -23,20 +23,20 @@ const SystemBannerComponent: VeComponentOptions = {
mmsBanner: '<',
},
controller: class SystemBannerController implements IComponentController {
- public mmsBanner: BrandingStyle
+ public mmsBanner: BrandingStyle;
- public disabled: boolean
- public loading: boolean
- public bannerMessage: string[] = ['Loading...']
+ public disabled: boolean;
+ public loading: boolean;
+ public bannerMessage: string[] = ['Loading...'];
$onInit(): void {
- this.loading = true
- if (Array.isArray(this.mmsBanner.message)) this.bannerMessage = this.mmsBanner.message
- else this.bannerMessage = [this.mmsBanner.message]
- this.disabled = this.mmsBanner.disabled ? this.mmsBanner.disabled : false
- this.loading = false
+ this.loading = true;
+ if (Array.isArray(this.mmsBanner.message)) this.bannerMessage = this.mmsBanner.message;
+ else this.bannerMessage = [this.mmsBanner.message];
+ this.disabled = this.mmsBanner.disabled ? this.mmsBanner.disabled : false;
+ this.loading = false;
}
},
-}
+};
-veApp.component(SystemBannerComponent.selector, SystemBannerComponent)
+veApp.component(SystemBannerComponent.selector, SystemBannerComponent);
diff --git a/src/ve-app/main/components/system-footer.component.ts b/src/ve-app/main/components/system-footer.component.ts
index c2aeacaf2..c8c82fec7 100644
--- a/src/ve-app/main/components/system-footer.component.ts
+++ b/src/ve-app/main/components/system-footer.component.ts
@@ -1,10 +1,10 @@
-import { IComponentController } from 'angular'
+import { IComponentController } from 'angular';
-import { BrandingStyle } from '@ve-utils/application'
+import { BrandingStyle } from '@ve-utils/application';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { VeComponentOptions } from '@ve-types/angular'
+import { VeComponentOptions } from '@ve-types/angular';
const SystemFooterComponent: VeComponentOptions = {
selector: 'systemFooter',
@@ -21,20 +21,20 @@ const SystemFooterComponent: VeComponentOptions = {
mmsFooter: '<',
},
controller: class FooterController implements IComponentController {
- private mmsFooter: BrandingStyle
+ private mmsFooter: BrandingStyle;
- public disabled: boolean
- public loading: boolean
- public footerMessage: string | string[]
+ public disabled: boolean;
+ public loading: boolean;
+ public footerMessage: string | string[];
$onInit(): void {
- this.loading = true
- if (Array.isArray(this.mmsFooter.message)) this.footerMessage = this.mmsFooter.message
- else this.footerMessage = [this.mmsFooter.message]
- this.disabled = this.mmsFooter.disabled ? this.mmsFooter.disabled : false
- this.loading = false
+ this.loading = true;
+ if (Array.isArray(this.mmsFooter.message)) this.footerMessage = this.mmsFooter.message;
+ else this.footerMessage = [this.mmsFooter.message];
+ this.disabled = this.mmsFooter.disabled ? this.mmsFooter.disabled : false;
+ this.loading = false;
}
},
-}
+};
-veApp.component(SystemFooterComponent.selector, SystemFooterComponent)
+veApp.component(SystemFooterComponent.selector, SystemFooterComponent);
diff --git a/src/ve-app/main/index.ts b/src/ve-app/main/index.ts
index 99c0bb5bd..a0c5f837b 100644
--- a/src/ve-app/main/index.ts
+++ b/src/ve-app/main/index.ts
@@ -1,6 +1,6 @@
-import './main.component'
+import './main.component';
-import './services'
+import './services';
-import './modals'
-import './components'
+import './modals';
+import './components';
diff --git a/src/ve-app/main/main.component.ts b/src/ve-app/main/main.component.ts
index 5126ac547..7a3d97294 100644
--- a/src/ve-app/main/main.component.ts
+++ b/src/ve-app/main/main.component.ts
@@ -1,20 +1,20 @@
-import 'angular-growl-v2'
+import 'angular-growl-v2';
-import { StateService, Transition, TransitionService, UIRouter, UIRouterGlobals } from '@uirouter/angularjs'
-import angular, { IComponentController, IHttpResponse } from 'angular'
-import Rx from 'rx-lite'
+import { StateService, Transition, TransitionService, UIRouter, UIRouterGlobals } from '@uirouter/angularjs';
+import angular, { IComponentController, IHttpResponse } from 'angular';
+import Rx from 'rx-lite';
-import { WorkingTimeModalResolveFn, WorkingTimeObject } from '@ve-app/main/modals/working-modal.component'
-import { ApplicationService, RootScopeService } from '@ve-utils/application'
-import { EditService, EventService } from '@ve-utils/core'
-import { ApiService, AuthService, ElementService, HttpService, URLService } from '@ve-utils/mms-api-client'
+import { WorkingTimeModalResolveFn, WorkingTimeObject } from '@ve-app/main/modals/working-modal.component';
+import { ApplicationService, RootScopeService } from '@ve-utils/application';
+import { EditService, EventService } from '@ve-utils/core';
+import { ApiService, AuthService, ElementService, HttpService, URLService } from '@ve-utils/mms-api-client';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { VeComponentOptions } from '@ve-types/angular'
-import { VeConfig } from '@ve-types/config'
-import { ParamsObject } from '@ve-types/mms'
-import { VeModalService } from '@ve-types/view-editor'
+import { VeComponentOptions } from '@ve-types/angular';
+import { VeConfig } from '@ve-types/config';
+import { ParamsObject } from '@ve-types/mms';
+import { VeModalService } from '@ve-types/view-editor';
class MainController implements IComponentController {
static $inject = [
@@ -40,27 +40,27 @@ class MainController implements IComponentController {
'RootScopeService',
'EditService',
'EventService',
- ]
+ ];
//local
- public subs: Rx.IDisposable[]
- openEdits = {}
- readonly veConfig: VeConfig
+ public subs: Rx.IDisposable[];
+ openEdits = {};
+ readonly veConfig: VeConfig;
- private hidePanes: boolean = false
- private closePanes: boolean = false
- private hideRight: boolean = false
- private closeRight: boolean = false
- private hideLeft: boolean = false
- private closeLeft: boolean = false
- showManageRefs: boolean = false
- showLogin: boolean = true
- mmsWorkingTime: WorkingTimeObject
- workingModalOpen = false
+ private hidePanes: boolean = false;
+ private closePanes: boolean = false;
+ private hideRight: boolean = false;
+ private closeRight: boolean = false;
+ private hideLeft: boolean = false;
+ private closeLeft: boolean = false;
+ showManageRefs: boolean = false;
+ showLogin: boolean = true;
+ mmsWorkingTime: WorkingTimeObject;
+ workingModalOpen = false;
- readonly paneClosed: boolean = false
+ readonly paneClosed: boolean = false;
- $uiRouterGlobals: UIRouterGlobals = this.$uiRouter.globals
+ $uiRouterGlobals: UIRouterGlobals = this.$uiRouter.globals;
constructor(
private $scope: angular.IScope,
@@ -86,56 +86,56 @@ class MainController implements IComponentController {
private editSvc: EditService,
private eventSvc: EventService
) {
- this.veConfig = window.__env
+ this.veConfig = window.__env;
}
$onInit(): void {
- this.eventSvc.$init(this)
- this.rootScopeSvc.init()
+ this.eventSvc.$init(this);
+ this.rootScopeSvc.init();
this.subs.push(
this.eventSvc.binding(this.rootScopeSvc.constants.VETITLE, (value: string) => {
- this.$window.document.title = value + ' | View Editor'
+ this.$window.document.title = value + ' | View Editor';
})
- )
+ );
this.subs.push(
this.eventSvc.binding(this.rootScopeSvc.constants.VESHOWLOGIN, (value: boolean) => {
- this.showLogin = value
+ this.showLogin = value;
})
- )
+ );
this.subs.push(
this.eventSvc.binding(this.rootScopeSvc.constants.VEHIDEPANES, (value: boolean) => {
- this.hidePanes = value
+ this.hidePanes = value;
})
- )
+ );
this.subs.push(
this.eventSvc.binding(this.rootScopeSvc.constants.VEHIDELEFT, (value: boolean) => {
- this.hideLeft = value
+ this.hideLeft = value;
if (value) {
- this.closeLeft = true
+ this.closeLeft = true;
}
})
- )
+ );
this.subs.push(
this.eventSvc.binding(this.rootScopeSvc.constants.VEHIDERIGHT, (value: boolean) => {
- this.hideRight = value
+ this.hideRight = value;
if (value) {
- this.closeRight = true
+ this.closeRight = true;
}
})
- )
+ );
this.$window.addEventListener('beforeunload', (event) => {
if (this.editSvc.openEdits() > 0) {
- const message = 'You may have unsaved changes, are you sure you want to leave?'
- event.returnValue = message
- return message
+ const message = 'You may have unsaved changes, are you sure you want to leave?';
+ event.returnValue = message;
+ return message;
}
- })
+ });
this.hotkeys
.bindTo(this.$scope)
@@ -143,7 +143,7 @@ class MainController implements IComponentController {
combo: 'alt+m',
description: 'close all messages',
callback: () => {
- this.growlMessages.destroyAllMessages()
+ this.growlMessages.destroyAllMessages();
},
})
.add({
@@ -152,32 +152,32 @@ class MainController implements IComponentController {
callback: () => {
// TODO: Something here?
},
- })
+ });
this.subs.push(
this.eventSvc.$on('mms.working', (response: IHttpResponse) => {
- this.rootScopeSvc.veViewContentLoading(false)
+ this.rootScopeSvc.veViewContentLoading(false);
if (this.workingModalOpen) {
- return
+ return;
}
- this.mmsWorkingTime = response.data
- this.workingModalOpen = true
+ this.mmsWorkingTime = response.data;
+ this.workingModalOpen = true;
this.$uibModal
.open({
component: 'workingModal',
backdrop: true,
resolve: {
getWorkingTime: () => {
- return this.mmsWorkingTime
+ return this.mmsWorkingTime;
},
},
size: 'md',
})
.result.finally(() => {
- this.workingModalOpen = false
- })
+ this.workingModalOpen = false;
+ });
})
- )
+ );
// this.subs.push(
// this.eventSvc.$on('element.updated', (data: { element: ElementObject; continueEdit: boolean }) => {
@@ -202,32 +202,32 @@ class MainController implements IComponentController {
// )
this.$transitions.onStart({}, (trans) => {
- this.rootScopeSvc.veViewContentLoading(true)
- this.httpSvc.transformQueue()
- this.rootScopeSvc.veStateChanging(true)
- const from = trans.from().name
- const to = trans.to().name
+ this.rootScopeSvc.veViewContentLoading(true);
+ this.httpSvc.transformQueue();
+ this.rootScopeSvc.veStateChanging(true);
+ const from = trans.from().name;
+ const to = trans.to().name;
if (from.split('.').length >= to.split('.').length) {
- console.log(trans.router.viewService._pluginapi._activeViewConfigs())
+ console.log(trans.router.viewService._pluginapi._activeViewConfigs());
//Code to prune inactive previous leaf configs
//console.log(
trans.router.viewService._pluginapi
._activeViewConfigs()
.filter((vc) => {
- return from === vc.viewDecl.$context.name
+ return from === vc.viewDecl.$context.name;
})
.forEach((value) => {
- trans.router.viewService.deactivateViewConfig(value)
- })
- console.log(trans.router.viewService._pluginapi._activeViewConfigs())
+ trans.router.viewService.deactivateViewConfig(value);
+ });
+ console.log(trans.router.viewService._pluginapi._activeViewConfigs());
}
- })
+ });
this.$transitions.onError({}, (trans: Transition) => {
- this.rootScopeSvc.veStateChanging(false)
- this.rootScopeSvc.veViewContentLoading(false)
+ this.rootScopeSvc.veStateChanging(false);
+ this.rootScopeSvc.veViewContentLoading(false);
//check if error is ticket error
- const error: angular.IHttpResponse = trans.error().detail as angular.IHttpResponse
+ const error: angular.IHttpResponse = trans.error().detail as angular.IHttpResponse;
if (
!error ||
error.status === 401 ||
@@ -237,44 +237,44 @@ class MainController implements IComponentController {
error.config.url.indexOf('/authentication') !== -1)
) {
//check if 404 if checking valid ticket
- trans.abort()
+ trans.abort();
this.rootScopeSvc.veRedirect({
toState: trans.to(),
toParams: trans.params(),
- })
+ });
return this.$state.target('main.login', {
next: trans.$to().url,
- })
+ });
}
if (this.veConfig.enableDebug) {
this.growl.warning('Error: ' + trans.error().message, {
ttl: 1000,
- })
+ });
}
- })
+ });
this.$transitions.onSuccess({}, (trans: Transition) => {
- this.rootScopeSvc.veStateChanging(false)
+ this.rootScopeSvc.veStateChanging(false);
if (this.$uiRouterGlobals.$current.name === 'main.share') {
- this.rootScopeSvc.veHidePanes(true)
- this.rootScopeSvc.veShowLogin(true)
+ this.rootScopeSvc.veHidePanes(true);
+ this.rootScopeSvc.veShowLogin(true);
} else {
- this.rootScopeSvc.veHidePanes(false)
- this.rootScopeSvc.veShowLogin(false)
+ this.rootScopeSvc.veHidePanes(false);
+ this.rootScopeSvc.veShowLogin(false);
}
if (
this.rootScopeSvc.veRedirect() &&
this.$uiRouterGlobals.$current.name === this.rootScopeSvc.veRedirect().toState.name
) {
- this.rootScopeSvc.veRedirect(null)
+ this.rootScopeSvc.veRedirect(null);
}
if (this.$state.includes('main.login')) {
- this.rootScopeSvc.veHidePanes(true)
- this.rootScopeSvc.veShowLogin(true)
+ this.rootScopeSvc.veHidePanes(true);
+ this.rootScopeSvc.veShowLogin(true);
}
if (this.$state.includes('main.project.refs')) {
- this.rootScopeSvc.veHidePanes(true)
+ this.rootScopeSvc.veHidePanes(true);
}
// if (this.$state.includes('main.project.ref.portal')) {
// this.rootScopeSvc.treeInitialSelection(
@@ -316,19 +316,19 @@ class MainController implements IComponentController {
// )
// }
if (this.$state.includes('main.project.ref.view.present')) {
- this.applicationSvc.getState().inDoc = true
- this.applicationSvc.getState().currentDoc = (trans.params() as ParamsObject).documentId
+ this.applicationSvc.getState().inDoc = true;
+ this.applicationSvc.getState().currentDoc = (trans.params() as ParamsObject).documentId;
this.applicationSvc.getState().fullDoc = !!this.$state.includes(
'main.project.ref.view.present.document'
- )
+ );
} else {
- this.applicationSvc.getState().inDoc = false
- this.applicationSvc.getState().fullDoc = false
+ this.applicationSvc.getState().inDoc = false;
+ this.applicationSvc.getState().fullDoc = false;
}
- this.rootScopeSvc.veViewContentLoading(false)
+ this.rootScopeSvc.veViewContentLoading(false);
if (this.$state.includes('main.project.ref.view.present') && !(trans.params() as ParamsObject).display) {
- const display = trans.$to().name.split('.')[trans.$to().name.split('.').length]
- void this.$state.go(trans.$to().name, { display })
+ const display = trans.$to().name.split('.')[trans.$to().name.split('.').length];
+ void this.$state.go(trans.$to().name, { display });
}
if (
this.$state.includes('main.project.ref') &&
@@ -338,23 +338,23 @@ class MainController implements IComponentController {
) {
void this.$timeout(
() => {
- this.eventSvc.$broadcast('left-pane.toggle')
+ this.eventSvc.$broadcast('left-pane.toggle');
},
1,
false
- )
+ );
void this.$timeout(
() => {
- this.eventSvc.$broadcast('left-pane.toggle')
+ this.eventSvc.$broadcast('left-pane.toggle');
},
100,
false
- )
+ );
}
- })
+ });
if (this.$uiRouterGlobals.$current.name == 'main') {
- void this.$state.go('main.login')
+ void this.$state.go('main.login');
}
}
}
@@ -402,6 +402,6 @@ const MainComponent: VeComponentOptions = {
`,
controller: MainController,
-}
+};
-veApp.component(MainComponent.selector, MainComponent)
+veApp.component(MainComponent.selector, MainComponent);
diff --git a/src/ve-app/main/modals/about-modal.component.ts b/src/ve-app/main/modals/about-modal.component.ts
index 54b7bfc2d..fd54be0f8 100644
--- a/src/ve-app/main/modals/about-modal.component.ts
+++ b/src/ve-app/main/modals/about-modal.component.ts
@@ -1,11 +1,11 @@
-import { IComponentController } from 'angular'
+import { IComponentController } from 'angular';
-import { ApiService } from '@ve-utils/mms-api-client'
+import { ApiService } from '@ve-utils/mms-api-client';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { VeComponentOptions } from '@ve-types/angular'
-import { VeModalInstanceService } from '@ve-types/view-editor'
+import { VeComponentOptions } from '@ve-types/angular';
+import { VeModalInstanceService } from '@ve-types/view-editor';
const AboutModalComponent: VeComponentOptions = {
selector: 'aboutModal',
@@ -28,36 +28,36 @@ const AboutModalComponent: VeComponentOptions = {
resolve: '@',
},
controller: class AboutModalController implements IComponentController {
- static $inject = ['ApiService']
+ static $inject = ['ApiService'];
//bindings
- public modalInstance: VeModalInstanceService
- public resolve
+ public modalInstance: VeModalInstanceService;
+ public resolve;
//local
- public veV
- public mmsV
+ public veV;
+ public mmsV;
constructor(private apiSvc: ApiService) {}
$onInit(): void {
- this.veV = window.__env.version ? window.__env.version : 'No Version Specified'
- this.mmsV = 'Loading...'
+ this.veV = window.__env.version ? window.__env.version : 'No Version Specified';
+ this.mmsV = 'Loading...';
this.apiSvc.getMmsVersion().then(
(data) => {
- this.mmsV = data
+ this.mmsV = data;
},
(reason) => {
- this.mmsV = 'Could not retrieve due to failure: ' + reason.message
+ this.mmsV = 'Could not retrieve due to failure: ' + reason.message;
}
- )
+ );
}
cancel(): void {
- this.modalInstance.dismiss()
+ this.modalInstance.dismiss();
}
},
-}
+};
-veApp.component(AboutModalComponent.selector, AboutModalComponent)
+veApp.component(AboutModalComponent.selector, AboutModalComponent);
diff --git a/src/ve-app/main/modals/index.ts b/src/ve-app/main/modals/index.ts
index a15d73c24..c53032b83 100644
--- a/src/ve-app/main/modals/index.ts
+++ b/src/ve-app/main/modals/index.ts
@@ -1,7 +1,7 @@
//Modals
-import './about-modal.component'
-import './login-modal.component'
-import './print-confirm-modal.component'
-import './select-modal.component'
-import './table-export-modal.component'
-import './working-modal.component'
+import './about-modal.component';
+import './login-modal.component';
+import './print-confirm-modal.component';
+import './select-modal.component';
+import './table-export-modal.component';
+import './working-modal.component';
diff --git a/src/ve-app/main/modals/login-modal.component.ts b/src/ve-app/main/modals/login-modal.component.ts
index dfd59a76c..40df7e039 100644
--- a/src/ve-app/main/modals/login-modal.component.ts
+++ b/src/ve-app/main/modals/login-modal.component.ts
@@ -1,30 +1,30 @@
-import { StateService, UIRouterGlobals } from '@uirouter/angularjs'
-import angular from 'angular'
+import { StateService, UIRouterGlobals } from '@uirouter/angularjs';
+import angular from 'angular';
-import { AuthService } from '@ve-utils/mms-api-client'
-import { VeModalControllerImpl } from '@ve-utils/modals/ve-modal.controller'
+import { AuthService } from '@ve-utils/mms-api-client';
+import { VeModalControllerImpl } from '@ve-utils/modals/ve-modal.controller';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { AuthRequest } from '@ve-types/mms'
-import { VeModalComponent, VeModalController, VeModalResolve, VeModalResolveFn } from '@ve-types/view-editor'
+import { AuthRequest } from '@ve-types/mms';
+import { VeModalComponent, VeModalController, VeModalResolve, VeModalResolveFn } from '@ve-types/view-editor';
export interface LoginModalResolveFn extends VeModalResolveFn {
- continue(): boolean
+ continue(): boolean;
}
export interface LoginModalResolve extends VeModalResolve {
- continue: boolean
+ continue: boolean;
}
class LoginModalController extends VeModalControllerImpl implements VeModalController {
- static $inject = ['$state', '$uiRouterGlobals', 'growl', 'AuthService']
+ static $inject = ['$state', '$uiRouterGlobals', 'growl', 'AuthService'];
public credentials = {
username: '',
password: '',
- }
- spin = false
+ };
+ spin = false;
constructor(
private $state: StateService,
@@ -32,14 +32,14 @@ class LoginModalController extends VeModalControllerImpl {
- this.growl.success('Logged in')
+ this.growl.success('Logged in');
// Check if user had changes queued before refreshing page data
// add edits to cache
// const edits = this.autosaveSvc.getAll()
@@ -51,25 +51,25 @@ class LoginModalController extends VeModalControllerImpl {
- this.modalInstance.close(true)
+ this.modalInstance.close(true);
},
() => {
- this.growl.error('Redirect error; Please reload the page')
+ this.growl.error('Redirect error; Please reload the page');
}
- )
+ );
}
},
(reason) => {
- this.spin = false
- this.credentials.password = ''
- this.growl.error(reason.message)
+ this.spin = false;
+ this.credentials.password = '';
+ this.growl.error(reason.message);
}
- )
+ );
}
cancel = (): void => {
- this.modalInstance.dismiss(false)
- }
+ this.modalInstance.dismiss(false);
+ };
}
const LoginModalComponent: VeModalComponent = {
@@ -94,6 +94,6 @@ const LoginModalComponent: VeModalComponent = {
resolve: '<',
},
controller: LoginModalController,
-}
+};
-veApp.component(LoginModalComponent.selector, LoginModalComponent)
+veApp.component(LoginModalComponent.selector, LoginModalComponent);
diff --git a/src/ve-app/main/modals/print-confirm-modal.component.ts b/src/ve-app/main/modals/print-confirm-modal.component.ts
index 98a3f47f3..16a61c28c 100644
--- a/src/ve-app/main/modals/print-confirm-modal.component.ts
+++ b/src/ve-app/main/modals/print-confirm-modal.component.ts
@@ -1,40 +1,40 @@
-import angular from 'angular'
-import _ from 'lodash'
+import angular from 'angular';
+import _ from 'lodash';
-import { AppUtilsService, DocumentStructure } from '@ve-app/main/services'
-import { UtilsService } from '@ve-utils/application'
-import { EditService } from '@ve-utils/core'
-import { ElementService, ViewService, DocumentMetadata, ProjectService } from '@ve-utils/mms-api-client'
-import { VeModalControllerImpl } from '@ve-utils/modals/ve-modal.controller'
+import { AppUtilsService, DocumentStructure } from '@ve-app/main/services';
+import { UtilsService } from '@ve-utils/application';
+import { EditService } from '@ve-utils/core';
+import { ElementService, ViewService, DocumentMetadata, ProjectService } from '@ve-utils/mms-api-client';
+import { VeModalControllerImpl } from '@ve-utils/modals/ve-modal.controller';
-import { veApp } from '@ve-app'
+import { veApp } from '@ve-app';
-import { VePromise } from '@ve-types/angular'
-import { CommitObject, CommitResponse, RefObject, ViewObject } from '@ve-types/mms'
-import { VeModalComponent, VeModalController, VeModalResolve, VeModalResolveFn } from '@ve-types/view-editor'
+import { VePromise } from '@ve-types/angular';
+import { CommitObject, CommitResponse, RefObject, ViewObject } from '@ve-types/mms';
+import { VeModalComponent, VeModalController, VeModalResolve, VeModalResolveFn } from '@ve-types/view-editor';
interface PrintModalResolve extends VeModalResolve {
- print: JQLite
- refOb: RefObject
- viewOrDocOb: ViewObject
- isDoc: boolean
- mode: number
+ print: JQLite;
+ refOb: RefObject;
+ viewOrDocOb: ViewObject;
+ isDoc: boolean;
+ mode: number;
}
export interface PrintModalResolveFn extends VeModalResolveFn {
- print(): JQLite
- refOb(): RefObject
- viewOrDocOb(): ViewObject
- isDoc(): boolean
- mode(): number
+ print(): JQLite;
+ refOb(): RefObject;
+ viewOrDocOb(): ViewObject;
+ isDoc(): boolean;
+ mode(): number;
}
export interface PrintConfirmResult {
- status: string
- customization?: boolean
- meta?: DocumentMetadata
- model?: { genTotf: boolean; landscape: boolean; htmlTotf: boolean }
- customCSS?: string
+ status: string;
+ customization?: boolean;
+ meta?: DocumentMetadata;
+ model?: { genTotf: boolean; landscape: boolean; htmlTotf: boolean };
+ customCSS?: string;
}
class PrintConfirmModalController extends VeModalControllerImpl implements VeModalController {
@@ -48,29 +48,29 @@ class PrintConfirmModalController extends VeModalControllerImpl 0) {
- this.hasError = true
+ this.hasError = true;
}
if (this.isDoc) {
// If _printCss, use to set doc css for export/print
- this.customizeDoc.useCustomStyle = false
+ this.customizeDoc.useCustomStyle = false;
if (this.viewOrDocOb._printCss) {
// If _printCss, show tab for custom css
- this.customizeDoc.useCustomStyle = true
- this.customizeDoc.customCSS = this.viewOrDocOb._printCss
+ this.customizeDoc.useCustomStyle = true;
+ this.customizeDoc.customCSS = this.viewOrDocOb._printCss;
} else {
this.customizeDoc.customCSS = this.utilsSvc.getPrintCss(false, false, {
numberingDepth: 0,
numberingSeparator: '.',
- })
+ });
}
// Get/Set document header/footer for PDF generation
@@ -125,7 +125,7 @@ class PrintConfirmModalController extends VeModalControllerImpl {
- let displayTime = 'latest'
- let promise: VePromise
+ let displayTime = 'latest';
+ let promise: VePromise;
if (this.refOb.parentCommitId) {
promise = this.projectSvc.getCommit(
this.refOb._projectId,
this.refOb.id,
this.refOb.parentCommitId
- )
+ );
} else {
- promise = this.projectSvc.getCommits(this.refOb.id, this.refOb._projectId, null, 1)
+ promise = this.projectSvc.getCommits(this.refOb.id, this.refOb._projectId, null, 1);
}
promise
.then(
(result) => {
- let commit: CommitObject
+ let commit: CommitObject;
if (Array.isArray(result)) {
- commit = result[0]
+ commit = result[0];
} else {
- commit = result
+ commit = result;
}
- displayTime = this.$filter('date')(commit._created, 'M/d/yy h:mm a')
+ displayTime = this.$filter('date')(commit._created, 'M/d/yy h:mm a');
},
(reason) => {
this.growl.error(
'Warning: RefOb parent commit does not exist; Defaulting to current time'
- )
+ );
}
)
.finally(() => {
@@ -176,16 +176,16 @@ class PrintConfirmModalController extends VeModalControllerImpl {
this.meta['top-left'] =
@@ -193,64 +193,64 @@ class PrintConfirmModalController extends VeModalControllerImpl {
- this.elementSaving = false
- this.growl.success('Save Successful')
+ this.elementSaving = false;
+ this.growl.success('Save Successful');
},
() => {
- this.elementSaving = false
- this.growl.warning('Save was not complete. Please try again.')
+ this.elementSaving = false;
+ this.growl.warning('Save was not complete. Please try again.');
}
- )
+ );
}
public preview(): void {
if (!this.previewResult) {
- this.previewResult = this.appUtilsSvc.printOrGenerate(this.viewOrDocOb, 3, true, true, false)
- this.previewResult.tof = this.previewResult.tof + this.previewResult.toe
+ this.previewResult = this.appUtilsSvc.printOrGenerate(this.viewOrDocOb, 3, true, true, false);
+ this.previewResult.tof = this.previewResult.tof + this.previewResult.toe;
}
- const result = this.previewResult
+ const result = this.previewResult;
const htmlArr = [
'' + this.viewOrDocOb.name + '',
result.cover,
- ]
- if (result.toc != '') htmlArr.push(result.toc)
- if (result.tot != '' && this.model.genTotf) htmlArr.push(result.tot)
- if (result.tof != '' && this.model.genTotf) htmlArr.push(result.tof)
- htmlArr.push(result.contents, '')
- const htmlString = htmlArr.join('')
+ ];
+ if (result.toc != '') htmlArr.push(result.toc);
+ if (result.tot != '' && this.model.genTotf) htmlArr.push(result.tot);
+ if (result.tof != '' && this.model.genTotf) htmlArr.push(result.tof);
+ htmlArr.push(result.contents, '