Code Duplication    Length = 57-57 lines in 2 locations

public/js/tinymce/themes/modern/theme.js 1 location

@@ 3290-3346 (lines=57) @@
3287
        }
3288
      }
3289
    }
3290
    function DragHelper (id, settings) {
3291
      var $eventOverlay;
3292
      var doc = settings.document || document;
3293
      var downButton;
3294
      var start, stop$$1, drag, startX, startY;
3295
      settings = settings || {};
3296
      var handleElement = doc.getElementById(settings.handle || id);
3297
      start = function (e) {
3298
        var docSize = getDocumentSize(doc);
3299
        var handleElm, cursor;
3300
        updateWithTouchData(e);
3301
        e.preventDefault();
3302
        downButton = e.button;
3303
        handleElm = handleElement;
3304
        startX = e.screenX;
3305
        startY = e.screenY;
3306
        if (window.getComputedStyle) {
3307
          cursor = window.getComputedStyle(handleElm, null).getPropertyValue('cursor');
3308
        } else {
3309
          cursor = handleElm.runtimeStyle.cursor;
3310
        }
3311
        $eventOverlay = global$9('<div></div>').css({
3312
          position: 'absolute',
3313
          top: 0,
3314
          left: 0,
3315
          width: docSize.width,
3316
          height: docSize.height,
3317
          zIndex: 2147483647,
3318
          opacity: 0.0001,
3319
          cursor: cursor
3320
        }).appendTo(doc.body);
3321
        global$9(doc).on('mousemove touchmove', drag).on('mouseup touchend', stop$$1);
3322
        settings.start(e);
3323
      };
3324
      drag = function (e) {
3325
        updateWithTouchData(e);
3326
        if (e.button !== downButton) {
3327
          return stop$$1(e);
3328
        }
3329
        e.deltaX = e.screenX - startX;
3330
        e.deltaY = e.screenY - startY;
3331
        e.preventDefault();
3332
        settings.drag(e);
3333
      };
3334
      stop$$1 = function (e) {
3335
        updateWithTouchData(e);
3336
        global$9(doc).off('mousemove touchmove', drag).off('mouseup touchend', stop$$1);
3337
        $eventOverlay.remove();
3338
        if (settings.stop) {
3339
          settings.stop(e);
3340
        }
3341
      };
3342
      this.destroy = function () {
3343
        global$9(handleElement).off();
3344
      };
3345
      global$9(handleElement).on('mousedown touchstart', start);
3346
    }
3347
3348
    var Scrollable = {
3349
      init: function () {

public/js/tinymce/themes/inlite/theme.js 1 location

@@ 2767-2823 (lines=57) @@
2764
        }
2765
      }
2766
    }
2767
    function DragHelper (id, settings) {
2768
      var $eventOverlay;
2769
      var doc = settings.document || document;
2770
      var downButton;
2771
      var start, stop$$1, drag, startX, startY;
2772
      settings = settings || {};
2773
      var handleElement = doc.getElementById(settings.handle || id);
2774
      start = function (e) {
2775
        var docSize = getDocumentSize(doc);
2776
        var handleElm, cursor;
2777
        updateWithTouchData(e);
2778
        e.preventDefault();
2779
        downButton = e.button;
2780
        handleElm = handleElement;
2781
        startX = e.screenX;
2782
        startY = e.screenY;
2783
        if (window.getComputedStyle) {
2784
          cursor = window.getComputedStyle(handleElm, null).getPropertyValue('cursor');
2785
        } else {
2786
          cursor = handleElm.runtimeStyle.cursor;
2787
        }
2788
        $eventOverlay = global$7('<div></div>').css({
2789
          position: 'absolute',
2790
          top: 0,
2791
          left: 0,
2792
          width: docSize.width,
2793
          height: docSize.height,
2794
          zIndex: 2147483647,
2795
          opacity: 0.0001,
2796
          cursor: cursor
2797
        }).appendTo(doc.body);
2798
        global$7(doc).on('mousemove touchmove', drag).on('mouseup touchend', stop$$1);
2799
        settings.start(e);
2800
      };
2801
      drag = function (e) {
2802
        updateWithTouchData(e);
2803
        if (e.button !== downButton) {
2804
          return stop$$1(e);
2805
        }
2806
        e.deltaX = e.screenX - startX;
2807
        e.deltaY = e.screenY - startY;
2808
        e.preventDefault();
2809
        settings.drag(e);
2810
      };
2811
      stop$$1 = function (e) {
2812
        updateWithTouchData(e);
2813
        global$7(doc).off('mousemove touchmove', drag).off('mouseup touchend', stop$$1);
2814
        $eventOverlay.remove();
2815
        if (settings.stop) {
2816
          settings.stop(e);
2817
        }
2818
      };
2819
      this.destroy = function () {
2820
        global$7(handleElement).off();
2821
      };
2822
      global$7(handleElement).on('mousedown touchstart', start);
2823
    }
2824
2825
    var global$b = tinymce.util.Tools.resolve('tinymce.ui.Factory');
2826