Code Duplication    Length = 58-58 lines in 2 locations

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

@@ 4162-4219 (lines=58) @@
4159
      }
4160
    });
4161
4162
    function NotificationManagerImpl (editor) {
4163
      var getEditorContainer = function (editor) {
4164
        return editor.inline ? editor.getElement() : editor.getContentAreaContainer();
4165
      };
4166
      var getContainerWidth = function () {
4167
        var container = getEditorContainer(editor);
4168
        return funcs.getSize(container).width;
4169
      };
4170
      var prePositionNotifications = function (notifications) {
4171
        each(notifications, function (notification) {
4172
          notification.moveTo(0, 0);
4173
        });
4174
      };
4175
      var positionNotifications = function (notifications) {
4176
        if (notifications.length > 0) {
4177
          var firstItem = notifications.slice(0, 1)[0];
4178
          var container = getEditorContainer(editor);
4179
          firstItem.moveRel(container, 'tc-tc');
4180
          each(notifications, function (notification, index) {
4181
            if (index > 0) {
4182
              notification.moveRel(notifications[index - 1].getEl(), 'bc-tc');
4183
            }
4184
          });
4185
        }
4186
      };
4187
      var reposition = function (notifications) {
4188
        prePositionNotifications(notifications);
4189
        positionNotifications(notifications);
4190
      };
4191
      var open = function (args, closeCallback) {
4192
        var extendedArgs = global$2.extend(args, { maxWidth: getContainerWidth() });
4193
        var notif = new Notification(extendedArgs);
4194
        notif.args = extendedArgs;
4195
        if (extendedArgs.timeout > 0) {
4196
          notif.timer = setTimeout(function () {
4197
            notif.close();
4198
            closeCallback();
4199
          }, extendedArgs.timeout);
4200
        }
4201
        notif.on('close', function () {
4202
          closeCallback();
4203
        });
4204
        notif.renderTo();
4205
        return notif;
4206
      };
4207
      var close = function (notification) {
4208
        notification.close();
4209
      };
4210
      var getArgs = function (notification) {
4211
        return notification.args;
4212
      };
4213
      return {
4214
        open: open,
4215
        close: close,
4216
        reposition: reposition,
4217
        getArgs: getArgs
4218
      };
4219
    }
4220
4221
    var windows = [];
4222
    var oldMetaValue = '';

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

@@ 2682-2739 (lines=58) @@
2679
      }
2680
    });
2681
2682
    function NotificationManagerImpl (editor) {
2683
      var getEditorContainer = function (editor) {
2684
        return editor.inline ? editor.getElement() : editor.getContentAreaContainer();
2685
      };
2686
      var getContainerWidth = function () {
2687
        var container = getEditorContainer(editor);
2688
        return funcs.getSize(container).width;
2689
      };
2690
      var prePositionNotifications = function (notifications) {
2691
        each(notifications, function (notification) {
2692
          notification.moveTo(0, 0);
2693
        });
2694
      };
2695
      var positionNotifications = function (notifications) {
2696
        if (notifications.length > 0) {
2697
          var firstItem = notifications.slice(0, 1)[0];
2698
          var container = getEditorContainer(editor);
2699
          firstItem.moveRel(container, 'tc-tc');
2700
          each(notifications, function (notification, index) {
2701
            if (index > 0) {
2702
              notification.moveRel(notifications[index - 1].getEl(), 'bc-tc');
2703
            }
2704
          });
2705
        }
2706
      };
2707
      var reposition = function (notifications) {
2708
        prePositionNotifications(notifications);
2709
        positionNotifications(notifications);
2710
      };
2711
      var open = function (args, closeCallback) {
2712
        var extendedArgs = global$4.extend(args, { maxWidth: getContainerWidth() });
2713
        var notif = new Notification(extendedArgs);
2714
        notif.args = extendedArgs;
2715
        if (extendedArgs.timeout > 0) {
2716
          notif.timer = setTimeout(function () {
2717
            notif.close();
2718
            closeCallback();
2719
          }, extendedArgs.timeout);
2720
        }
2721
        notif.on('close', function () {
2722
          closeCallback();
2723
        });
2724
        notif.renderTo();
2725
        return notif;
2726
      };
2727
      var close = function (notification) {
2728
        notification.close();
2729
      };
2730
      var getArgs = function (notification) {
2731
        return notification.args;
2732
      };
2733
      return {
2734
        open: open,
2735
        close: close,
2736
        reposition: reposition,
2737
        getArgs: getArgs
2738
      };
2739
    }
2740
2741
    function getDocumentSize(doc) {
2742
      var documentElement, body, scrollWidth, clientWidth;