From 7a28932ba8a7517bbaaabe1f5edf678416aafc9c Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Mon, 12 Mar 2012 15:29:37 -0700
Subject: CSS Panel - Adding declaration, style (tree leaf), and style
shorthand (tree branch) components
---
.../style-shorthand.reel/style-shorthand.css | 14 ++
.../style-shorthand.reel/style-shorthand.html | 167 +++++++++++++++++++++
.../style-shorthand.reel/style-shorthand.js | 56 +++++++
3 files changed, 237 insertions(+)
create mode 100644 js/panels/css-panel/style-shorthand.reel/style-shorthand.css
create mode 100644 js/panels/css-panel/style-shorthand.reel/style-shorthand.html
create mode 100644 js/panels/css-panel/style-shorthand.reel/style-shorthand.js
(limited to 'js/panels/css-panel/style-shorthand.reel')
diff --git a/js/panels/css-panel/style-shorthand.reel/style-shorthand.css b/js/panels/css-panel/style-shorthand.reel/style-shorthand.css
new file mode 100644
index 00000000..b29a8fd6
--- /dev/null
+++ b/js/panels/css-panel/style-shorthand.reel/style-shorthand.css
@@ -0,0 +1,14 @@
+/*
+ This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
+ */
+
+.css-tree-branch {
+ padding-left: 10px;
+}
+.css-tree-branch .css-tree-branch {
+ padding-left: 20px;
+ margin-top: 0;
+ margin-bottom: 0;
+}
\ No newline at end of file
diff --git a/js/panels/css-panel/style-shorthand.reel/style-shorthand.html b/js/panels/css-panel/style-shorthand.reel/style-shorthand.html
new file mode 100644
index 00000000..391aa846
--- /dev/null
+++ b/js/panels/css-panel/style-shorthand.reel/style-shorthand.html
@@ -0,0 +1,167 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/js/panels/css-panel/style-shorthand.reel/style-shorthand.js b/js/panels/css-panel/style-shorthand.reel/style-shorthand.js
new file mode 100644
index 00000000..00749faa
--- /dev/null
+++ b/js/panels/css-panel/style-shorthand.reel/style-shorthand.js
@@ -0,0 +1,56 @@
+/*
+ This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
+ */
+
+var Montage = require("montage").Montage,
+ TreeNode = require("js/components/treeview/tree-node").TreeNode;
+
+var styleShorthand = exports.StyleShorthand= Montage.create(TreeNode, {
+ repetition: { value: null },
+ propertyText : { value: "property" },
+ valueText : { value: "value" },
+
+ handleSourceObjectSet: {
+ value: function() {
+ this.propertyText = this.sourceObject.name;
+ this.valueText = this.sourceObject.value;
+ }
+ },
+ prepareForDraw : {
+ value: function() {
+ this.styleListDisclosure.addEventListener('click', this, false);
+ this.treeView.contentController.addBranchController(this.arrayController);
+ }
+ },
+ templateDidLoad: {
+ value: function() {
+ this.arrayController.delegate = this.treeView.contentController;
+ }
+ },
+ willDraw : {
+ value: function() {
+
+ }
+ },
+ draw:{
+ value: function () {
+
+console.log("style shorthand - draw");
+ shorthand = this;
+ if (this.sourceObject[this.labelKey]) {
+ this._labelText = this.sourceObject[this.labelKey];
+ }
+
+ }
+ },
+
+ handleClick : {
+ value: function(e) {
+ e.preventDefault();
+ this.toggleExpand();
+ }
+ }
+
+});
--
cgit v1.2.3