Web Inspector: move sources panel out of experimental.
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 May 2012 09:30:02 +0000 (09:30 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 May 2012 09:30:02 +0000 (09:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86997

Reviewed by Yury Semikhatsky.

This change moves sources panel out of experimental, removes revision support from the resources panel.

* English.lproj/localizedStrings.js:
* inspector/front-end/JavaScriptSourceFrame.js:
(WebInspector.JavaScriptSourceFrame.prototype._onContentChanged):
(WebInspector.JavaScriptSourceFrame.prototype._continueToLine):
* inspector/front-end/ResourceView.js:
* inspector/front-end/ResourcesPanel.js:
(WebInspector.ResourcesPanel.prototype._showResourceView):
(WebInspector.FrameTreeElement.prototype.appendResource):
(WebInspector.FrameResourceTreeElement):
(WebInspector.FrameResourceTreeElement.prototype.sourceView):
* inspector/front-end/ScriptsNavigator.js:
(WebInspector.ScriptsNavigator):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype.get toolbarItemLabel):
(WebInspector.ScriptsPanel.prototype.appendApplicableItems):
* inspector/front-end/Settings.js:
(WebInspector.ExperimentsSettings):
* inspector/front-end/SourceFrame.js:
(WebInspector.SourceFrame.prototype._setTextViewerDecorations):
* inspector/front-end/textViewer.css:
* inspector/front-end/utilities.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@117751 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/English.lproj/localizedStrings.js
Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
Source/WebCore/inspector/front-end/ResourceView.js
Source/WebCore/inspector/front-end/ResourcesPanel.js
Source/WebCore/inspector/front-end/ScriptsNavigator.js
Source/WebCore/inspector/front-end/ScriptsPanel.js
Source/WebCore/inspector/front-end/Settings.js
Source/WebCore/inspector/front-end/SourceFrame.js
Source/WebCore/inspector/front-end/textViewer.css
Source/WebCore/inspector/front-end/utilities.js

index a26775a..e36c0f2 100644 (file)
@@ -1,5 +1,36 @@
 2012-05-21  Pavel Feldman  <pfeldman@chromium.org>
 
+        Web Inspector: move sources panel out of experimental.
+        https://bugs.webkit.org/show_bug.cgi?id=86997
+
+        Reviewed by Yury Semikhatsky.
+
+        This change moves sources panel out of experimental, removes revision support from the resources panel.
+
+        * English.lproj/localizedStrings.js:
+        * inspector/front-end/JavaScriptSourceFrame.js:
+        (WebInspector.JavaScriptSourceFrame.prototype._onContentChanged):
+        (WebInspector.JavaScriptSourceFrame.prototype._continueToLine):
+        * inspector/front-end/ResourceView.js:
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype._showResourceView):
+        (WebInspector.FrameTreeElement.prototype.appendResource):
+        (WebInspector.FrameResourceTreeElement):
+        (WebInspector.FrameResourceTreeElement.prototype.sourceView):
+        * inspector/front-end/ScriptsNavigator.js:
+        (WebInspector.ScriptsNavigator):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.get toolbarItemLabel):
+        (WebInspector.ScriptsPanel.prototype.appendApplicableItems):
+        * inspector/front-end/Settings.js:
+        (WebInspector.ExperimentsSettings):
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype._setTextViewerDecorations):
+        * inspector/front-end/textViewer.css:
+        * inspector/front-end/utilities.js:
+
+2012-05-21  Pavel Feldman  <pfeldman@chromium.org>
+
         Web Inspector: implement revision history view.
         https://bugs.webkit.org/show_bug.cgi?id=86966
 
index 9cf5951..a9f83f0 100644 (file)
Binary files a/Source/WebCore/English.lproj/localizedStrings.js and b/Source/WebCore/English.lproj/localizedStrings.js differ
index c11a48c..7ce8d15 100644 (file)
@@ -115,7 +115,6 @@ WebInspector.JavaScriptSourceFrame.prototype = {
             for (var i = 0; i < breakpointLocations.length; ++i)
                 breakpointLocations[i].breakpoint.remove();
             this.setContent(content, false, this._uiSourceCode.mimeType());
-            this._updateBreakpointsAfterLiveEdit(oldContent, content, breakpointLocations);
         }
     },
 
