Commit 0dcf07b4 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

Web Inspector: Add isClean/markClean method pair to textEditor.js

https://bugs.webkit.org/show_bug.cgi?id=112815

Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-03-27
Reviewed by Vsevolod Vlasov.

No new tests: no change in behaviour.

- Add TextEditor.isClean and TextEditor.markClean methods
- Implement these methods in DefaultTextEditor
- Implement these methods in CodeMirrorTextEditor

* inspector/front-end/CodeMirrorTextEditor.js:
(WebInspector.CodeMirrorTextEditor.prototype.isClean):
(WebInspector.CodeMirrorTextEditor.prototype.markClean):
* inspector/front-end/DefaultTextEditor.js:
(WebInspector.DefaultTextEditor.prototype.isClean):
(WebInspector.DefaultTextEditor.prototype.markClean):
* inspector/front-end/TextEditor.js:
(WebInspector.TextEditor.prototype.isClean):
(WebInspector.TextEditor.prototype.markClean):
* inspector/front-end/TextEditorModel.js:
(WebInspector.TextEditorModel.endsWithBracketRegex.):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7dcd981c
2013-03-27 Andrey Lushnikov <lushnikov@chromium.org>
Web Inspector: Add isClean/markClean method pair to textEditor.js
https://bugs.webkit.org/show_bug.cgi?id=112815
Reviewed by Vsevolod Vlasov.
No new tests: no change in behaviour.
- Add TextEditor.isClean and TextEditor.markClean methods
- Implement these methods in DefaultTextEditor
- Implement these methods in CodeMirrorTextEditor
* inspector/front-end/CodeMirrorTextEditor.js:
(WebInspector.CodeMirrorTextEditor.prototype.isClean):
(WebInspector.CodeMirrorTextEditor.prototype.markClean):
* inspector/front-end/DefaultTextEditor.js:
(WebInspector.DefaultTextEditor.prototype.isClean):
(WebInspector.DefaultTextEditor.prototype.markClean):
* inspector/front-end/TextEditor.js:
(WebInspector.TextEditor.prototype.isClean):
(WebInspector.TextEditor.prototype.markClean):
* inspector/front-end/TextEditorModel.js:
(WebInspector.TextEditorModel.endsWithBracketRegex.):
2013-03-27 Ilya Tikhonovsky <loislo@chromium.org>
 
Unreviewed. Web Inspector. rename method Timeline.Calculator.grandMinimumBoundary to Timeline.Calculator.zeroTime
......@@ -101,6 +101,19 @@ WebInspector.CodeMirrorTextEditor.prototype = {
return this._codeMirror.getRange(pos.start, pos.end);
},
/**
* @return {boolean}
*/
isClean: function()
{
return this._codeMirror.isClean();
},
markClean: function()
{
this._codeMirror.markClean();
},
/**
* @param {string} mimeType
*/
......
......@@ -110,6 +110,18 @@ WebInspector.DefaultTextEditor.EditInfo = function(range, text)
}
WebInspector.DefaultTextEditor.prototype = {
/**
* @return {boolean}
*/
isClean: function()
{
return this._textModel.isClean();
},
markClean: function()
{
this._textModel.markClean();
},
/**
* @param {WebInspector.TextRange} range
* @return {string}
......
......@@ -39,7 +39,12 @@ WebInspector.TextEditor.Events = {
};
WebInspector.TextEditor.prototype = {
/**
* @return {boolean}
*/
isClean: function() { },
markClean: function() { },
/**
* @param {string} mimeType
*/
......
......@@ -199,6 +199,17 @@ WebInspector.TextEditorModel.Events = {
WebInspector.TextEditorModel.endsWithBracketRegex = /[{(\[]\s*$/;
WebInspector.TextEditorModel.prototype = {
/**
* @return {boolean}
*/
isClean: function() {
return !this._undoStack.length;
},
markClean: function() {
this._resetUndoStack();
},
/**
* @return {number}
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment