Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/ShadowEditor.js

Issue 2230183004: DevTools: Add shadow-editor swatch/icon before box-shadows and text-shadows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New image swatches.png Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @constructor
7 */
8 WebInspector.ShadowEditor = function() {}
9
10 /**
11 * @constructor
12 */
13 WebInspector.ShadowEditor.Shadow = function() {}
14
15 /**
16 * @param {string} text
17 * @return {!Array<string>}
18 */
19 WebInspector.ShadowEditor.Shadow.splitShadows = function(text)
lushnikov 2016/08/11 01:40:07 I don't like this - it seems to be a utility metho
flandy 2016/08/12 19:31:42 Yes I was planning on adding much to the Shadow Mo
20 {
21 var shadows = [];
22 // Split by commas that aren't inside of color values to get the individual shadow values.
23 var results = WebInspector.TextUtils.splitStringByRegexes(text, [WebInspecto r.Color.Regex, /,/g]);
24 var currentIndex = 0;
25 for (var i = 0; i < results.length; i++) {
26 if (results[i].regexIndex === 1) {
27 var comma = results[i];
28 shadows.push(text.substring(currentIndex, comma.position));
29 currentIndex = comma.position + 1;
30 }
31 }
32 shadows.push(text.substring(currentIndex, text.length));
33 return shadows;
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698