-
+
-
+
--
cgit v1.2.3
From af4dac82d2e76fe90191d6c085740d855bf961f3 Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Tue, 8 May 2012 09:43:57 -0700
Subject: Style sheets - Added default stylesheet selection
---
.../css-panel/style-sheet.reel/style-sheet.css | 4 +++
.../css-panel/style-sheet.reel/style-sheet.html | 1 +
.../css-panel/style-sheet.reel/style-sheet.js | 29 ++++++++++++++++++++++
3 files changed, 34 insertions(+)
(limited to 'js/panels/css-panel/style-sheet.reel')
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.css b/js/panels/css-panel/style-sheet.reel/style-sheet.css
index 9ea03be8..1d26b041 100644
--- a/js/panels/css-panel/style-sheet.reel/style-sheet.css
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.css
@@ -127,6 +127,10 @@
margin-right: 25px;
}
+.default-style-sheet > span {
+ font-weight: bold;
+}
+
.ss-invisible {
display: none;
}
\ No newline at end of file
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.html b/js/panels/css-panel/style-sheet.reel/style-sheet.html
index 6a9dee65..ca24487d 100644
--- a/js/panels/css-panel/style-sheet.reel/style-sheet.html
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.html
@@ -29,6 +29,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
"name": "DynamicText",
"properties": {
"element": {"#": "sheet-name"},
+ "identifier": "nameText",
"defaultText": "Style sheet"
},
"bindings": {
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.js b/js/panels/css-panel/style-sheet.reel/style-sheet.js
index 9ad48a62..3ddd8454 100644
--- a/js/panels/css-panel/style-sheet.reel/style-sheet.js
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.js
@@ -12,6 +12,12 @@ exports.StyleSheet = Montage.create(Component, {
value: null
},
+ prepareForDraw : {
+ value: function() {
+ this.nameText.element.addEventListener('click', this, false);
+ }
+ },
+
willDraw : {
value: function() {
if(this.editing) {
@@ -45,6 +51,12 @@ exports.StyleSheet = Montage.create(Component, {
this.importButton.element.classList.add('ss-invisible');
}
+ if(this.default) {
+ this._element.classList.add('default-style-sheet');
+ } else {
+ this._element.classList.remove('default-style-sheet');
+ }
+
}
},
@@ -66,6 +78,12 @@ exports.StyleSheet = Montage.create(Component, {
}
},
+ handleClick : {
+ value: function(e) {
+ this.parentComponent.parentComponent.defaultStyleSheet = this.source;
+ }
+ },
+
handleEditButtonAction: {
value: function(e) {
this.editing = true;
@@ -130,6 +148,17 @@ exports.StyleSheet = Montage.create(Component, {
}
},
+ _default : { value: null },
+ default : {
+ get: function() {
+ return this._default;
+ },
+ set: function(value) {
+ this._default = value;
+ this.needsDraw = true;
+ }
+ },
+
_disabled : {
value: null
},
--
cgit v1.2.3
From b5439f436cac405c4bbf7e01ead9cee5dbc71a73 Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Wed, 16 May 2012 16:04:00 -0700
Subject: CSS Panel - Style sheets dirty flag added
---
.../css-panel/style-sheet.reel/style-sheet.css | 5 +++++
js/panels/css-panel/style-sheet.reel/style-sheet.js | 21 +++++++++++++++++++++
2 files changed, 26 insertions(+)
(limited to 'js/panels/css-panel/style-sheet.reel')
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.css b/js/panels/css-panel/style-sheet.reel/style-sheet.css
index 1d26b041..2e72cd9c 100644
--- a/js/panels/css-panel/style-sheet.reel/style-sheet.css
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.css
@@ -131,6 +131,11 @@
font-weight: bold;
}
+.ss-dirty:after {
+ content: "*";
+ color: #A33939;
+}
+
.ss-invisible {
display: none;
}
\ No newline at end of file
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.js b/js/panels/css-panel/style-sheet.reel/style-sheet.js
index 3ddd8454..0ff195d5 100644
--- a/js/panels/css-panel/style-sheet.reel/style-sheet.js
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.js
@@ -57,6 +57,12 @@ exports.StyleSheet = Montage.create(Component, {
this._element.classList.remove('default-style-sheet');
}
+ if(this.dirty) {
+ this.nameText.element.classList.add('ss-dirty');
+ } else {
+ this.nameText.element.classList.remove('ss-dirty');
+ }
+
}
},
@@ -137,6 +143,21 @@ exports.StyleSheet = Montage.create(Component, {
this._name = text;
}
},
+ _dirty : {
+ value: null
+ },
+ dirty : {
+ get: function() {
+ return this._dirty;
+ },
+ set: function(value) {
+ if(value === this._dirty) { return false; }
+
+ this._dirty = value;
+ this.needsDraw = true;
+ }
+ },
+
_readOnly : { value: null },
readOnly : {
get: function() {
--
cgit v1.2.3
From 197a7646e472fcea616764685c8d03c6063e66f5 Mon Sep 17 00:00:00 2001
From: Eric Guzman
Date: Fri, 18 May 2012 14:05:06 -0700
Subject: CSS Panel - Add support for deleting style sheets
---
.../css-panel/style-sheet.reel/style-sheet.html | 16 ----------------
js/panels/css-panel/style-sheet.reel/style-sheet.js | 21 ++++++++-------------
2 files changed, 8 insertions(+), 29 deletions(-)
(limited to 'js/panels/css-panel/style-sheet.reel')
diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.html b/js/panels/css-panel/style-sheet.reel/style-sheet.html
index ca24487d..788cafcc 100644
--- a/js/panels/css-panel/style-sheet.reel/style-sheet.html
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.html
@@ -20,7 +20,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
"editButton": {"@": "editButton"},
"editView": {"#": "style-sheet-edit"},
"disableButton": {"@": "disableButton"},
- "importButton": {"@": "importButton"},
"deleteButton": {"@": "deleteButton"}
}
},
@@ -74,20 +73,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
"listener": {"@": "owner"}
}]
- },
- "importButton": {
- "module": "montage/ui/button.reel",
- "name": "Button",
- "properties": {
- "element": {"#": "import-button"},
- "identifier": "importButton",
- "label": "Import"
- },
- "listeners": [{
- "type": "action",
- "listener": {"@": "owner"}
- }]
-
},
"deleteButton": {
"module": "montage/ui/button.reel",
@@ -118,7 +103,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
-