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 @@ - -
+ +
- +
-
+
diff --git a/js/panels/CSSPanel/ComputedStyleSubPanel.reel/computed-style-sub-panel.css b/js/panels/CSSPanel/ComputedStyleSubPanel.reel/computed-style-sub-panel.css index 9f0043f4..21dd9055 100755 --- a/js/panels/CSSPanel/ComputedStyleSubPanel.reel/computed-style-sub-panel.css +++ b/js/panels/CSSPanel/ComputedStyleSubPanel.reel/computed-style-sub-panel.css @@ -4,7 +4,7 @@ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ -#nj-css-filter-panel { +.nj-css-filter-panel { background-color: #474747; box-shadow: 0 1px 1px #505050; border-bottom: 1px solid rgba(0, 0, 0, 0.1); @@ -25,39 +25,37 @@ font-family: 'Droid Sans', sans-serif; overflow-y: scroll; } -#nj-css-filter, #nj-css-group-select { +.nj-css-filter-input, .nj-css-group-select { width: 42%; } -#nj-css-filter { +.nj-css-filter-input{ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1%2BjfqAAAACXBIWXMAAAsTAAALEwEAmpwYAAADGGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjaY2BgnuDo4uTKJMDAUFBUUuQe5BgZERmlwH6egY2BmYGBgYGBITG5uMAxIMCHgYGBIS8%2FL5UBFTAyMHy7xsDIwMDAcFnX0cXJlYE0wJpcUFTCwMBwgIGBwSgltTiZgYHhCwMDQ3p5SUEJAwNjDAMDg0hSdkEJAwNjAQMDg0h2SJAzAwNjCwMDE09JakUJAwMDg3N%2BQWVRZnpGi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skQmsxoGX8oAQXAmmyn62Hz6rPY2n9eRO1ASCRfx9Xz2DSzzGcPzYu5iGeRSIdQH8xdFqMY2OmbuiZGMRAewFmhyHFUCjxs1VByBsE%2FIQvZ4e3Tt%2FL7clzsmHe6ho7ArSckIIZSG0srelPTGvfNKcs6OTi6pu20cAxBxgaiMZtyPJxK6QHr5XF39QnpG1T6iRJCQVlPJDcDfY3SzALfUroZaFGhgUkP8systJNrpVdiFPjxCG4eBAKDERL0kudWfngE%2Fy5QI0%2BTCFWafovO%2Fyj0YNCiJm3X0E3KP3N%2BBwBmgXFVnpvsaQAAAABJRU5ErkJggg%3D%3D); background-position: 1px 1px; background-repeat: no-repeat; padding-left: 11px; -} -#nj-css-filter { margin-right: 4%; } -#nj-css-group-select { +.nj-css-group-select { padding-left: 5px; } /* ---------------------------------------- Computed Style List ---------------------------------------- */ -#nj-css-computed-list > div { +.nj-css-computed-list > div { margin: 0 15px; border-bottom: 1px solid #505050; padding: 1px 0; } -#nj-css-computed-list > div:last-child { +.nj-css-computed-list > div:last-child { margin-bottom: 10px; } -#nj-css-computed-list { +.nj-css-computed-list { margin-top: 7px; } -#nj-css-computed-list dt, #nj-css-computed-list dd { +.nj-css-computed-list dt, .nj-css-computed-list dd { cursor: default; } -#nj-css-computed-list dt { +.nj-css-style-list.nj-css-computed-list dt { color: #FFF; width: 55%; } -- cgit v1.2.3 From 3a078974342ba1e206f92aba6ac83904e587f28d Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 17 May 2012 15:59:36 -0700 Subject: CSS Panel - remove duplicate entry in completion map --- js/panels/CSSPanel/css-value-completion-map.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'js/panels/CSSPanel') diff --git a/js/panels/CSSPanel/css-value-completion-map.js b/js/panels/CSSPanel/css-value-completion-map.js index 773fde96..44d7332f 100755 --- a/js/panels/CSSPanel/css-value-completion-map.js +++ b/js/panels/CSSPanel/css-value-completion-map.js @@ -109,9 +109,6 @@ exports.cssValueCompletionMap = { "border-top-width": [ "medium", "thick", "thin" ], - "outline-color": [ - "invert" - ], "text-line-through-style": [ "none", "dotted", "dashed", "solid", "double", "dot-dash", "dot-dot-dash", "wave" ], @@ -218,7 +215,7 @@ exports.cssValueCompletionMap = { "text-overline-color" : colorKeywords, "background-color" : colorKeywords, "-webkit-text-emphasis-color" : colorKeywords, - "outline-color" : colorKeywords, + "outline-color" : colorKeywords.concat(["invert"]), "text-underline-color" : colorKeywords, "color" : colorKeywords, "color-rendering": [ -- cgit v1.2.3 From a48b284e902708685ab892b273538eb8ba65e496 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 21 May 2012 15:42:01 -0700 Subject: Computed Styles - Add some CSS that was inherited from old CSS Panel --- .../CSSPanel/ComputedStyleSubPanel.reel/computed-style-sub-panel.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/panels/CSSPanel') diff --git a/js/panels/CSSPanel/ComputedStyleSubPanel.reel/computed-style-sub-panel.css b/js/panels/CSSPanel/ComputedStyleSubPanel.reel/computed-style-sub-panel.css index 21dd9055..d60f2d9c 100755 --- a/js/panels/CSSPanel/ComputedStyleSubPanel.reel/computed-style-sub-panel.css +++ b/js/panels/CSSPanel/ComputedStyleSubPanel.reel/computed-style-sub-panel.css @@ -54,8 +54,9 @@ } .nj-css-computed-list dt, .nj-css-computed-list dd { cursor: default; + display: inline-block; } .nj-css-style-list.nj-css-computed-list dt { color: #FFF; - width: 55%; + width: 48%; } -- cgit v1.2.3 From 1f4d7643b484cab4258cda2bb8eefcc6a60452df Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Tue, 22 May 2012 09:27:25 -0700 Subject: CSS Style Declaration - Improve shorthand filtering --- js/panels/CSSPanel/css-shorthand-map.js | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'js/panels/CSSPanel') diff --git a/js/panels/CSSPanel/css-shorthand-map.js b/js/panels/CSSPanel/css-shorthand-map.js index 191dbae5..d469e2a1 100755 --- a/js/panels/CSSPanel/css-shorthand-map.js +++ b/js/panels/CSSPanel/css-shorthand-map.js @@ -16,24 +16,24 @@ exports.CSS_SHORTHAND_MAP = { 'background-repeat-y' : ['background', 'background-repeat'], 'border-bottom' : ['border'], - 'border-bottom-color' : ['border', 'border-bottom'], - 'border-bottom-style' : ['border', 'border-bottom'], - 'border-bottom-width' : ['border', 'border-bottom'], + 'border-bottom-color' : ['border-bottom'], + 'border-bottom-style' : ['border-bottom'], + 'border-bottom-width' : ['border-bottom'], 'border-left' : ['border'], - 'border-left-color' : ['border', 'border-left'], - 'border-left-style' : ['border', 'border-left'], - 'border-left-width' : ['border', 'border-left'], + 'border-left-color' : ['border-left'], + 'border-left-style' : ['border-left'], + 'border-left-width' : ['border-left'], 'border-right' : ['border'], - 'border-right-color' : ['border', 'border-right'], - 'border-right-style' : ['border', 'border-right'], - 'border-right-width' : ['border', 'border-right'], + 'border-right-color' : ['border-right'], + 'border-right-style' : ['border-right'], + 'border-right-width' : ['border-right'], 'border-top' : ['border'], - 'border-top-color' : ['border', 'border-top'], - 'border-top-style' : ['border', 'border-top'], - 'border-top-width' : ['border', 'border-top'], + 'border-top-color' : ['border-top'], + 'border-top-style' : ['border-top'], + 'border-top-width' : ['border-top'], 'border-color' : ['border'], 'border-style' : ['border'], @@ -79,9 +79,12 @@ 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' : ['border-width', 'border-style', 'border-color'], + 'border-top' : ['border-top-width', 'border-top-style', 'border-top-color'], + 'border-right' : ['border-right-width', 'border-right-style', 'border-right-color'], + 'border-bottom' : ['border-bottom-width', 'border-bottom-style', 'border-bottom-color'], + 'border-left' : ['border-left-width', 'border-left-style', 'border-left-color'], + 'border-image' : ['border-image-outset', 'border-image-repeat','border-image-slice', 'border-image-source', 'border-image-width'], '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"], -- cgit v1.2.3 From 5914c5b2209c4b8daac4249bb76cda5c9314c4e6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 24 May 2012 00:07:23 -0700 Subject: Cleaning up referencing to 'documentRoot' and '_document' Moved to reference new model in DOM architecture rework. This should not affect anything, just moving the references, and also the setting to the render methods in the design view. --- js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/panels/CSSPanel') diff --git a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js index 4c0a3611..b4a803b2 100755 --- a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js +++ b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js @@ -87,7 +87,7 @@ var CSSPanel = exports.CSSPanelBase = (require("montage/core/core").Montage).cre populateStyleSheetList: { value: function() { - this.sections.sheets.doc = this.application.ninja.currentDocument._document; + this.sections.sheets.doc = this.application.ninja.currentDocument.model.views.design.document; var styleTagCount = 0, sect = this.sections.sheets, sheetsArray = nj.toArray(sect.doc.styleSheets), -- cgit v1.2.3