@@ -550,38 +549,6 @@ WebInspector.JavaScriptSourceFrame.prototype = {
     {
         var rawLocation = this._uiSourceCode.uiLocationToRawLocation(lineNumber, 0);
         WebInspector.debuggerModel.continueToLocation(rawLocation);
-    },
-
-    /**
-     * @param {string} oldSource
-     * @param {string} newSource
-     * @param {Array.<Object>} breakpointLocations
-     */
-    _updateBreakpointsAfterLiveEdit: function(oldSource, newSource, breakpointLocations)
-    {
-        // Clear and re-create breakpoints according to text diff.
-        var diff = Array.diff(oldSource.split("\n"), newSource.split("\n"));
-        for (var i = 0; i < breakpointLocations.length; ++i) {
-            var lineNumber = breakpointLocations[i].uiLocation.lineNumber;
-            var newLineNumber = diff.left[lineNumber].row;
-            if (newLineNumber === undefined) {
-                for (var i = lineNumber - 1; i >= 0; --i) {
-                    if (diff.left[i].row === undefined)
-                        continue;
-                    var shiftedLineNumber = diff.left[i].row + lineNumber - i;
-                    if (shiftedLineNumber < diff.right.length) {
-                        var originalLineNumber = diff.right[shiftedLineNumber].row;
-                        if (originalLineNumber === lineNumber || originalLineNumber === undefined)
-                            newLineNumber = shiftedLineNumber;
-                    }
-                    break;
-                }
-            }
-            if (newLineNumber !== undefined) {
-                var breakpoint = breakpointLocations[i].breakpoint;
-                this._setBreakpoint(newLineNumber, breakpoint.condition(), breakpoint.enabled());
-            }
-        }
     }
 }
 
index 4749794..73dce8f 100644 (file)
@@ -100,75 +100,3 @@ WebInspector.ResourceSourceFrame.prototype = {
 }
 
 WebInspector.ResourceSourceFrame.prototype.__proto__ = WebInspector.SourceFrame.prototype;
-
-/**
- * @constructor
- * @extends {WebInspector.ResourceSourceFrame}
- */
-WebInspector.EditableResourceSourceFrame = function(resource)
-{
-    WebInspector.ResourceSourceFrame.call(this, resource);
-}
-
-WebInspector.EditableResourceSourceFrame.Events = {
-    TextEdited: "TextEdited"
-}
-
-WebInspector.EditableResourceSourceFrame.prototype = {
-    /**
-     * @return {boolean}
-     */
-    canEditSource: function()
-    {
-        //FIXME: make live edit stop using resource content binding.
-        return this._resource.isEditable() && this._resource.type === WebInspector.resourceTypes.Stylesheet;
-    },
-
-    /**
-     * @param {string} text
-     */
-    commitEditing: function(text)
-    {
-        this._clearIncrementalUpdateTimer();
-        var majorChange = true;
-        this._settingContent = true;
-        function callbackWrapper(text)
-        {
-            delete this._settingContent;
-            this.dispatchEventToListeners(WebInspector.EditableResourceSourceFrame.Events.TextEdited, this);
-        }
-        this.resource.setContent(text, majorChange, callbackWrapper.bind(this));
-    },
-    
-    afterTextChanged: function(oldRange, newRange)
-    {
-        function commitIncrementalEdit()
-        {
-            var majorChange = false;
-            this.resource.setContent(this._textModel.text, majorChange, function() {});
-            this.dispatchEventToListeners(WebInspector.EditableResourceSourceFrame.Events.TextEdited, this);
-        }
-        const updateTimeout = 200;
-        this._incrementalUpdateTimer = setTimeout(commitIncrementalEdit.bind(this), updateTimeout);
-    },
-
-    _clearIncrementalUpdateTimer: function()
-    {
-        if (this._incrementalUpdateTimer)
-            clearTimeout(this._incrementalUpdateTimer);
-        delete this._incrementalUpdateTimer;
-    },
-
-    _contentChanged: function(event)
-    {
-        if (!this._settingContent)
-            WebInspector.ResourceSourceFrame.prototype._contentChanged.call(this, event);
-    },
-
-    isDirty: function()
-    {
-        return this._resource.content !== this.textModel.text;
-    }
-}
-
-WebInspector.EditableResourceSourceFrame.prototype.__proto__ = WebInspector.ResourceSourceFrame.prototype;
index 0b8351b..c711903 100644 (file)
@@ -372,7 +372,6 @@ WebInspector.ResourcesPanel.prototype = {
         }
         if (view.searchCanceled)
             view.searchCanceled();
-        this._fetchAndApplyDiffMarkup(view, resource);
         this._innerShowView(view);
     },
 
