Преглед изворни кода

ComposeArea: Configure log level

Verbose logging if DEBUG is enabled, only warnings otherwise.
Danilo Bargen пре 6 година
родитељ
комит
b32160942b
3 измењених фајлова са 9 додато и 7 уклоњено
  1. 4 4
      package-lock.json
  2. 1 1
      package.json
  3. 4 2
      src/directives/compose_area.ts

+ 4 - 4
package-lock.json

@@ -950,9 +950,9 @@
       }
     },
     "@threema/compose-area": {
-      "version": "0.2.0",
-      "resolved": "https://registry.npmjs.org/@threema/compose-area/-/compose-area-0.2.0.tgz",
-      "integrity": "sha512-gDpBmEBoP1plDB8BAWjt3UdZZp0PFc/aLSpSKFnzicB5giQI/2KvS/fMfZlV4DTx/AqW9vbI4mL6VQQ28uQ6jQ=="
+      "version": "0.2.2",
+      "resolved": "https://registry.npmjs.org/@threema/compose-area/-/compose-area-0.2.2.tgz",
+      "integrity": "sha512-er/fgXHrmLfDCUWbQeN06BvroX7wiRRWsIAIGNaz9cPns1wRYF+pnmgw2fjDgRZcVNNikB+PMI1TX/xPOYswEQ=="
     },
     "@types/angular": {
       "version": "1.6.53",
@@ -8033,7 +8033,7 @@
       "dependencies": {
         "jsesc": {
           "version": "0.5.0",
-          "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
+          "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz",
           "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0="
         }
       }

+ 1 - 1
package.json

@@ -42,7 +42,7 @@
     "@saltyrtc/client": "^0.13.2",
     "@saltyrtc/task-relayed-data": "^0.3.1",
     "@saltyrtc/task-webrtc": "^0.13.0",
-    "@threema/compose-area": "^0.2.0",
+    "@threema/compose-area": "^0.2.2",
     "@types/angular": "^1.6.53",
     "@types/angular-material": "^1.1.62",
     "@types/angular-sanitize": "^1.3.7",

+ 4 - 2
src/directives/compose_area.ts

@@ -40,6 +40,7 @@ export default [
     '$filter',
     '$log',
     '$rootScope',
+    'CONFIG',
     function(browserService: BrowserService,
              stringService: StringService,
              timeoutService: TimeoutService,
@@ -49,7 +50,8 @@ export default [
              $mdDialog: ng.material.IDialogService,
              $filter: ng.IFilterService,
              $log: ng.ILogService,
-             $rootScope: ng.IRootScopeService) {
+             $rootScope: ng.IRootScopeService,
+             CONFIG: threema.Config) {
         return {
             restrict: 'EA',
             scope: {
@@ -92,7 +94,7 @@ export default [
                 const fileInput: any = angular.element(element[0].querySelector('input.file-input'));
 
                 // Initialize compose area lib
-                const composeArea = ComposeArea.bind_to(composeDiv[0]);
+                const composeArea = ComposeArea.bind_to(composeDiv[0], CONFIG.DEBUG ? 'debug' : 'warn');
                 if (scope.onInit) {
                     scope.onInit(composeArea);
                 }