From 7130541631a84b524824c0c4247f5dc73ef4c91c Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 12 Mar 2012 15:23:04 -0700 Subject: CSS Updates - Update the shorthand map to include other order --- js/panels/CSSPanel/css-shorthand-map.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'js/panels/CSSPanel') diff --git a/js/panels/CSSPanel/css-shorthand-map.js b/js/panels/CSSPanel/css-shorthand-map.js index bc43ebc4..191dbae5 100755 --- a/js/panels/CSSPanel/css-shorthand-map.js +++ b/js/panels/CSSPanel/css-shorthand-map.js @@ -52,7 +52,6 @@ exports.CSS_SHORTHAND_MAP = { 'font-style' : ['font'], 'font-family' : ['font'], 'font-size' : ['font'], - 'font-style' : ['font'], 'font-variant' : ['font'], 'font-weight' : ['font'], @@ -74,4 +73,21 @@ exports.CSS_SHORTHAND_MAP = { '-webkit-transition-duration' : ['-webkit-transition'], '-webkit-transition-timing-function' : ['-webkit-transition'], '-webkit-transition-delay' : ['-webkit-transition'] +}; + +exports.CSS_SHORTHAND_TO_SUBPROP_MAP = { + 'background' : ["background-image", "background-repeat-x", "background-repeat-y", "background-attachment", + "background-position-x", "background-position-y", "background-origin", "background-clip", + "background-color"], + 'border' : ["border-top-width", "border-right-width", "border-bottom-width", "border-left-width", + "border-top-style", "border-right-style", "border-bottom-style", "border-left-style", + "border-top-color", "border-right-color", "border-bottom-color", "border-left-color", "border-image"], + 'border-radius' : ["border-top-left-radius", "border-top-right-radius", "border-bottom-right-radius", + "border-bottom-left-radius"], + 'font' : ["font-family", "font-size", "font-style", "font-variant", "font-weight", "line-height"], + 'list' : ["list-style-type", "list-style-image", "list-style-position"], + 'margin' : ["margin-top", "margin-right", "margin-bottom", "margin-left"], + 'padding' : ["padding-top", "padding-right", "padding-bottom", "padding-left"], + '-webkit-transition' : ["-webkit-transition-property", "-webkit-transition-duration", + "-webkit-transition-timing-function", "-webkit-transition-delay"] }; \ No newline at end of file -- cgit v1.2.3 From 084576ca2dcaaff1184338e0ec4a587ee0dacee7 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Tue, 1 May 2012 12:06:15 -0700 Subject: CSS Panel - Added code hinting and tooltips --- js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js | 4 ++-- js/panels/CSSPanel/css-property-name-list.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'js/panels/CSSPanel') diff --git a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js index 2a3fc068..ad8387de 100755 --- a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js +++ b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js @@ -4,8 +4,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ -var cssPropertyNameList = require("js/panels/CSSPanel/css-property-name-list").cssPropertyNameList, - cssCompletionMap = require("js/panels/CSSPanel/css-value-completion-map").cssValueCompletionMap, +var cssPropertyNameList = require("js/panels/CSSPanel/css-property-name-list").CssPropertyNameList, + cssCompletionMap = require("js/panels/CSSPanel/css-value-completion-map").CssValueCompletionMap, CSS_SHORTHAND_MAP = require("js/panels/CSSPanel/css-shorthand-map").CSS_SHORTHAND_MAP, keyboardModule = require("js/mediators/keyboard-mediator").Keyboard, nj = require("js/lib/NJUtils").NJUtils; diff --git a/js/panels/CSSPanel/css-property-name-list.js b/js/panels/CSSPanel/css-property-name-list.js index 24a69c09..6d02b755 100755 --- a/js/panels/CSSPanel/css-property-name-list.js +++ b/js/panels/CSSPanel/css-property-name-list.js @@ -4,7 +4,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ -exports.cssPropertyNameList = [ +exports.CssPropertyNameList = [ '-webkit-', "-webkit-animation", "-webkit-animation-delay", -- cgit v1.2.3 From 2d31bce1b35001dfb7d1f63838abe8db1ddf019b Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Tue, 1 May 2012 16:24:36 -0700 Subject: CSS Panel - Modify pseudo class on getMatchedCSSRules --- js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'js/panels/CSSPanel') diff --git a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js index ad8387de..4c0a3611 100755 --- a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js +++ b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js @@ -822,17 +822,14 @@ var CSSPanel = exports.CSSPanelBase = (require("montage/core/core").Montage).cre }, getAllRelatedRules : { value: function(element) { - var pseudos = [null],//, 'link', 'visited', 'active', 'hover', 'focus', 'first-letter', - //'first-line', 'first-child', 'before', 'after', 'lang'], - rules = [], + var rules = [], + win = element.ownerDocument.defaultView, self = this; - pseudos.forEach(function(pseudo) { - rules = rules.concat(nj.toArray(this.getMatchedCSSRules(element, ':'+pseudo)).filter(function(rule) { - var sheetId = (rule.parentStyleSheet) ? rule.parentStyleSheet.ownerNode.id : null; - return sheetId !== self._stageStyleSheetId; - })); - }, element.ownerDocument.defaultView); + rules = rules.concat(nj.toArray(win.getMatchedCSSRules(element)).filter(function(rule) { + var sheetId = (rule.parentStyleSheet) ? rule.parentStyleSheet.ownerNode.id : null; + return sheetId !== self._stageStyleSheetId; + })); return rules; } -- cgit v1.2.3 From 560d9255ed1bba04f3dc3f4320307f7d5626bfab Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 3 May 2012 11:49:24 -0700 Subject: CSS Panel - Support showing computed styles --- .../ComputedStyleSubPanel.reel/ComputedStyleSubPanel.html | 4 ++-- .../ComputedStyleSubPanel.reel/computed-style-sub-panel.css | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'js/panels/CSSPanel') diff --git a/js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.html b/js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.html index 53c243a8..b994c5c2 100755 --- a/js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.html +++ b/js/panels/CSSPanel/ComputedStyleSubPanel.reel/ComputedStyleSubPanel.html @@ -25,8 +25,8 @@ -
-