@@ -387,49 +386,6 @@ WebInspector.ResourcesPanel.prototype = {
         return WebInspector.ResourceView.nonSourceViewForResource(resource);
     },
 
-    _showRevisionView: function(revision)
-    {
-        var view = this._sourceViewForRevision(revision);
-        this._fetchAndApplyDiffMarkup(view, revision.resource, revision);
-        this._innerShowView(view);
-    },
-
-    _sourceViewForRevision: function(revision)
-    {
-        var treeElement = this._findTreeElementForRevision(revision);
-        return treeElement.sourceView();
-    },
-
-    /**
-     * @param {WebInspector.ResourceRevision=} revision
-     */
-    _fetchAndApplyDiffMarkup: function(view, resource, revision)
-    {
-        var baseRevision = resource.history[0];
-        if (!baseRevision)
-            return;
-        if (!(view instanceof WebInspector.SourceFrame))
-            return;
-
-        baseRevision.requestContent(step1.bind(this));
-
-        function step1(baseContent)
-        {
-            (revision ? revision : resource).requestContent(step2.bind(this, baseContent));
-        }
-
-        function step2(baseContent, revisionContent)
-        {
-            this._applyDiffMarkup(view, baseContent, revisionContent);
-        }
-    },
-
-    _applyDiffMarkup: function(view, baseContent, newContent)
-    {
-        var diffData = TextDiff.compute(baseContent, newContent);
-        view.markDiff(diffData);
-    },
-
     /**
      * @param {string=} tableName
      */
@@ -833,21 +789,6 @@ WebInspector.ResourcesPanel.prototype = {
         return this.sidebarTree.findTreeElement(resource, isAncestor, getParent);
     },
 
-    _findTreeElementForRevision: function(revision)
-    {
-        function isAncestor(ancestor, object)
-        {
-            return false;
-        }
-
-        function getParent(object)
-        {
-            return null;
-        }
-
-        return this.sidebarTree.findTreeElement(revision, isAncestor, getParent);
-    },
-
     showView: function(view)
     {
         if (view)
@@ -1125,8 +1066,6 @@ WebInspector.FrameTreeElement.prototype = {
         }
         var resourceTreeElement = new WebInspector.FrameResourceTreeElement(this._storagePanel, resource);
         this._insertInPresentationOrder(categoryElement, resourceTreeElement);
-        resourceTreeElement._populateRevisions();
-
         this._treeElementForResource[resource.url] = resourceTreeElement;
     },
 
@@ -1193,7 +1132,6 @@ WebInspector.FrameResourceTreeElement = function(storagePanel, resource)
     this._resource = resource;
     this._resource.addEventListener(WebInspector.Resource.Events.MessageAdded, this._consoleMessageAdded, this);
     this._resource.addEventListener(WebInspector.Resource.Events.MessagesCleared, this._consoleMessagesCleared, this);
-    this._resource.addEventListener(WebInspector.Resource.Events.RevisionAdded, this._revisionAdded, this);
     this.tooltip = resource.url;
 }
 
@@ -1374,42 +1312,16 @@ WebInspector.FrameResourceTreeElement.prototype = {
         this._updateErrorsAndWarningsBubbles();
     },
 
-    _populateRevisions: function()
-    {
-        for (var i = 0; i < this._resource.history.length; ++i)
-            this._appendRevision(this._resource.history[i]);
-    },
-
-    _revisionAdded: function(event)
-    {
-        this._appendRevision(event.data);
-    },
-
-    _appendRevision: function(revision)
-    {
-        this.subtitleText = "";
-        this.insertChild(new WebInspector.ResourceRevisionTreeElement(this._storagePanel, revision), 0);
-        if (this._sourceView === this._storagePanel.visibleView)
-            this._storagePanel._showResourceView(this._resource);
-    },
-
     sourceView: function()
     {
         if (!this._sourceView) {
-            this._sourceView = new WebInspector.EditableResourceSourceFrame(this._resource);
+            this._sourceView = new WebInspector.ResourceSourceFrame(this._resource);
             if (this._resource.messages) {
                 for (var i = 0; i < this._resource.messages.length; i++)
                     this._sourceView.addMessage(this._resource.messages[i]);
             }
-            this._sourceView.addEventListener(WebInspector.EditableResourceSourceFrame.Events.TextEdited, this._sourceViewTextEdited, this);
         }
         return this._sourceView;
-    },
-
-    _sourceViewTextEdited: function(event)
-    {
-        var sourceFrame = event.data;
-        this.subtitleText = sourceFrame.isDirty() ? "*" : "";
     }
 }
 
