OLD | NEW |
---|---|
(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 } | |
OLD | NEW |