[TASK] Introduce ExcelMicro as CGL for TypeScript 58/54958/4
authorFrank Naegler <frank.naegler@typo3.org>
Thu, 7 Dec 2017 10:18:51 +0000 (11:18 +0100)
committerBenni Mack <benni@typo3.org>
Sat, 9 Dec 2017 18:07:28 +0000 (19:07 +0100)
Resolves: #83248
Releases: master
Change-Id: I1a61178131b358e4cc309bd11fc77278d9220a55
Reviewed-on: https://review.typo3.org/54958
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
27 files changed:
Build/tslint.json
Build/types/TYPO3/index.d.ts
typo3/sysext/backend/Resources/Private/TypeScript/BackendException.ts
typo3/sysext/backend/Resources/Private/TypeScript/ColorPicker.ts
typo3/sysext/backend/Resources/Private/TypeScript/Event/ConsumerScope.ts
typo3/sysext/backend/Resources/Private/TypeScript/Event/InteractionRequest.ts
typo3/sysext/backend/Resources/Private/TypeScript/Event/InteractionRequestMap.ts
typo3/sysext/backend/Resources/Private/TypeScript/FormEngineReview.ts
typo3/sysext/backend/Resources/Private/TypeScript/GridEditor.ts
typo3/sysext/backend/Resources/Private/TypeScript/ImageManipulation.ts
typo3/sysext/backend/Resources/Private/TypeScript/Login.ts
typo3/sysext/backend/Resources/Private/TypeScript/Popover.ts
typo3/sysext/backend/Resources/Private/TypeScript/RenameFile.ts
typo3/sysext/backend/Resources/Private/TypeScript/Storage.ts
typo3/sysext/backend/Resources/Private/TypeScript/Storage/Persistent.ts
typo3/sysext/backend/Resources/Private/TypeScript/Tabs.ts
typo3/sysext/backend/Resources/Private/TypeScript/UserPassLogin.ts
typo3/sysext/backend/Resources/Public/JavaScript/FormEngineReview.js
typo3/sysext/backend/Resources/Public/JavaScript/ImageManipulation.js
typo3/sysext/backend/Resources/Public/JavaScript/Login.js
typo3/sysext/backend/Resources/Public/JavaScript/Popover.js
typo3/sysext/backend/Resources/Public/JavaScript/Storage.js
typo3/sysext/backend/Resources/Public/JavaScript/UserPassLogin.js
typo3/sysext/backend/Tests/TypeScript/BackendExceptionTest.ts
typo3/sysext/backend/Tests/TypeScript/GridEditorTest.ts
typo3/sysext/t3editor/Resources/Private/TypeScript/T3editor.ts
typo3/sysext/t3editor/Resources/Public/JavaScript/T3editor.js

index aa19ca5..357391c 100644 (file)
 {
-       "// extends": "@see https://github.com/palantir/tslint/blob/master/src/configs/recommended.ts",
-       "extends": "tslint:recommended",
        "rules": {
-               "interface-name": [false],
-               "no-console": [false],
-               "no-inferrable-types": [true],
-               "no-namespace": [false, "allow-declarations"],
-               "no-trailing-comma": [false],
-               "quotemark": [true, "single", "avoid-escape"]
+               "align": [
+                       true,
+                       "parameters",
+                       "arguments",
+                       "statements"
+               ],
+               "ban": false,
+               "class-name": true,
+               "comment-format": [
+                       true,
+                       "check-space"
+               ],
+               "curly": false,
+               "eofline": true,
+               "forin": true,
+               "indent": [
+                       true,
+                       2
+               ],
+               "interface-name": false,
+               "jsdoc-format": true,
+               "label-position": true,
+               "max-line-length": [
+                       true,
+                       140
+               ],
+               "member-ordering": [
+                       true,
+                       "public-before-private",
+                       "static-before-instance",
+                       "variables-before-functions"
+               ],
+               "no-any": false,
+               "no-arg": true,
+               "no-bitwise": true,
+               "no-console": [
+                       true,
+                       "debug",
+                       "info",
+                       "time",
+                       "timeEnd",
+                       "trace"
+               ],
+               "no-construct": true,
+               "no-debugger": true,
+               "no-shadowed-variable": true,
+               "no-duplicate-variable": true,
+               "no-empty": true,
+               "no-eval": true,
+               "no-require-imports": false,
+               "no-string-literal": true,
+               "no-switch-case-fall-through": true,
+               "trailing-comma": {
+                       "singleline": "never",
+                       "multiline": "always"
+               },
+               "no-trailing-whitespace": true,
+               "no-unused-expression": true,
+               "no-var-keyword": true,
+               "no-var-requires": false,
+               "one-line": [
+                       true,
+                       "check-open-brace",
+                       "check-catch",
+                       "check-else",
+                       "check-whitespace"
+               ],
+               "quotemark": [
+                       true,
+                       "single"
+               ],
+               "radix": true,
+               "semicolon": true,
+               "switch-default": true,
+               "triple-equals": [
+                       true,
+                       "allow-null-check"
+               ],
+               "typedef": [
+                       true,
+                       "call-signature",
+                       "parameter",
+                       "property-declaration",
+                       "member-variable-declaration"
+               ],
+               "typedef-whitespace": [
+                       true,
+                       {
+                               "call-signature": "nospace",
+                               "index-signature": "nospace",
+                               "parameter": "nospace",
+                               "property-declaration": "nospace",
+                               "variable-declaration": "nospace"
+                       }
+               ],
+               "use-strict": [
+                       false,
+                       "check-module",
+                       "check-function"
+               ],
+               "variable-name": false,
+               "whitespace": [
+                       true,
+                       "check-branch",
+                       "check-decl",
+                       "check-operator",
+                       "check-separator",
+                       "check-type"
+               ]
        }
 }
index 4d9053d..3c0d00e 100644 (file)
@@ -60,7 +60,7 @@ declare module 'TYPO3/CMS/Backend/Severity' {
   export = new TYPO3.CMS.Backend.Severity();
 }
 