@@ -2001,82 +1913,6 @@ WebInspector.ApplicationCacheFrameTreeElement.prototype.__proto__ = WebInspector
 
 /**
  * @constructor
- * @extends {WebInspector.BaseStorageTreeElement}
- */
-WebInspector.ResourceRevisionTreeElement = function(storagePanel, revision)
-{
-    var title = revision.timestamp ? revision.timestamp.toLocaleTimeString() : WebInspector.UIString("(original)");
-    WebInspector.BaseStorageTreeElement.call(this, storagePanel, revision, title, ["resource-sidebar-tree-item", "resources-type-" + revision.resource.type.name()]);
-    if (revision.timestamp)
-        this.tooltip = revision.timestamp.toLocaleString();
-    this._revision = revision;
-}
-
-WebInspector.ResourceRevisionTreeElement.prototype = {
-    get itemURL()
-    {
-        return this._revision.resource.url;
-    },
-
-    onattach: function()
-    {
-        WebInspector.BaseStorageTreeElement.prototype.onattach.call(this);
-        this.listItemElement.draggable = true;
-        this.listItemElement.addEventListener("dragstart", this._ondragstart.bind(this), false);
-        this.listItemElement.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), true);
-    },
-
-    onselect: function()
-    {
-        WebInspector.BaseStorageTreeElement.prototype.onselect.call(this);
-        this._storagePanel._showRevisionView(this._revision);
-    },
-
-    _ondragstart: function(event)
-    {
-        if (this._revision.content) {
-            event.dataTransfer.setData("text/plain", this._revision.content);
-            event.dataTransfer.effectAllowed = "copy";
-            return true;
-        }
-    },
-
-    _handleContextMenuEvent: function(event)
-    {
-        var contextMenu = new WebInspector.ContextMenu();
-        contextMenu.appendItem(WebInspector.UIString("Revert to this revision"), this._revision.revertToThis.bind(this._revision));
-
-        if (InspectorFrontendHost.canSave()) {
-            function doSave(forceSaveAs, content)
-            {
-                WebInspector.fileManager.save(this._revision.resource.url, content, forceSaveAs);
-            }
-
-            function save(forceSaveAs)
-            {
-                this._revision.requestContent(doSave.bind(this, forceSaveAs));
-            }
-
-            contextMenu.appendSeparator();
-            contextMenu.appendItem(WebInspector.UIString("Save"), save.bind(this, false));
-            contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Save as..." : "Save As..."), save.bind(this, true));
-        }
-
-        contextMenu.show(event);
-    },
-
-    sourceView: function()
-    {
-        if (!this._sourceView)
-            this._sourceView = new WebInspector.SourceFrame(this._revision);
-        return this._sourceView;
-    }
-}
-
-WebInspector.ResourceRevisionTreeElement.prototype.__proto__ = WebInspector.BaseStorageTreeElement.prototype;
-
-/**
- * @constructor
  * @extends {WebInspector.View}
  */
 WebInspector.StorageCategoryView = function()
index 2363f2d..a6dea59 100644 (file)
@@ -49,8 +49,7 @@ WebInspector.ScriptsNavigator = function()
     this._snippetsView.addEventListener(WebInspector.NavigatorView.Events.FileRenamed, this._fileRenamed, this);
     this._snippetsView.addEventListener(WebInspector.SnippetsNavigatorView.Events.SnippetCreationRequested, this._snippetCreationRequested, this);
 
-    var sourcesTitle = WebInspector.experimentsSettings.sourceCodePanel.isEnabled() ? WebInspector.UIString("Sources") : WebInspector.UIString("Scripts");
-    this._tabbedPane.appendTab(WebInspector.ScriptsNavigator.ScriptsTab, sourcesTitle, this._scriptsView);
+    this._tabbedPane.appendTab(WebInspector.ScriptsNavigator.ScriptsTab, WebInspector.UIString("Sources"), this._scriptsView);
     this._tabbedPane.selectTab(WebInspector.ScriptsNavigator.ScriptsTab);
     this._tabbedPane.appendTab(WebInspector.ScriptsNavigator.ContentScriptsTab, WebInspector.UIString("Content scripts"), this._contentScriptsView);
     if (WebInspector.experimentsSettings.snippetsSupport.isEnabled())
index 6ad7364..1f7b1ac 100644 (file)
@@ -42,8 +42,7 @@ WebInspector.ScriptsPanel = function(uiSourceCodeProviderForTest)
 
     var scriptMapping = new WebInspector.DebuggerScriptMapping();
     var providers = scriptMapping.uiSourceCodeProviders();
-    if (WebInspector.experimentsSettings.sourceCodePanel.isEnabled())
-        providers = providers.concat(new WebInspector.StylesUISourceCodeProvider());
+    providers = providers.concat(new WebInspector.StylesUISourceCodeProvider());
     this._uiSourceCodeProvider = uiSourceCodeProviderForTest || new WebInspector.CompositeUISourceCodeProvider(providers);
 
     new WebInspector.PresentationConsoleMessageHelper(this._uiSourceCodeProvider);
@@ -55,7 +54,7 @@ WebInspector.ScriptsPanel = function(uiSourceCodeProviderForTest)
     }
     WebInspector.GoToLineDialog.install(this, viewGetter.bind(this));
 
-    var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString(WebInspector.experimentsSettings.sourceCodePanel.isEnabled() ? "Source Code Panel" : "Scripts Panel"));
+    var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString("Sources Panel"));
     this.debugToolbar = this._createDebugToolbar(helpSection);
 
     const initialDebugSidebarWidth = 225;
