Web Inspector: refactoring: move TextEditorModel.Indent enum into TextUtils
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2013 14:22:01 +0000 (14:22 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2013 14:22:01 +0000 (14:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111715

Patch by Andrey Lushnikov <lushnikov@chromium.org> on 2013-03-07
Reviewed by Pavel Feldman.

Move WebInspector.TextEditorModel.Indent into WebInspector.TextUtils namespace.

No new tests: no change in behaviour.

* inspector/front-end/SettingsScreen.js:
(WebInspector.GenericSettingsTab):
* inspector/front-end/TextEditorModel.js:
(WebInspector.TextEditorModel.endsWithBracketRegex.):
* inspector/front-end/TextUtils.js:

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

Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/SettingsScreen.js
Source/WebCore/inspector/front-end/TextEditorModel.js
Source/WebCore/inspector/front-end/TextUtils.js

index eccb815..dc13b62 100644 (file)
@@ -1,3 +1,20 @@
+2013-03-07  Andrey Lushnikov  <lushnikov@chromium.org>
+
+        Web Inspector: refactoring: move TextEditorModel.Indent enum into TextUtils
+        https://bugs.webkit.org/show_bug.cgi?id=111715
+
+        Reviewed by Pavel Feldman.
+
+        Move WebInspector.TextEditorModel.Indent into WebInspector.TextUtils namespace.
+
+        No new tests: no change in behaviour.
+
+        * inspector/front-end/SettingsScreen.js:
+        (WebInspector.GenericSettingsTab):
+        * inspector/front-end/TextEditorModel.js:
+        (WebInspector.TextEditorModel.endsWithBracketRegex.):
+        * inspector/front-end/TextUtils.js:
+
 2013-03-07  Ian Vollick  <vollick@chromium.org>
 
         Fix painting phases for composited scrolling
index 5ce5f0a..d3a9331 100644 (file)
@@ -312,10 +312,10 @@ WebInspector.GenericSettingsTab = function()
     if (WebInspector.experimentsSettings.isEnabled("sass"))
         p.appendChild(this._createCSSAutoReloadControls());
     var indentationElement = this._createSelectSetting(WebInspector.UIString("Indentation"), [
-            [ WebInspector.UIString("2 spaces"), WebInspector.TextEditorModel.Indent.TwoSpaces ],
-            [ WebInspector.UIString("4 spaces"), WebInspector.TextEditorModel.Indent.FourSpaces ],
-            [ WebInspector.UIString("8 spaces"), WebInspector.TextEditorModel.Indent.EightSpaces ],
-            [ WebInspector.UIString("Tab character"), WebInspector.TextEditorModel.Indent.TabCharacter ]
+            [ WebInspector.UIString("2 spaces"), WebInspector.TextUtils.Indent.TwoSpaces ],
+            [ WebInspector.UIString("4 spaces"), WebInspector.TextUtils.Indent.FourSpaces ],
+            [ WebInspector.UIString("8 spaces"), WebInspector.TextUtils.Indent.EightSpaces ],
+            [ WebInspector.UIString("Tab character"), WebInspector.TextUtils.Indent.TabCharacter ]
         ], WebInspector.settings.textEditorIndent);
     indentationElement.firstChild.className = "toplevel";
     p.appendChild(indentationElement);
index d2d60ac..0acc4a9 100644 (file)
@@ -192,13 +192,6 @@ WebInspector.TextEditorModel = function()
     this._lineBreak = "\n";
 }
 
-WebInspector.TextEditorModel.Indent = {
-    TwoSpaces: "  ",
-    FourSpaces: "    ",
-    EightSpaces: "        ",
-    TabCharacter: "\t"
-}
-
 WebInspector.TextEditorModel.Events = {
     TextChanged: "TextChanged"
 }
@@ -651,7 +644,7 @@ WebInspector.TextEditorModel.prototype = {
         this._markUndoableState();
 
         var indent = WebInspector.settings.textEditorIndent.get();
-        var indentLength = indent === WebInspector.TextEditorModel.Indent.TabCharacter ? 4 : indent.length;
+        var indentLength = indent === WebInspector.TextUtils.Indent.TabCharacter ? 4 : indent.length;
         var lineIndentRegex = new RegExp("^ {1," + indentLength + "}");
         var newRange = range.clone();
 
index 3d1c6a4..e603a0c 100644 (file)
@@ -102,3 +102,13 @@ WebInspector.TextUtils = {
 }
 
 WebInspector.TextUtils._SpaceCharRegex = /\s/;
+
+/**
+ * @enum {string}
+ */
+WebInspector.TextUtils.Indent = {
+    TwoSpaces: "  ",
+    FourSpaces: "    ",
+    EightSpaces: "        ",
+    TabCharacter: "\t"
+}