@instructure/canvas-rce 5.9.0 → 5.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.js +7 -0
- package/CHANGELOG.md +47 -0
- package/Dockerfile +1 -1
- package/es/common/mimeClass.js +70 -67
- package/es/enhance-user-content/doc_previews.js +1 -1
- package/es/enhance-user-content/enhance_user_content.js +9 -1
- package/es/enhance-user-content/mathml.js +8 -5
- package/es/getThemeVars.js +3 -4
- package/es/rce/RCE.js +1 -3
- package/es/rce/RCEWrapper.js +3 -48
- package/es/rce/RceHtmlEditor.js +20 -38
- package/es/rce/plugins/instructure_equation/EquationEditorModal/parseLatex.js +0 -2
- package/es/rce/plugins/instructure_links/components/Link.js +3 -9
- package/es/rce/plugins/instructure_links/components/LinkSet.js +4 -8
- package/es/rce/plugins/instructure_links/components/NoResults.js +5 -10
- package/es/rce/plugins/instructure_links/plugin.js +1 -7
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +1 -2
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogModal.js +4 -5
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogTray.js +6 -12
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.js +2 -2
- package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +1 -1
- package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +7 -2
- package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +3 -9
- package/es/rce/plugins/instructure_wordcount/components/WordCountModal.js +8 -16
- package/es/rce/plugins/shared/CanvasContentTray.js +15 -9
- package/es/rce/plugins/shared/ContentSelection.js +7 -3
- package/es/rce/plugins/shared/ImageCropper/Preview.js +8 -7
- package/es/rce/plugins/shared/LinkDisplay.js +2 -2
- package/es/rce/plugins/shared/fileTypeUtils.js +14 -6
- package/{lib/rce/plugins/tinymce-a11y-checker/components/color-field.js → es/rce/plugins/tinymce-a11y-checker/components/ColorField.js} +9 -7
- package/es/rce/plugins/tinymce-a11y-checker/components/checker.js +27 -24
- package/es/rce/plugins/tinymce-a11y-checker/rules/large-text-contrast.js +9 -0
- package/es/rce/plugins/tinymce-a11y-checker/rules/small-text-contrast.js +9 -0
- package/es/rce/root.js +1 -3
- package/es/rce/transformContent.js +8 -0
- package/es/sidebar/actions/upload.js +3 -1
- package/es/translations/locales/de.js +4 -4
- package/jest/jest-setup.js +2 -1
- package/lib/common/mimeClass.js +70 -67
- package/lib/enhance-user-content/doc_previews.js +1 -1
- package/lib/enhance-user-content/enhance_user_content.js +9 -1
- package/lib/enhance-user-content/mathml.js +8 -5
- package/lib/getThemeVars.js +3 -4
- package/lib/rce/RCE.js +1 -3
- package/lib/rce/RCEWrapper.js +3 -48
- package/lib/rce/RceHtmlEditor.js +20 -38
- package/lib/rce/plugins/instructure_equation/EquationEditorModal/parseLatex.js +0 -2
- package/lib/rce/plugins/instructure_links/components/Link.js +3 -9
- package/lib/rce/plugins/instructure_links/components/LinkSet.js +4 -8
- package/lib/rce/plugins/instructure_links/components/NoResults.js +5 -10
- package/lib/rce/plugins/instructure_links/plugin.js +1 -7
- package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +1 -2
- package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogModal.js +4 -5
- package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogTray.js +6 -12
- package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.js +2 -2
- package/lib/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +1 -1
- package/lib/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +7 -2
- package/lib/rce/plugins/instructure_record/VideoOptionsTray/index.js +3 -9
- package/lib/rce/plugins/instructure_wordcount/components/WordCountModal.js +8 -16
- package/lib/rce/plugins/shared/CanvasContentTray.js +15 -9
- package/lib/rce/plugins/shared/ContentSelection.js +7 -3
- package/lib/rce/plugins/shared/ImageCropper/Preview.js +8 -7
- package/lib/rce/plugins/shared/LinkDisplay.js +2 -2
- package/lib/rce/plugins/shared/fileTypeUtils.js +14 -6
- package/{es/rce/plugins/tinymce-a11y-checker/components/color-field.js → lib/rce/plugins/tinymce-a11y-checker/components/ColorField.js} +9 -7
- package/lib/rce/plugins/tinymce-a11y-checker/components/checker.js +27 -24
- package/lib/rce/plugins/tinymce-a11y-checker/rules/large-text-contrast.js +9 -0
- package/lib/rce/plugins/tinymce-a11y-checker/rules/small-text-contrast.js +9 -0
- package/lib/rce/root.js +1 -3
- package/lib/rce/transformContent.js +8 -0
- package/lib/sidebar/actions/upload.js +3 -1
- package/lib/translations/locales/de.js +4 -4
- package/locales/en.json +1438 -89
- package/package.json +58 -55
- package/canvas/README.md +0 -84
- package/canvas/locales/en.json +0 -934
- package/canvas/package.json +0 -189
- package/es/rce/getBrowser.js +0 -53
- package/lib/rce/getBrowser.js +0 -53
package/canvas/package.json
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@instructure/canvas-rce",
|
|
3
|
-
"version": "5.1.1",
|
|
4
|
-
"description": "A component wrapping canvas's common tinymce usage",
|
|
5
|
-
"main": "lib/index.js",
|
|
6
|
-
"module": "es/index.js",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"i18n:extract": "format-message extract \"src*/**/*.js\" -g underscored_crc32 -o locales/en.json",
|
|
9
|
-
"integration-test": "nightwatch --env integration",
|
|
10
|
-
"lint": "eslint \"src/**/*.js\" \"test/**/*.js\"",
|
|
11
|
-
"lint:fix": "eslint --fix \"src/**/*.js\" \"test/**/*.js\"",
|
|
12
|
-
"_test": "Test cafe will be added back to test as part of CORE-2995",
|
|
13
|
-
"test": "yarn test:mocha && yarn test:jest",
|
|
14
|
-
"test:mocha": "BABEL_ENV=test-node mocha 'test/**/*.test.js' --require @instructure/canvas-theme --require jsdom-global/register --require ./babel-register.js --timeout 5000 --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.js",
|
|
15
|
-
"test:mocha:one": "BABEL_ENV=test-node mocha --require @instructure/canvas-theme --require jsdom-global/register --require ./babel-register.js --timeout 5000 --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.js",
|
|
16
|
-
"test:mocha:debug": "BABEL_ENV=test-node mocha --inspect-brk --require @instructure/canvas-theme --require jsdom-global/register --require ./babel-register.js --timeout 5000 --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.js",
|
|
17
|
-
"test:jest": "jest --color --runInBand",
|
|
18
|
-
"test:cafe": "yarn build:cafe && yarn test:cafe:only",
|
|
19
|
-
"test:cafe:only": "testcafe chrome testcafe/**/*.test.js",
|
|
20
|
-
"test:cafe:one": "testcafe chrome testcafe/**/*.test.js --test ",
|
|
21
|
-
"test:cafe:all": "yarn build:cafe && testcafe chrome,firefox,safari testcafe/**/*.test.js",
|
|
22
|
-
"test:cafe:debug": "testcafe --inspect-brk chrome testcafe/**/*.test.js",
|
|
23
|
-
"test:watch": "BABEL_ENV=test-node mocha 'test/**/*.test.js' --require @instructure/canvas-theme --require ./babel-register.js --watch",
|
|
24
|
-
"test:coverage": "cross-env BABEL_ENV=test-node nyc -r html -r json node_modules/.bin/mocha -r jsdom-global/register 'test/**/*.test.js'",
|
|
25
|
-
"test:jest:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
|
|
26
|
-
"debug": "BABEL_ENV=test-node inspect _mocha --no-timeouts --debug-brk 'test/**/*.test.js' --require @instructure/canvas-theme --require ./babel-register.js",
|
|
27
|
-
"demo": "scripts/demo.sh",
|
|
28
|
-
"demo:clean": "rm -f github-pages/dist/*",
|
|
29
|
-
"demo:build": "webpack -c ./webpack.demo.config.js",
|
|
30
|
-
"demo:dev": "yarn demo:clean && mkdir -p ./github-pages/dist && cp ./github-pages/index.html ./github-pages/dist && webpack -c ./webpack.dev.config.js",
|
|
31
|
-
"installTranslations": "scripts/installTranslations.js",
|
|
32
|
-
"build:all": "scripts/build.js",
|
|
33
|
-
"build:canvas": "scripts/build-canvas",
|
|
34
|
-
"build:watch": "rm -rf es && ./node_modules/.bin/babel --out-dir es src --watch",
|
|
35
|
-
"build:cafe": "webpack --config webpack.testcafe.config.js",
|
|
36
|
-
"prepublishOnly": "yarn build:all && yarn test",
|
|
37
|
-
"fmt:check": "prettier -l '**/*.js'",
|
|
38
|
-
"fmt:fix": "prettier --write '**/*.js'",
|
|
39
|
-
"clean": "rm -rf lib && rm -rf es && rm -rf coverage && yarn demo:clean"
|
|
40
|
-
},
|
|
41
|
-
"author": "Instructure, Inc",
|
|
42
|
-
"license": "AGPL-3.0",
|
|
43
|
-
"browserslist": [
|
|
44
|
-
"extends @instructure/browserslist-config-canvas-lms"
|
|
45
|
-
],
|
|
46
|
-
"nyc": {
|
|
47
|
-
"include": [
|
|
48
|
-
"shared/**/*.js",
|
|
49
|
-
"src/**/*.js"
|
|
50
|
-
],
|
|
51
|
-
"exclude": [],
|
|
52
|
-
"require": [
|
|
53
|
-
"@babel/register",
|
|
54
|
-
"@instructure/canvas-theme"
|
|
55
|
-
],
|
|
56
|
-
"sourceMap": false,
|
|
57
|
-
"instrument": false
|
|
58
|
-
},
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"@instructure/canvas-media": ">=1.0.0",
|
|
61
|
-
"@instructure/canvas-theme": "7",
|
|
62
|
-
"@instructure/k5uploader": ">=1",
|
|
63
|
-
"@instructure/media-capture": "~8.0.1-rc.11",
|
|
64
|
-
"@instructure/ui-a11y-content": "7",
|
|
65
|
-
"@instructure/ui-alerts": "7",
|
|
66
|
-
"@instructure/ui-avatar": "7",
|
|
67
|
-
"@instructure/ui-badge": "7",
|
|
68
|
-
"@instructure/ui-billboard": "7",
|
|
69
|
-
"@instructure/ui-buttons": "7",
|
|
70
|
-
"@instructure/ui-checkbox": "7",
|
|
71
|
-
"@instructure/ui-code-editor": "7.3.0",
|
|
72
|
-
"@instructure/ui-color-utils": "7",
|
|
73
|
-
"@instructure/ui-file-drop": "7",
|
|
74
|
-
"@instructure/ui-flex": "7",
|
|
75
|
-
"@instructure/ui-focusable": "7",
|
|
76
|
-
"@instructure/ui-form-field": "7",
|
|
77
|
-
"@instructure/ui-heading": "7",
|
|
78
|
-
"@instructure/ui-icons": "7",
|
|
79
|
-
"@instructure/ui-img": "7",
|
|
80
|
-
"@instructure/ui-link": "7",
|
|
81
|
-
"@instructure/ui-list": "7",
|
|
82
|
-
"@instructure/ui-media-player": "7",
|
|
83
|
-
"@instructure/ui-modal": "7",
|
|
84
|
-
"@instructure/ui-motion": "7",
|
|
85
|
-
"@instructure/ui-overlays": "7",
|
|
86
|
-
"@instructure/ui-pagination": "7",
|
|
87
|
-
"@instructure/ui-popover": "7",
|
|
88
|
-
"@instructure/ui-radio-input": "7",
|
|
89
|
-
"@instructure/ui-react-utils": "7",
|
|
90
|
-
"@instructure/ui-simple-select": "7",
|
|
91
|
-
"@instructure/ui-spinner": "7",
|
|
92
|
-
"@instructure/ui-svg-images": "7",
|
|
93
|
-
"@instructure/ui-tabs": "7",
|
|
94
|
-
"@instructure/ui-text": "7",
|
|
95
|
-
"@instructure/ui-text-area": "7",
|
|
96
|
-
"@instructure/ui-text-input": "7",
|
|
97
|
-
"@instructure/ui-themeable": "7",
|
|
98
|
-
"@instructure/ui-themes": "7",
|
|
99
|
-
"@instructure/ui-toggle-details": "7",
|
|
100
|
-
"@instructure/ui-tooltip": "7",
|
|
101
|
-
"@instructure/ui-tray": "7",
|
|
102
|
-
"@instructure/ui-tree-browser": "7",
|
|
103
|
-
"@instructure/ui-truncate-text": "7",
|
|
104
|
-
"@instructure/ui-utils": "7",
|
|
105
|
-
"@instructure/ui-view": "7",
|
|
106
|
-
"@instructure/uid": "7",
|
|
107
|
-
"@sheerun/mutationobserver-shim": "^0.3.2",
|
|
108
|
-
"@tinymce/tinymce-react": "~3.8.4",
|
|
109
|
-
"aphrodite": "^2",
|
|
110
|
-
"axios": "^0.21.1",
|
|
111
|
-
"bloody-offset": "0.0.0",
|
|
112
|
-
"classnames": "^2.2.5",
|
|
113
|
-
"format-message": "^6",
|
|
114
|
-
"format-message-generate-id": "^6",
|
|
115
|
-
"get-cookie": "1",
|
|
116
|
-
"i18n-js": "^3",
|
|
117
|
-
"i18nliner": "~0.2.0",
|
|
118
|
-
"isomorphic-fetch": "2.2.1",
|
|
119
|
-
"jquery": "https://github.com/instructure/jquery.git#1.7.2-with-AMD-and-CommonJS",
|
|
120
|
-
"js-beautify": "1",
|
|
121
|
-
"keycode": "^2",
|
|
122
|
-
"lodash": "^4",
|
|
123
|
-
"minimatch": "~3.0.4",
|
|
124
|
-
"prop-types": "^15",
|
|
125
|
-
"react": "^0.14.8 || ^15.0.0 || ^16",
|
|
126
|
-
"react-dom": "^0.14.8 || ^15.0.0 || ^16",
|
|
127
|
-
"react-draggable": "^3.3.0",
|
|
128
|
-
"react-redux": "^5",
|
|
129
|
-
"react-transition-group": "^1",
|
|
130
|
-
"redux": "^4",
|
|
131
|
-
"redux-batch-middleware": "^0.2.0",
|
|
132
|
-
"redux-thunk": "^2",
|
|
133
|
-
"scroll-into-view": "https://github.com/bkirkby/scroll-into-view.git#588b0ced98eeecf84e6fb2074aa076e80b7cffab",
|
|
134
|
-
"tinymce": "^5",
|
|
135
|
-
"tinymce-a11y-checker": "^3.0.0"
|
|
136
|
-
},
|
|
137
|
-
"devDependencies": {
|
|
138
|
-
"@babel/cli": "^7",
|
|
139
|
-
"@babel/core": "^7",
|
|
140
|
-
"@babel/register": "7",
|
|
141
|
-
"@instructure/browserslist-config-canvas-lms": ">=2",
|
|
142
|
-
"@instructure/translations": ">=1",
|
|
143
|
-
"@instructure/ui-babel-preset": "7",
|
|
144
|
-
"@testing-library/dom": "^7",
|
|
145
|
-
"@testing-library/jest-dom": "^5",
|
|
146
|
-
"@testing-library/react": "^11",
|
|
147
|
-
"@testing-library/user-event": "^12",
|
|
148
|
-
"axe-testcafe": "^3",
|
|
149
|
-
"babel-loader": "^8.0.0",
|
|
150
|
-
"babel-plugin-dynamic-import-node": "^2.2.0",
|
|
151
|
-
"babel-plugin-inline-json-import": "^0.2.0",
|
|
152
|
-
"babel-plugin-minify-constant-folding": "^0.5.0",
|
|
153
|
-
"babel-plugin-minify-dead-code-elimination": "^0.5.0",
|
|
154
|
-
"babel-plugin-minify-guarded-expressions": "^0.4.3",
|
|
155
|
-
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
|
|
156
|
-
"cross-env": "^5.0.0",
|
|
157
|
-
"eslint-plugin-mocha": "^6",
|
|
158
|
-
"eslint-plugin-testcafe": "^0.2.1",
|
|
159
|
-
"fetch-mock": "^6",
|
|
160
|
-
"format-message-cli": "^6",
|
|
161
|
-
"format-message-parse": "^6",
|
|
162
|
-
"jest": "^24",
|
|
163
|
-
"jest-canvas-mock": "^2",
|
|
164
|
-
"jest-environment-jsdom-fourteen": "^0.1.0",
|
|
165
|
-
"jest-junit": "^7",
|
|
166
|
-
"jsdom": "^13.0.0",
|
|
167
|
-
"jsdom-global": "^3.0.2",
|
|
168
|
-
"jsdomify": "^3",
|
|
169
|
-
"mocha": "^6",
|
|
170
|
-
"mocha-junit-reporter": "^1.18.0",
|
|
171
|
-
"mocha-multi-reporters": "^1.1.7",
|
|
172
|
-
"moxios": "^0.4",
|
|
173
|
-
"nyc": "^13",
|
|
174
|
-
"prettier": "^2.2.1",
|
|
175
|
-
"proxyquire": "1.7.4",
|
|
176
|
-
"shelljs": "^0.8.3",
|
|
177
|
-
"sinon": "^7",
|
|
178
|
-
"skin-deep": "^1",
|
|
179
|
-
"testcafe": "^1.9.0",
|
|
180
|
-
"testcafe-react-selectors": "^3.3.0",
|
|
181
|
-
"webpack": "^4",
|
|
182
|
-
"webpack-merge": "^5",
|
|
183
|
-
"webpack-nano": "^1",
|
|
184
|
-
"webpack-plugin-serve": "^1"
|
|
185
|
-
},
|
|
186
|
-
"resolutions": {
|
|
187
|
-
"format-message-estree-util": "../packages/format-message-estree-util"
|
|
188
|
-
}
|
|
189
|
-
}
|
package/es/rce/getBrowser.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2022 - present Instructure, Inc.
|
|
3
|
-
*
|
|
4
|
-
* This file is part of Canvas.
|
|
5
|
-
*
|
|
6
|
-
* Canvas is free software: you can redistribute it and/or modify it under
|
|
7
|
-
* the terms of the GNU Affero General Public License as published by the Free
|
|
8
|
-
* Software Foundation, version 3 of the License.
|
|
9
|
-
*
|
|
10
|
-
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
11
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
12
|
-
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
13
|
-
* details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License along
|
|
16
|
-
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
*/
|
|
18
|
-
// From packages/parse-browser-info/index.js
|
|
19
|
-
export function getBrowser() {
|
|
20
|
-
const ua = navigator.userAgent;
|
|
21
|
-
let tem;
|
|
22
|
-
let M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
|
|
23
|
-
|
|
24
|
-
if (/trident/i.test(M[1])) {
|
|
25
|
-
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
|
|
26
|
-
return {
|
|
27
|
-
name: 'IE',
|
|
28
|
-
version: tem[1] || ''
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (M[1] === 'Chrome') {
|
|
33
|
-
tem = ua.match(/\bOPR|Edge\/(\d+)/);
|
|
34
|
-
|
|
35
|
-
if (tem != null) {
|
|
36
|
-
return {
|
|
37
|
-
name: 'Opera',
|
|
38
|
-
version: tem[1]
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];
|
|
44
|
-
|
|
45
|
-
if ((tem = ua.match(/version\/(\d+)/i)) != null) {
|
|
46
|
-
M.splice(1, 1, tem[1]);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
name: M[0],
|
|
51
|
-
version: M[1]
|
|
52
|
-
};
|
|
53
|
-
}
|
package/lib/rce/getBrowser.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2022 - present Instructure, Inc.
|
|
3
|
-
*
|
|
4
|
-
* This file is part of Canvas.
|
|
5
|
-
*
|
|
6
|
-
* Canvas is free software: you can redistribute it and/or modify it under
|
|
7
|
-
* the terms of the GNU Affero General Public License as published by the Free
|
|
8
|
-
* Software Foundation, version 3 of the License.
|
|
9
|
-
*
|
|
10
|
-
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
11
|
-
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
12
|
-
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
|
13
|
-
* details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License along
|
|
16
|
-
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
*/
|
|
18
|
-
// From packages/parse-browser-info/index.js
|
|
19
|
-
export function getBrowser() {
|
|
20
|
-
const ua = navigator.userAgent;
|
|
21
|
-
let tem;
|
|
22
|
-
let M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
|
|
23
|
-
|
|
24
|
-
if (/trident/i.test(M[1])) {
|
|
25
|
-
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
|
|
26
|
-
return {
|
|
27
|
-
name: 'IE',
|
|
28
|
-
version: tem[1] || ''
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (M[1] === 'Chrome') {
|
|
33
|
-
tem = ua.match(/\bOPR|Edge\/(\d+)/);
|
|
34
|
-
|
|
35
|
-
if (tem != null) {
|
|
36
|
-
return {
|
|
37
|
-
name: 'Opera',
|
|
38
|
-
version: tem[1]
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, '-?'];
|
|
44
|
-
|
|
45
|
-
if ((tem = ua.match(/version\/(\d+)/i)) != null) {
|
|
46
|
-
M.splice(1, 1, tem[1]);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
name: M[0],
|
|
51
|
-
version: M[1]
|
|
52
|
-
};
|
|
53
|
-
}
|