@@ -200,9 +199,7 @@ WebInspector.ScriptsPanel.PauseOnExceptionsState = {
 WebInspector.ScriptsPanel.prototype = {
     get toolbarItemLabel()
     {
-        if (WebInspector.experimentsSettings.sourceCodePanel.isEnabled())
-            return WebInspector.UIString("Source Code");
-        return WebInspector.UIString("Scripts");
+        return WebInspector.UIString("Sources");
     },
 
     get statusBarItems()
@@ -1065,7 +1062,7 @@ WebInspector.ScriptsPanel.prototype = {
      */
     appendApplicableItems: function(contextMenu, target)
     {
-        if (WebInspector.experimentsSettings.sourceCodePanel.isEnabled() && target instanceof WebInspector.UISourceCode) {
+        if (target instanceof WebInspector.UISourceCode) {
             contextMenu.appendSeparator();
             contextMenu.appendItem(WebInspector.UIString("Revision history..."), this._showLocalHistory.bind(this, /** @type {WebInspector.UISourceCode} */ target));
             contextMenu.appendSeparator();
index 836fba0..4e3a227 100644 (file)
@@ -182,7 +182,6 @@ WebInspector.ExperimentsSettings = function()
     // Add currently running experiments here.
     this.showShadowDOM = this._createExperiment("showShadowDOM", "Show shadow DOM");
     this.snippetsSupport = this._createExperiment("snippetsSupport", "Snippets support");
-    this.sourceCodePanel = this._createExperiment("sourceCodePanel", "Source Code panel");
 
     this._cleanUpSetting();
 }
index b6df75f..8edc3f4 100644 (file)
@@ -120,19 +120,6 @@ WebInspector.SourceFrame.prototype = {
         }
     },
 
-    /**
-     * @param {TextDiff} diffData
-     */
-    markDiff: function(diffData)
-    {
-        if (this._diffLines && this.loaded)
-            this._removeDiffDecorations();
-
-        this._diffLines = diffData;
-        if (this.loaded)
-            this._updateDiffDecorations();
-    },
-
     addMessage: function(msg)
     {
         this._messages.push(msg);
@@ -251,7 +238,6 @@ WebInspector.SourceFrame.prototype = {
         this._textViewer.beginUpdates();
 
         this._addExistingMessagesToSource();
-        this._updateDiffDecorations();
 
         this._textViewer.doResize();
 
@@ -360,33 +346,6 @@ WebInspector.SourceFrame.prototype = {
         return ranges;
     },
 
-    _updateDiffDecorations: function()
-    {
-        if (!this._diffLines)
-            return;
-
-        function addDecorations(textViewer, lines, className)
-        {
-            for (var i = 0; i < lines.length; ++i)
-                textViewer.addDecoration(lines[i], className);
-        }
-        addDecorations(this._textViewer, this._diffLines.added, "webkit-added-line");
-        addDecorations(this._textViewer, this._diffLines.removed, "webkit-removed-line");
-        addDecorations(this._textViewer, this._diffLines.changed, "webkit-changed-line");
-    },
-
-    _removeDiffDecorations: function()
-    {
-        function removeDecorations(textViewer, lines, className)
-        {
-            for (var i = 0; i < lines.length; ++i)
-                textViewer.removeDecoration(lines[i], className);
-        }
-        removeDecorations(this._textViewer, this._diffLines.added, "webkit-added-line");
-        removeDecorations(this._textViewer, this._diffLines.removed, "webkit-removed-line");
-        removeDecorations(this._textViewer, this._diffLines.changed, "webkit-changed-line");
-    },
-
     _addExistingMessagesToSource: function()
     {
         var length = this._messages.length;
index 73463b2..e10d711 100644 (file)
     outline: 1px solid rgb(64, 115, 244);
 }
 
-.webkit-added-line.webkit-line-number {
-    background-color: rgb(170, 255, 170);
-    color: #333;
-}
-
-.webkit-removed-line.webkit-line-number {
-    background-color: rgb(255, 220, 220);
-    text-decoration: line-through;
-}
-
-.webkit-changed-line.webkit-line-number {
-    background-color: rgb(170, 170, 255);
-    color: #333;
-}
-
 .webkit-highlighted-line.webkit-line-content {
     -webkit-animation: "fadeout" 2s 0s;
 }
index e520ebd..1d7225b 100644 (file)
@@ -25,9 +25,6 @@
  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Contains diff method based on Javascript Diff Algorithm By John Resig
- * http://ejohn.org/files/jsdiff.js (released under the MIT license).
  */
 
 String.prototype.hasSubstring = function(string, caseInsensitive)
@@ -373,51 +370,6 @@ function insertionIndexForObjectInListSortedByFunction(anObject, aList, aFunctio
     }
 }
 
-Array.diff = function(left, right)
-{
-    var o = left;
-    var n = right;
-
-    var ns = {};
-    var os = {};
-
-    for (var i = 0; i < n.length; i++) {
-        if (ns[n[i]] == null)
-            ns[n[i]] = { rows: [], o: null };
-        ns[n[i]].rows.push(i);
-    }
-
-    for (var i = 0; i < o.length; i++) {
-        if (os[o[i]] == null)
-            os[o[i]] = { rows: [], n: null };
-        os[o[i]].rows.push(i);
-    }
-
-    for (var i in ns) {
-        if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) {
-            n[ns[i].rows[0]] = { text: n[ns[i].rows[0]], row: os[i].rows[0] };
-            o[os[i].rows[0]] = { text: o[os[i].rows[0]], row: ns[i].rows[0] };
-        }
-    }
-
-    for (var i = 0; i < n.length - 1; i++) {
-        if (n[i].text != null && n[i + 1].text == null && n[i].row + 1 < o.length && o[n[i].row + 1].text == null && n[i + 1] == o[n[i].row + 1]) {
-            n[i + 1] = { text: n[i + 1], row: n[i].row + 1 };
-            o[n[i].row + 1] = { text: o[n[i].row + 1], row: i + 1 };
-        }
-    }
-
-    for (var i = n.length - 1; i > 0; i--) {
-        if (n[i].text != null && n[i - 1].text == null && n[i].row > 0 && o[n[i].row - 1].text == null &&
-            n[i - 1] == o[n[i].row - 1]) {
-            n[i - 1] = { text: n[i - 1], row: n[i].row - 1 };
-            o[n[i].row - 1] = { text: o[n[i].row - 1], row: i - 1 };
-        }
-    }
-
-    return { left: o, right: n };
-}
-
 Array.convert = function(list)
 {
     // Cast array-like object to an array.
@@ -671,46 +623,6 @@ function numberToStringWithSpacesPadding(value, symbolsCount)
 /**
  * @constructor
  */
-function TextDiff()
-{
-    this.added = [];
-    this.removed = [];
-    this.changed = [];
-} 
-
-/**
- * @param {string} baseContent
- * @param {string} newContent
- * @return {TextDiff}
- */
-TextDiff.compute = function(baseContent, newContent)
-{
-    var oldLines = baseContent.split(/\r?\n/);
-    var newLines = newContent.split(/\r?\n/);
-
-    var diff = Array.diff(oldLines, newLines);
-
-    var diffData = new TextDiff();
-
-    var offset = 0;
-    var right = diff.right;
-    for (var i = 0; i < right.length; ++i) {
-        if (typeof right[i] === "string") {
-            if (right.length > i + 1 && right[i + 1].row === i + 1 - offset)
-                diffData.changed.push(i);
-            else {
-                diffData.added.push(i);
-                offset++;
-            }
-        } else
-            offset = i - right[i].row;
-    }
-    return diffData;
-}
-
-/**
- * @constructor
- */
 var Map = function()
 {
     this._map = {};