Browse Source

Fix Vivaldi undefined error for ivprogCore library

-Fix Vivaldi SecurityError when using localStorage
Lucas de Souza 5 years ago
parent
commit
4a6ae7d472
4 changed files with 1134 additions and 225 deletions
  1. 5 4
      js/services/languageService.js
  2. 1124 217
      package-lock.json
  3. 3 3
      package.json
  4. 2 1
      webpack.config.js

+ 5 - 4
js/services/languageService.js

@@ -1,12 +1,13 @@
 import Lexers from './../../grammar/';
 import line_i18n from 'line-i18n';
 
-const DEFAULT_LANG = "pt";
+// This is for LanguageService with localStorage
+// const DEFAULT_LANG = "pt";
 
-class LanguageServiceExtended extends line_i18n.LanguageService {
+class LanguageServiceExtended extends line_i18n.LanguageServiceNoLS {
 
   constructor () {
-    super("ivprog.lang", DEFAULT_LANG);
+    super(iLMparameters.lang);
   }
 
   getCurrentLexer () {
@@ -36,4 +37,4 @@ class LanguageServiceExtended extends line_i18n.LanguageService {
   }
 }
 
-export const LanguageService  = Object.freeze(new LanguageServiceExtended());
+export const LanguageService  = new LanguageServiceExtended();

File diff suppressed because it is too large
+ 1124 - 217
package-lock.json


+ 3 - 3
package.json

@@ -46,10 +46,10 @@
   },
   "dependencies": {
     "antlr4": "^4.7.1",
+    "decimal.js": "^10.0.1",
     "jquery": "^3.3.1",
+    "line-i18n": "git+https://git.lcalion.com/LInE/line-i18n.git",
     "melanke-watchjs": "^1.5.0",
-    "server": "^1.0.18",
-    "decimal.js": "^10.0.1",
-    "line-i18n": "git+https://git.lcalion.com/LInE/line-i18n.git"
+    "server": "^1.0.18"
   }
 }

+ 2 - 1
webpack.config.js

@@ -7,7 +7,8 @@ module.exports = {
     output: {
         path: path.resolve(__dirname, 'build'),
         filename: 'ivprog.bundle.js',
-        library: 'ivprogCore'
+        library: 'ivprogCore',
+        libraryTarget: 'umd'
     },
     node: {
         fs: 'empty',