-// Type definition for global namespace object
+// type definition for global namespace object
 interface Window {
   TYPO3: any;
   $: any;
index 384e9d0..c9da1c2 100644 (file)
@@ -15,7 +15,7 @@ export class BackendException {
   public readonly message: string;
   public readonly code: number;
 
-  constructor(message = '', code = 0) {
+  constructor(message: string = '', code: number = 0) {
     this.message = message;
     this.code = code;
   }
index b5370c7..5bd6a92 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import $ = require('jquery');
+import * as $ from 'jquery';
 import 'TYPO3/CMS/Core/Contrib/jquery.minicolors';
 
 /**
@@ -53,5 +53,5 @@ class ColorPicker {
     });
   }
 }
-// Create an instance and return it
+// create an instance and return it
 export = new ColorPicker();
index 3adfe53..d6aeb0c 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import $ = require('jquery');
+import * as $ from 'jquery';
 import Consumable = require('./Consumable');
 import InteractionRequest = require('./InteractionRequest');
 
@@ -26,13 +26,13 @@ class ConsumerScope {
     return this.consumers.indexOf(consumer) !== -1;
   }
 
-  public attach(consumer: Consumable) {
+  public attach(consumer: Consumable): void {
     if (!this.hasConsumer(consumer)) {
       this.consumers.push(consumer);
     }
   }
 
-  public detach(consumer: Consumable) {
+  public detach(consumer: Consumable): void {
     this.consumers = this.consumers.filter(
       (currentConsumer: Consumable) => currentConsumer !== consumer,
     );
index e4b9197..3129b9b 100644 (file)
@@ -14,7 +14,7 @@
 class InteractionRequest {
   public readonly type: string;
   public readonly parentRequest: InteractionRequest;
-  protected processed = false;
+  protected processed: boolean = false;
   protected processedData: any = null;
 
   public get outerMostRequest(): InteractionRequest {
@@ -38,7 +38,7 @@ class InteractionRequest {
     return this.processedData;
   }
 
-  public setProcessedData(processedData: any = null) {
+  public setProcessedData(processedData: any = null): void {
     this.processed = true;
     this.processedData = processedData;
   }
index 2334eb1..c90fbc6 100644 (file)
  * The TYPO3 project - inspiring people to share!
  */
 
-import $ = require('jquery');
 import InteractionRequest = require('./InteractionRequest');
 import InteractionRequestAssignment = require('./InteractionRequestAssignment');
 
 class InteractionRequestMap {
   private assignments: InteractionRequestAssignment[] = [];
 
-  public attachFor(request: InteractionRequest, deferred: any) {
+  public attachFor(request: InteractionRequest, deferred: any): void {
     let targetAssignment = this.getFor(request);
     if (targetAssignment === null) {
       targetAssignment = {request, deferreds: []} as InteractionRequestAssignment;
@@ -27,7 +26,7 @@ class InteractionRequestMap {
     targetAssignment.deferreds.push(deferred);
   }
 
-  public detachFor(request: InteractionRequest) {
+  public detachFor(request: InteractionRequest): void {
     const targetAssignment = this.getFor(request);
     this.assignments = this.assignments.filter(
       (assignment: InteractionRequestAssignment) => assignment === targetAssignment,
@@ -48,7 +47,7 @@ class InteractionRequestMap {
     return targetAssignment;
   }
 
-  public resolveFor(triggerEvent: InteractionRequest) {
+  public resolveFor(triggerEvent: InteractionRequest): boolean {
     const targetAssignment = this.getFor(triggerEvent);
     if (targetAssignment === null) {
       return false;
@@ -60,7 +59,7 @@ class InteractionRequestMap {
     return true;
   }
 
-  public rejectFor(triggerEvent: InteractionRequest) {
+  public rejectFor(triggerEvent: InteractionRequest): boolean {
     const targetAssignment = this.getFor(triggerEvent);
     if (targetAssignment === null) {
       return false;
index eed7e7a..8f60fec 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 import 'bootstrap';
-import $ = require('jquery');
+import * as $ from 'jquery';
 import FormEngine = require('TYPO3/CMS/Backend/FormEngine');
 
 /**
@@ -21,6 +21,22 @@ import FormEngine = require('TYPO3/CMS/Backend/FormEngine');
  * @exports TYPO3/CMS/Backend/FormEngineReview
  */
 class FormEngineReview {
+
+  /**
+   * Class for the toggle button
+   */
+  private toggleButtonClass: string;
+
+  /**
+   * Class for field list items
+   */
+  private fieldListItemClass: string;
+
+  /**
+   * Class of FormEngine labels
+   */
+  private labelSelector: string;
+
   /**
    * Fetches all fields that have a failed validation
    *
@@ -55,21 +71,6 @@ class FormEngineReview {
   }
 
   /**
-   * Class for the toggle button
-   */
-  private toggleButtonClass: string;
-
-  /**
-   * Class for field list items
-   */
-  private fieldListItemClass: string;
-
-  /**
-   * Class of FormEngine labels
-   */
-  private labelSelector: string;
-
-  /**
    * The constructor, set the class properties default values
    */
   constructor() {
@@ -125,7 +126,7 @@ class FormEngineReview {
 
       $toggleButton.removeClass('hidden');
 
-      // Bootstrap has no official API to update the content of a popover w/o destroying it
+      // bootstrap has no official API to update the content of a popover w/o destroying it
       const $popover: any = $toggleButton.data('bs.popover');
       if ($popover) {
         $popover.options.content = $list.wrapAll('<div>').parent().html();
@@ -149,7 +150,7 @@ class FormEngineReview {
     const referenceFieldId: string = $listItem.data('fieldId');
     const $referenceField: any = $('#' + referenceFieldId);
 
-    // Iterate possibly nested tab panels
+    // iterate possibly nested tab panels
     $referenceField.parents('[id][role="tabpanel"]').each(function(this: Element): void {
       $('[aria-controls="' + $(this).attr('id') + '"]').tab('show');
     });
@@ -158,5 +159,5 @@ class FormEngineReview {
   }
 }
 
-// Create an instance and return it
+// create an instance and return it
 export = new FormEngineReview();
index 74abe87..9035c47 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 import 'bootstrap';
-import $ = require('jquery');
+import * as $ from 'jquery';
 import Modal = require('TYPO3/CMS/Backend/Modal');
 import Severity = require('TYPO3/CMS/Backend/Severity');
 
@@ -42,6 +42,31 @@ interface CellInterface {
  */
 export class GridEditor {
 
+  protected colCount: number = 1;
+  protected rowCount: number = 1;
+  protected field: JQuery;
+  protected data: any[];
+  protected nameLabel: string = 'name';
+  protected columnLabel: string = 'columen label';
+  protected targetElement: JQuery;
+  protected defaultCell: object = {spanned: 0, rowspan: 1, colspan: 1, name: '', colpos: '', column: undefined};
+  protected selectorEditor: string = '.t3js-grideditor';
+  protected selectorAddColumn: string = '.t3js-grideditor-addcolumn';
+  protected selectorRemoveColumn: string = '.t3js-grideditor-removecolumn';
+  protected selectorAddRowTop: string = '.t3js-grideditor-addrow-top';
+  protected selectorRemoveRowTop: string = '.t3js-grideditor-removerow-top';
+  protected selectorAddRowBottom: string = '.t3js-grideditor-addrow-bottom';
+  protected selectorRemoveRowBottom: string = '.t3js-grideditor-removerow-bottom';
+  protected selectorLinkEditor: string = '.t3js-grideditor-link-editor';
+  protected selectorLinkExpandRight: string = '.t3js-grideditor-link-expand-right';
+  protected selectorLinkShrinkLeft: string = '.t3js-grideditor-link-shrink-left';
+  protected selectorLinkExpandDown: string = '.t3js-grideditor-link-expand-down';
+  protected selectorLinkShrinkUp: string = '.t3js-grideditor-link-shrink-up';
+  protected selectorDocHeaderSave: string = '.t3js-grideditor-savedok';
+  protected selectorDocHeaderSaveClose: string = '.t3js-grideditor-savedokclose';
+  protected selectorConfigPreview: string = '.t3js-grideditor-preview-config';
+  protected selectorConfigPreviewButton: string = '.t3js-grideditor-preview-button';
+
   /**
    * Remove all markup
    *
@@ -53,31 +78,6 @@ export class GridEditor {
     return $('<p>' + input + '</p>').text();
   }
 
-  protected colCount = 1;
-  protected rowCount = 1;
-  protected field: JQuery;
-  protected data: any[];
-  protected nameLabel = 'name';
-  protected columnLabel = 'columen label';
-  protected targetElement: JQuery;
-  protected defaultCell: object = {spanned: 0, rowspan: 1, colspan: 1, name: '', colpos: '', column: undefined};
-  protected selectorEditor = '.t3js-grideditor';
-  protected selectorAddColumn = '.t3js-grideditor-addcolumn';
-  protected selectorRemoveColumn = '.t3js-grideditor-removecolumn';
-  protected selectorAddRowTop = '.t3js-grideditor-addrow-top';
-  protected selectorRemoveRowTop = '.t3js-grideditor-removerow-top';
-  protected selectorAddRowBottom = '.t3js-grideditor-addrow-bottom';
-  protected selectorRemoveRowBottom = '.t3js-grideditor-removerow-bottom';
-  protected selectorLinkEditor = '.t3js-grideditor-link-editor';
-  protected selectorLinkExpandRight = '.t3js-grideditor-link-expand-right';
-  protected selectorLinkShrinkLeft = '.t3js-grideditor-link-shrink-left';
-  protected selectorLinkExpandDown = '.t3js-grideditor-link-expand-down';
-  protected selectorLinkShrinkUp = '.t3js-grideditor-link-shrink-up';
-  protected selectorDocHeaderSave = '.t3js-grideditor-savedok';
-  protected selectorDocHeaderSaveClose = '.t3js-grideditor-savedokclose';
-  protected selectorConfigPreview = '.t3js-grideditor-preview-config';
-  protected selectorConfigPreviewButton = '.t3js-grideditor-preview-button';
-
   /**
    *
    * @param {GridEditorConfigurationInterface} config
@@ -288,7 +288,7 @@ export class GridEditor {
    * Create a new cell from defaultCell
    * @returns {Object}
    */
-  protected getNewCell() {
+  protected getNewCell(): any {
     return $.extend({}, this.defaultCell);
   }
 
@@ -297,7 +297,7 @@ export class GridEditor {
    *
    * @param data
    */
-  protected writeConfig(data: any) {
+  protected writeConfig(data: any): void {
     this.field.val(data);
     const configLines = data.split('\n');
     let config = '';
@@ -322,7 +322,7 @@ export class GridEditor {
   /**
    * Add a new row at the top
    */
-  protected addRowTop() {
+  protected addRowTop(): void {
     const newRow = [];
     for (let i = 0; i < this.colCount; i++) {
       const newCell = this.getNewCell();
@@ -336,7 +336,7 @@ export class GridEditor {
   /**
    * Add a new row at the bottom
    */
-  protected addRowBottom() {
+  protected addRowBottom(): void {
     const newRow = [];
     for (let i = 0; i < this.colCount; i++) {
       const newCell = this.getNewCell();
index b1970d9..84dd76a 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import $ = require('jquery');
+import * as $ from 'jquery';
 import 'jquery-ui/draggable';
 import 'jquery-ui/resizable';
 import Modal = require('TYPO3/CMS/Backend/Modal');
@@ -74,6 +74,45 @@ interface CropperImageData {
  * @exports TYPO3/CMS/Backend/ImageManipulation
  */
 class ImageManipulation {
+  private trigger: JQuery;
+  private currentModal: JQuery;
+  private cropVariantTriggers: JQuery;
+  private activeCropVariantTrigger: JQuery;
+  private saveButton: JQuery;
+  private previewButton: JQuery;
+  private dismissButton: JQuery;
+  private resetButton: JQuery;
+  private aspectRatioTrigger: JQuery;
+  private cropperCanvas: JQuery;
+  private cropInfo: JQuery;
+  private cropImageContainerSelector: string = '#t3js-crop-image-container';
+  private imageOriginalSizeFactor: number;
+  private cropImageSelector: string = '#t3js-crop-image';
+  private coverAreaSelector: string = '.t3js-cropper-cover-area';
+  private cropInfoSelector: string = '.t3js-cropper-info-crop';
+  private focusAreaSelector: string = '#t3js-cropper-focus-area';
+  private focusArea: any;
+  private cropBox: JQuery;
+  private cropper: any;
+  private currentCropVariant: CropVariant;
+  private data: any;
+  private defaultFocusArea: Area = {
+    height: 1 / 3,
+    width: 1 / 3,
+    x: 0,
+    y: 0,
+  };
+  private defaultOpts: object = {
+    autoCrop: true,
+    autoCropArea: '0.7',
+    dragMode: 'crop',
+    guides: true,
+    responsive: true,
+    viewMode: 1,
+    zoomable: false,
+  };
+  private resizeTimeout: Number = 450;
+
   /**
    * @method isCropAreaEmpty
    * @desc Checks if an area is set or pristine
@@ -128,47 +167,8 @@ class ImageManipulation {
     return JSON.stringify(cropVariants, omitUnused);
   }
 
-  private trigger: JQuery;
-  private currentModal: JQuery;
-  private cropVariantTriggers: JQuery;
-  private activeCropVariantTrigger: JQuery;
-  private saveButton: JQuery;
-  private previewButton: JQuery;
-  private dismissButton: JQuery;
-  private resetButton: JQuery;
-  private aspectRatioTrigger: JQuery;
-  private cropperCanvas: JQuery;
-  private cropInfo: JQuery;
-  private cropImageContainerSelector = '#t3js-crop-image-container';
-  private imageOriginalSizeFactor: number;
-  private cropImageSelector = '#t3js-crop-image';
-  private coverAreaSelector = '.t3js-cropper-cover-area';
-  private cropInfoSelector = '.t3js-cropper-info-crop';
-  private focusAreaSelector = '#t3js-cropper-focus-area';
-  private focusArea: any;
-  private cropBox: JQuery;
-  private cropper: any;
-  private currentCropVariant: CropVariant;
-  private data: any;
-  private defaultFocusArea: Area = {
-    height: 1 / 3,
-    width: 1 / 3,
-    x: 0,
-    y: 0,
-  };
-  private defaultOpts: object = {
-    autoCrop: true,
-    autoCropArea: '0.7',
-    dragMode: 'crop',
-    guides: true,
-    responsive: true,
-    viewMode: 1,
-    zoomable: false,
-  };
-  private resizeTimeout = 450;
-
   constructor() {
-    // Silence is golden
+    // silence is golden
     $(window).resize((): void => {
       if (this.cropper) {
         this.cropper.cropper('destroy');
@@ -204,9 +204,12 @@ class ImageManipulation {
   private initializeCropperModal(): void {
     const image: JQuery = this.currentModal.find(this.cropImageSelector);
     ImagesLoaded(image as any, (): void => {
-      setTimeout((): void => {
-        this.init();
-      }, 100);
+      setTimeout(
+        (): void => {
+          this.init();
+        },
+        100
+      );
     });
   }
 
@@ -268,7 +271,7 @@ class ImageManipulation {
     this.currentModal.on('hide.bs.modal', (e: JQueryEventObject): void => {
       this.destroy();
     });
-    // Do not dismiss the modal when clicking beside it to avoid data loss
+    // do not dismiss the modal when clicking beside it to avoid data loss
     this.currentModal.data('bs.modal').options.backdrop = 'static';
   }
 
@@ -287,9 +290,9 @@ class ImageManipulation {
       throw new TypeError('ImageManipulation: No cropVariants data found for image');
     }
 
-    // If we have data already set we assume an internal reinit eg. after resizing
+    // if we have data already set we assume an internal reinit eg. after resizing
     this.data = $.isEmptyObject(this.data) ? JSON.parse(data) : this.data;
-    // Initialize our class members
+    // initialize our class members
     this.currentModal.find(this.cropImageContainerSelector).css({height: imageHeight, width: imageWidth});
     this.cropVariantTriggers = this.currentModal.find('.t3js-crop-variant-trigger');
     this.activeCropVariantTrigger = this.currentModal.find('.t3js-crop-variant-trigger.is-active');
@@ -335,7 +338,7 @@ class ImageManipulation {
       const temp: CropVariant = $.extend(true, {}, this.currentCropVariant);
       const ratio: Ratio = temp.allowedAspectRatios[ratioId];
       this.setAspectRatio(ratio);
-      // Set data explicitly or setAspectRatio upscales the crop
+      // set data explicitly or setAspectRatio upscales the crop
       this.setCropArea(temp.cropArea);
       this.currentCropVariant = $.extend(true, {}, temp, {selectedRatio: ratioId});
       this.update(this.currentCropVariant);
@@ -383,11 +386,11 @@ class ImageManipulation {
       this.update(this.currentCropVariant);
     });
 
-    // If we start without an cropArea, maximize the cropper
+    // if we start without an cropArea, maximize the cropper
     if (ImageManipulation.isEmptyArea(this.currentCropVariant.cropArea)) {
       this.defaultOpts = $.extend({
         autoCropArea: 1,
-      }, this.defaultOpts);
+      },                          this.defaultOpts);
     }
 
     /**
@@ -417,7 +420,7 @@ class ImageManipulation {
 
     this.imageOriginalSizeFactor = image.data('originalWidth') / imageData.naturalWidth;
 
-    // Iterate over the crop variants and set up their respective preview
+    // iterate over the crop variants and set up their respective preview
     this.cropVariantTriggers.each((index: number, elem: Element): void => {
       const cropVariantId: string = $(elem).attr('data-crop-variant-id');
       const cropArea: Area = this.convertRelativeToAbsoluteCropArea(
@@ -432,21 +435,21 @@ class ImageManipulation {
       this.currentCropVariant.cropArea,
       imageData,
     );
-    // Can't use .t3js-* as selector because it is an extraneous selector
+    // can't use .t3js-* as selector because it is an extraneous selector
     this.cropBox = this.currentModal.find('.cropper-crop-box');
 
     this.setCropArea(this.currentCropVariant.cropArea);
 
-    // Check if new cropVariant has coverAreas
+    // check if new cropVariant has coverAreas
     if (this.currentCropVariant.coverAreas) {
-      // Init or reinit focusArea
+      // init or reinit focusArea
       this.initCoverAreas(this.cropBox, this.currentCropVariant.coverAreas);
     }
-    // Check if new cropVariant has focusArea
+    // check if new cropVariant has focusArea
     if (this.currentCropVariant.focusArea) {
-      // Init or reinit focusArea
+      // init or reinit focusArea
       if (ImageManipulation.isEmptyArea(this.currentCropVariant.focusArea)) {
-        // If an empty focusArea is set initialise it with the default
+        // if an empty focusArea is set initialise it with the default
         this.currentCropVariant.focusArea = $.extend(true, {}, this.defaultFocusArea);
       }
       this.initFocusArea(this.cropBox);
@@ -455,7 +458,7 @@ class ImageManipulation {
 
     if (this.currentCropVariant.selectedRatio) {
       this.setAspectRatio(this.currentCropVariant.allowedAspectRatios[this.currentCropVariant.selectedRatio]);
-      // Set data explicitly or setAspectRatio up-scales the crop
+      // set data explicitly or setAspectRatio up-scales the crop
       this.setCropArea(this.currentCropVariant.cropArea);
       this.currentModal.find(`[data-option='${this.currentCropVariant.selectedRatio}']`).addClass('active');
     }
@@ -524,15 +527,15 @@ class ImageManipulation {
     this.currentCropVariant = $.extend(true, {}, temp, cropVariant);
     this.cropBox.find(this.coverAreaSelector).remove();
 
-    // If the current container has a focus area element, deregister and cleanup prior to initialization
+    // if the current container has a focus area element, deregister and cleanup prior to initialization
     if (this.cropBox.has(this.focusAreaSelector).length) {
       this.focusArea.resizable('destroy').draggable('destroy');
       this.focusArea.remove();
     }
 
-    // Check if new cropVariant has focusArea
+    // check if new cropVariant has focusArea
     if (cropVariant.focusArea) {
-      // Init or reinit focusArea
+      // init or reinit focusArea
       if (ImageManipulation.isEmptyArea(cropVariant.focusArea)) {
         this.currentCropVariant.focusArea = $.extend(true, {}, this.defaultFocusArea);
       }
@@ -540,9 +543,9 @@ class ImageManipulation {
       this.scaleAndMoveFocusArea(this.currentCropVariant.focusArea);
     }
 
-    // Check if new cropVariant has coverAreas
+    // check if new cropVariant has coverAreas
     if (cropVariant.coverAreas) {
-      // Init or reinit focusArea
+      // init or reinit focusArea
       this.initCoverAreas(this.cropBox, this.currentCropVariant.coverAreas);
     }
     this.updatePreviewThumbnail(this.currentCropVariant, this.activeCropVariantTrigger);
@@ -589,7 +592,7 @@ class ImageManipulation {
                 focusArea.x = (fLeft - left) / container.width();
                 focusArea.y = (fTop - top) / container.height();
                 this.updateCropVariantData(this.currentCropVariant);
-              }, revertDelay);
+              },                     revertDelay);
               return true;
             }
             return false;
@@ -688,7 +691,7 @@ class ImageManipulation {
       cropVariantTrigger.find('.t3js-cropper-preview-thumbnail-focus-area');
     const imageData: CropperImageData = this.cropper.cropper('getImageData');
 
-    // Update the position/dimension of the crop area in the preview
+    // update the position/dimension of the crop area in the preview
     cropperPreviewThumbnailCrop.css({
       height: ImageManipulation.toCssPercent(cropVariant.cropArea.height / imageData.naturalHeight),
       left: ImageManipulation.toCssPercent(cropVariant.cropArea.x / imageData.naturalWidth),
@@ -696,7 +699,7 @@ class ImageManipulation {
       width: ImageManipulation.toCssPercent(cropVariant.cropArea.width / imageData.naturalWidth),
     });
 
-    // Show and update focusArea in the preview only if we really have one configured
+    // show and update focusArea in the preview only if we really have one configured
     if (cropVariant.focusArea) {
       cropperPreviewThumbnailFocus.css({
         height: ImageManipulation.toCssPercent(cropVariant.focusArea.height),
@@ -706,7 +709,7 @@ class ImageManipulation {
       });
     }
 
-    // Destruct the preview container's CSS properties
+    // destruct the preview container's CSS properties
     styles = cropperPreviewThumbnailCrop.css([
       'width', 'height', 'left', 'top',
     ]);
@@ -850,7 +853,7 @@ class ImageManipulation {
     const $image: any = this.cropper;
     const imageData: CropperImageData = $image.cropper('getImageData');
 
-    // Iterate over the crop variants and set up their respective preview
+    // iterate over the crop variants and set up their respective preview
     Object.keys(data).forEach((cropVariantId: string) => {
       const cropVariant: CropVariant = data[cropVariantId];
       const cropData: Area = this.convertRelativeToAbsoluteCropArea(cropVariant.cropArea, imageData);
@@ -869,7 +872,7 @@ class ImageManipulation {
       let previewWidth: number = $preview.width();
       let previewHeight: number = $preview.data('preview-height');
 
-      // Adjust aspect ratio of preview width/height
+      // adjust aspect ratio of preview width/height
       const aspectRatio: number = cropData.width / cropData.height;
       const tmpHeight: number = previewWidth / aspectRatio;
       if (tmpHeight > previewHeight) {
@@ -954,7 +957,7 @@ class ImageManipulation {
       clearTimeout(timer);
       timer = setTimeout((): void => {
         fn();
-      }, this.resizeTimeout);
+      },                 this.resizeTimeout);
     });
   }
 }
index bfab200..d7709c5 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 import 'bootstrap';
-import $ = require('jquery');
+import * as $ from 'jquery';
 import 'TYPO3/CMS/Backend/jquery.clearable';
 
 /**
@@ -152,7 +152,7 @@ class BackendLogin {
     $(document).ajaxStart(this.showLoadingIndicator);
     $(this.options.loginForm).on('submit', this.handleSubmit);
 
-    // The Interface selector is not always present, so this check is needed
+    // the Interface selector is not always present, so this check is needed
     if ($(this.options.interfaceField).length > 0) {
       $(document).on('change blur', this.options.interfaceField, this.interfaceSelectorChanged);
     }
index b2f11b5..e8ff938 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 import 'bootstrap';
-import $ = require('jquery');
+import * as $ from 'jquery';
 
 /**
  * Module: TYPO3/CMS/Backend/Popover
@@ -118,7 +118,7 @@ class Popover {
   }
 }
 
-// Create an instance, initialize and return it
+// create an instance, initialize and return it
 const popover: Popover = new Popover();
 popover.initialize();
 
index d05ac01..455d1f0 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import $ = require('jquery');
+import * as $ from 'jquery';
 import Modal = require('TYPO3/CMS/Backend/Modal');
 import Severity = require('TYPO3/CMS/Backend/Severity');
 
index 6c8a83f..999949f 100644 (file)
@@ -112,10 +112,10 @@ try {
     storageObject = top.TYPO3.Storage;
   }
 } catch (e) {
-  // This only happens if the opener, parent or top is some other url (eg a local file)
+  // this only happens if the opener, parent or top is some other url (eg a local file)
   // which loaded the current window. Then the browser's cross domain policy jumps in
   // and raises an exception.
-  // For this case we are safe and we can create our global object below.
+  // for this case we are safe and we can create our global object below.
 }
 
 if (!storageObject) {
index 88a0c71..d66a9a3 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import $ = require('jquery');
+import * as $ from 'jquery';
 
 /**
  * Module: TYPO3/CMS/Backend/Storage/Persistent
index e9f8d7c..5b4f1b6 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 import 'bootstrap';
-import $ = require('jquery');
+import * as $ from 'jquery';
 import Client = require('./Storage/Client');
 
 /**
@@ -21,6 +21,10 @@ import Client = require('./Storage/Client');
  */
 class Tabs {
 
+  public storage: any;
+  protected cacheTimeInSeconds: number = 1800;
+  protected storeLastActiveTab: boolean = true;
+
   /**
    * Resolve timestamp
    */
@@ -28,10 +32,6 @@ class Tabs {
     return Math.round((new Date()).getTime() / 1000);
   }
 
-  public storage: any;
-  protected cacheTimeInSeconds = 1800;
-  protected storeLastActiveTab = true;
-
   constructor() {
     this.storage = Client;
 
@@ -74,7 +74,7 @@ class Tabs {
    * @param {string} id
    * @param {string} target
    */
-  public storeActiveTab(id: string, target: string) {
+  public storeActiveTab(id: string, target: string): void {
     this.storage.set(id, target);
     this.storage.set(id + '.expire', Tabs.getTimestamp() + this.cacheTimeInSeconds);
   }
index a9c7832..b5f0a08 100644 (file)
@@ -11,7 +11,7 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import $ = require('jquery');
+import * as $ from 'jquery';
 import Login = require('./Login');
 
 /**
@@ -21,6 +21,8 @@ import Login = require('./Login');
  */
 class UserPassLogin {
 
+  protected options: any;
+
   /**
    * Checks whether capslock is enabled (returns TRUE if enabled, false otherwise)
    * thanks to http://24ways.org/2007/capturing-caps-lock
@@ -52,8 +54,6 @@ class UserPassLogin {
       || (pressedKeyAsciiCode >= 97 && pressedKeyAsciiCode <= 122 && shiftPressed);
   }
 
-  protected options: any;
-
   constructor() {
     this.options = {
       passwordField: '.t3js-login-password-field',
@@ -69,7 +69,7 @@ class UserPassLogin {
     $usernameField.on('keypress', this.showCapsLockWarning);
     $passwordField.on('keypress', this.showCapsLockWarning);
 
-    // If the login screen is shown in the login_frameset window for re-login,
+    // if the login screen is shown in the login_frameset window for re-login,
     // then try to get the username of the current/former login from opening windows main frame:
     try {
       if (parent.opener
index 61e0580..5fc9dbf 100644 (file)
@@ -46,7 +46,7 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/FormEngine", "bootstr
                         }).text($field.find(me.labelSelector).text()));
                     });
                     $toggleButton.removeClass('hidden');
-                    // Bootstrap has no official API to update the content of a popover w/o destroying it
+                    // bootstrap has no official API to update the content of a popover w/o destroying it
                     var $popover = $toggleButton.data('bs.popover');
                     if ($popover) {
                         $popover.options.content = $list_1.wrapAll('<div>').parent().html();
@@ -68,7 +68,7 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/FormEngine", "bootstr
                 var $listItem = $(e.currentTarget);
                 var referenceFieldId = $listItem.data('fieldId');
                 var $referenceField = $('#' + referenceFieldId);
-                // Iterate possibly nested tab panels
+                // iterate possibly nested tab panels
                 $referenceField.parents('[id][role="tabpanel"]').each(function () {
                     $('[aria-controls="' + $(this).attr('id') + '"]').tab('show');
                 });
index 13cbaf1..fb4f076 100644 (file)
@@ -50,7 +50,7 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Co
                 var imageData = _this.cropper.cropper('getImageData');
                 var image = _this.currentModal.find(_this.cropImageSelector);
                 _this.imageOriginalSizeFactor = image.data('originalWidth') / imageData.naturalWidth;
-                // Iterate over the crop variants and set up their respective preview
+                // iterate over the crop variants and set up their respective preview
                 _this.cropVariantTriggers.each(function (index, elem) {
                     var cropVariantId = $(elem).attr('data-crop-variant-id');
                     var cropArea = _this.convertRelativeToAbsoluteCropArea(_this.data[cropVariantId].cropArea, imageData);
@@ -58,19 +58,19 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Co
                     _this.updatePreviewThumbnail(variant, $(elem));
                 });
                 _this.currentCropVariant.cropArea = _this.convertRelativeToAbsoluteCropArea(_this.currentCropVariant.cropArea, imageData);
-                // Can't use .t3js-* as selector because it is an extraneous selector
+                // can't use .t3js-* as selector because it is an extraneous selector
                 _this.cropBox = _this.currentModal.find('.cropper-crop-box');
                 _this.setCropArea(_this.currentCropVariant.cropArea);
-                // Check if new cropVariant has coverAreas
+                // check if new cropVariant has coverAreas
                 if (_this.currentCropVariant.coverAreas) {
-                    // Init or reinit focusArea
+                    // init or reinit focusArea
                     _this.initCoverAreas(_this.cropBox, _this.currentCropVariant.coverAreas);
                 }
-                // Check if new cropVariant has focusArea
+                // check if new cropVariant has focusArea
                 if (_this.currentCropVariant.focusArea) {
-                    // Init or reinit focusArea
+                    // init or reinit focusArea
                     if (ImageManipulation.isEmptyArea(_this.currentCropVariant.focusArea)) {
-                        // If an empty focusArea is set initialise it with the default
+                        // if an empty focusArea is set initialise it with the default
                         _this.currentCropVariant.focusArea = $.extend(true, {}, _this.defaultFocusArea);
                     }
                     _this.initFocusArea(_this.cropBox);
@@ -78,7 +78,7 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Co
                 }
                 if (_this.currentCropVariant.selectedRatio) {
                     _this.setAspectRatio(_this.currentCropVariant.allowedAspectRatios[_this.currentCropVariant.selectedRatio]);
-                    // Set data explicitly or setAspectRatio up-scales the crop
+                    // set data explicitly or setAspectRatio up-scales the crop
                     _this.setCropArea(_this.currentCropVariant.cropArea);
                     _this.currentModal.find("[data-option='" + _this.currentCropVariant.selectedRatio + "']").addClass('active');
                 }
@@ -124,7 +124,7 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Co
                     _this.focusArea.resizable('option', 'disabled', false);
                 }
             };
-            // Silence is golden
+            // silence is golden
             $(window).resize(function () {
                 if (_this.cropper) {
                     _this.cropper.cropper('destroy');
@@ -271,7 +271,7 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Co
             this.currentModal.on('hide.bs.modal', function (e) {
                 _this.destroy();
             });
-            // Do not dismiss the modal when clicking beside it to avoid data loss
+            // do not dismiss the modal when clicking beside it to avoid data loss
             this.currentModal.data('bs.modal').options.backdrop = 'static';
         };
         /**
@@ -288,9 +288,9 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Co
             if (!data) {
                 throw new TypeError('ImageManipulation: No cropVariants data found for image');
             }
-            // If we have data already set we assume an internal reinit eg. after resizing
+            // if we have data already set we assume an internal reinit eg. after resizing
             this.data = $.isEmptyObject(this.data) ? JSON.parse(data) : this.data;
-            // Initialize our class members
+            // initialize our class members
             this.currentModal.find(this.cropImageContainerSelector).css({ height: imageHeight, width: imageWidth });
             this.cropVariantTriggers = this.currentModal.find('.t3js-crop-variant-trigger');
             this.activeCropVariantTrigger = this.currentModal.find('.t3js-crop-variant-trigger.is-active');
@@ -332,7 +332,7 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Co
                 var temp = $.extend(true, {}, _this.currentCropVariant);
                 var ratio = temp.allowedAspectRatios[ratioId];
                 _this.setAspectRatio(ratio);
-                // Set data explicitly or setAspectRatio upscales the crop
+                // set data explicitly or setAspectRatio upscales the crop
                 _this.setCropArea(temp.cropArea);
                 _this.currentCropVariant = $.extend(true, {}, temp, { selectedRatio: ratioId });
                 _this.update(_this.currentCropVariant);
@@ -376,7 +376,7 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Co
                 _this.currentCropVariant = $.extend(true, {}, resetCropVariant, { cropArea: absoluteCropArea });
                 _this.update(_this.currentCropVariant);
             });
-            // If we start without an cropArea, maximize the cropper
+            // if we start without an cropArea, maximize the cropper
             if (ImageManipulation.isEmptyArea(this.currentCropVariant.cropArea)) {
                 this.defaultOpts = $.extend({
                     autoCropArea: 1,
@@ -414,23 +414,23 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Co
             this.setCropArea(temp.cropArea);
             this.currentCropVariant = $.extend(true, {}, temp, cropVariant);
             this.cropBox.find(this.coverAreaSelector).remove();
-            // If the current container has a focus area element, deregister and cleanup prior to initialization
+            // if the current container has a focus area element, deregister and cleanup prior to initialization
             if (this.cropBox.has(this.focusAreaSelector).length) {
                 this.focusArea.resizable('destroy').draggable('destroy');
                 this.focusArea.remove();
             }
-            // Check if new cropVariant has focusArea
+            // check if new cropVariant has focusArea
             if (cropVariant.focusArea) {
-                // Init or reinit focusArea
+                // init or reinit focusArea
                 if (ImageManipulation.isEmptyArea(cropVariant.focusArea)) {
                     this.currentCropVariant.focusArea = $.extend(true, {}, this.defaultFocusArea);
                 }
                 this.initFocusArea(this.cropBox);
                 this.scaleAndMoveFocusArea(this.currentCropVariant.focusArea);
             }
-            // Check if new cropVariant has coverAreas
+            // check if new cropVariant has coverAreas
             if (cropVariant.coverAreas) {
-                // Init or reinit focusArea
+                // init or reinit focusArea
                 this.initCoverAreas(this.cropBox, this.currentCropVariant.coverAreas);
             }
             this.updatePreviewThumbnail(this.currentCropVariant, this.activeCropVariantTrigger);
@@ -563,14 +563,14 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Co
             var cropperPreviewThumbnailImage = cropVariantTrigger.find('.t3js-cropper-preview-thumbnail-crop-image');
             var cropperPreviewThumbnailFocus = cropVariantTrigger.find('.t3js-cropper-preview-thumbnail-focus-area');
             var imageData = this.cropper.cropper('getImageData');
-            // Update the position/dimension of the crop area in the preview
+            // update the position/dimension of the crop area in the preview
             cropperPreviewThumbnailCrop.css({
                 height: ImageManipulation.toCssPercent(cropVariant.cropArea.height / imageData.naturalHeight),
                 left: ImageManipulation.toCssPercent(cropVariant.cropArea.x / imageData.naturalWidth),
                 top: ImageManipulation.toCssPercent(cropVariant.cropArea.y / imageData.naturalHeight),
                 width: ImageManipulation.toCssPercent(cropVariant.cropArea.width / imageData.naturalWidth),
             });
-            // Show and update focusArea in the preview only if we really have one configured
+            // show and update focusArea in the preview only if we really have one configured
             if (cropVariant.focusArea) {
                 cropperPreviewThumbnailFocus.css({
                     height: ImageManipulation.toCssPercent(cropVariant.focusArea.height),
@@ -579,7 +579,7 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Co
                     width: ImageManipulation.toCssPercent(cropVariant.focusArea.width),
                 });
             }
-            // Destruct the preview container's CSS properties
+            // destruct the preview container's CSS properties
             styles = cropperPreviewThumbnailCrop.css([
                 'width', 'height', 'left', 'top',
             ]);
@@ -715,7 +715,7 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Co
             var _this = this;
             var $image = this.cropper;
             var imageData = $image.cropper('getImageData');
-            // Iterate over the crop variants and set up their respective preview
+            // iterate over the crop variants and set up their respective preview
             Object.keys(data).forEach(function (cropVariantId) {
                 var cropVariant = data[cropVariantId];
                 var cropData = _this.convertRelativeToAbsoluteCropArea(cropVariant.cropArea, imageData);
@@ -730,7 +730,7 @@ define(["require", "exports", "jquery", "TYPO3/CMS/Backend/Modal", "TYPO3/CMS/Co
                 }
                 var previewWidth = $preview.width();
                 var previewHeight = $preview.data('preview-height');
-                // Adjust aspect ratio of preview width/height
+                // adjust aspect ratio of preview width/height
                 var aspectRatio = cropData.width / cropData.height;
                 var tmpHeight = previewWidth / aspectRatio;
                 if (tmpHeight > previewHeight) {
index 94c34ea..5ed8919 100644 (file)
@@ -117,7 +117,7 @@ define(["require", "exports", "jquery", "bootstrap", "TYPO3/CMS/Backend/jquery.c
             this.initializeEvents = function () {
                 $(document).ajaxStart(_this.showLoadingIndicator);
                 $(_this.options.loginForm).on('submit', _this.handleSubmit);
-                // The Interface selector is not always present, so this check is needed
+                // the Interface selector is not always present, so this check is needed
                 if ($(_this.options.interfaceField).length > 0) {
                     $(document).on('change blur', _this.options.interfaceField, _this.interfaceSelectorChanged);
                 }
index 4e809df..95fc604 100644 (file)
@@ -109,7 +109,7 @@ define(["require", "exports", "jquery", "bootstrap"], function (require, exports
         };
         return Popover;
     }());
-    // Create an instance, initialize and return it
+    // create an instance, initialize and return it
     var popover = new Popover();
     popover.initialize();
     // @deprecated since TYPO3 v9, will be removed in TYPO3 v10 prevent global object usage
index 5c891e0..83c9af8 100644 (file)
@@ -104,10 +104,10 @@ define(["require", "exports", "./Storage/Client", "./Storage/Persistent"], funct
         }
     }
     catch (e) {
-        // This only happens if the opener, parent or top is some other url (eg a local file)
+        // this only happens if the opener, parent or top is some other url (eg a local file)
         // which loaded the current window. Then the browser's cross domain policy jumps in
         // and raises an exception.
-        // For this case we are safe and we can create our global object below.
+        // for this case we are safe and we can create our global object below.
     }
     if (!storageObject) {
         storageObject = new Storage();
index 00fe2a1..df99e71 100644 (file)
@@ -47,7 +47,7 @@ define(["require", "exports", "jquery", "./Login"], function (require, exports,
             var $passwordField = $(this.options.passwordField);
             $usernameField.on('keypress', this.showCapsLockWarning);
             $passwordField.on('keypress', this.showCapsLockWarning);
-            // If the login screen is shown in the login_frameset window for re-login,
+            // if the login screen is shown in the login_frameset window for re-login,
             // then try to get the username of the current/former login from opening windows main frame:
             try {
                 if (parent.opener
index dd16731..fbf607d 100644 (file)
@@ -15,12 +15,12 @@ import {BackendException} from 'TYPO3/CMS/Backend/BackendException';
 
 describe('TYPO3/CMS/Backend/BackendException', () => {
     it('sets exception message', () => {
-        const backendException = new BackendException('some message');
+        const backendException: BackendException = new BackendException('some message');
         expect(backendException.message).toBe('some message');
     });
 
     it('sets exception code', () => {
-        const backendException = new BackendException('', 12345);
+        const backendException: BackendException = new BackendException('', 12345);
         expect(backendException.code).toBe(12345);
     });
 });
index a822d92..de6bcc5 100644 (file)
@@ -11,7 +11,6 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import $ = require('jquery');
 import {GridEditor} from 'TYPO3/CMS/Backend/GridEditor';
 
 describe('TYPO3/CMS/Backend/GridEditorTest:', () => {
index b04d4cb..823732a 100644 (file)
@@ -11,8 +11,8 @@
  * The TYPO3 project - inspiring people to share!
  */
 
-import CodeMirror = require('cm/lib/codemirror');
-import $ = require('jquery');
+import * as CodeMirror from 'cm/lib/codemirror';
+import * as $ from 'jquery';
 
 /**
  * Module: TYPO3/CMS/T3editor/T3editor
@@ -48,7 +48,7 @@ class T3editor {
    * Initializes CodeMirror on available texteditors
    */
   public findAndInitializeEditors(): void {
-    $(document).find('textarea.t3editor').each(function(this: Element) {
+    $(document).find('textarea.t3editor').each(function(this: Element): void {
       const $textarea = $(this);
 
       if (!$textarea.prop('is_t3editor')) {
@@ -57,7 +57,7 @@ class T3editor {
         const addons = $.merge([modeParts.join('/')], JSON.parse(config.addons));
         const options = JSON.parse(config.options);
 
-        // Load mode + registered addons
+        // load mode + registered addons
         require(addons, (): void => {
           const cm = CodeMirror.fromTextArea($textarea.get(0), {
             extraKeys: {
@@ -77,7 +77,7 @@ class T3editor {
             mode: modeParts[modeParts.length - 1],
           });
 
-          // Set options
+          // set options
           $.each(options, (key: string, value: any): void => {
             cm.setOption(key, value);
           });
@@ -106,5 +106,5 @@ class T3editor {
   }
 }
 
-// Create an instance and return it
+// create an instance and return it
 export = new T3editor();
index 62b26d7..80d6072 100644 (file)
@@ -47,7 +47,7 @@ define(["require", "exports", "cm/lib/codemirror", "jquery"], function (require,
                     var modeParts_1 = config.mode.split('/');
                     var addons = $.merge([modeParts_1.join('/')], JSON.parse(config.addons));
                     var options_1 = JSON.parse(config.options);
-                    // Load mode + registered addons
+                    // load mode + registered addons
                     require(addons, function () {
                         var cm = CodeMirror.fromTextArea($textarea.get(0), {
                             extraKeys: {
@@ -66,7 +66,7 @@ define(["require", "exports", "cm/lib/codemirror", "jquery"], function (require,
                             lineWrapping: true,
                             mode: modeParts_1[modeParts_1.length - 1],
                         });
-                        // Set options
+                        // set options
                         $.each(options_1, function (key, value) {
                             cm.setOption(key, value);
                         });