Code Duplication    Length = 22-22 lines in 2 locations

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

@@ 3115-3136 (lines=22) @@
3112
        }
3113
        return self;
3114
      },
3115
      replace: function (oldItem, newItem) {
3116
        var ctrlElm;
3117
        var items = this.items();
3118
        var i = items.length;
3119
        while (i--) {
3120
          if (items[i] === oldItem) {
3121
            items[i] = newItem;
3122
            break;
3123
          }
3124
        }
3125
        if (i >= 0) {
3126
          ctrlElm = newItem.getEl();
3127
          if (ctrlElm) {
3128
            ctrlElm.parentNode.removeChild(ctrlElm);
3129
          }
3130
          ctrlElm = oldItem.getEl();
3131
          if (ctrlElm) {
3132
            ctrlElm.parentNode.removeChild(ctrlElm);
3133
          }
3134
        }
3135
        newItem.parent(this);
3136
      },
3137
      create: function (items) {
3138
        var self = this;
3139
        var settings;

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

@@ 3089-3110 (lines=22) @@
3086
        }
3087
        return self;
3088
      },
3089
      replace: function (oldItem, newItem) {
3090
        var ctrlElm;
3091
        var items = this.items();
3092
        var i = items.length;
3093
        while (i--) {
3094
          if (items[i] === oldItem) {
3095
            items[i] = newItem;
3096
            break;
3097
          }
3098
        }
3099
        if (i >= 0) {
3100
          ctrlElm = newItem.getEl();
3101
          if (ctrlElm) {
3102
            ctrlElm.parentNode.removeChild(ctrlElm);
3103
          }
3104
          ctrlElm = oldItem.getEl();
3105
          if (ctrlElm) {
3106
            ctrlElm.parentNode.removeChild(ctrlElm);
3107
          }
3108
        }
3109
        newItem.parent(this);
3110
      },
3111
      create: function (items) {
3112
        var self = this;
3113
        var settings;