From 3a754133dbc138390503341fd2e9beba3e43aa4b Mon Sep 17 00:00:00 2001
From: Jose Antonio Marquez
Date: Fri, 27 Jan 2012 12:05:17 -0800
Subject: Merged old FileIO
---
js/components/tools-properties/text-properties.reel/text-properties.css | 0
js/components/tools-properties/text-properties.reel/text-properties.html | 0
js/components/tools-properties/text-properties.reel/text-properties.js | 0
3 files changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 js/components/tools-properties/text-properties.reel/text-properties.css
mode change 100644 => 100755 js/components/tools-properties/text-properties.reel/text-properties.html
mode change 100644 => 100755 js/components/tools-properties/text-properties.reel/text-properties.js
(limited to 'js/components/tools-properties/text-properties.reel')
diff --git a/js/components/tools-properties/text-properties.reel/text-properties.css b/js/components/tools-properties/text-properties.reel/text-properties.css
old mode 100644
new mode 100755
diff --git a/js/components/tools-properties/text-properties.reel/text-properties.html b/js/components/tools-properties/text-properties.reel/text-properties.html
old mode 100644
new mode 100755
diff --git a/js/components/tools-properties/text-properties.reel/text-properties.js b/js/components/tools-properties/text-properties.reel/text-properties.js
old mode 100644
new mode 100755
--
cgit v1.2.3
From 0bb13001ce07e5256a6e395325a898ab4ac93e1c Mon Sep 17 00:00:00 2001
From: Armen Kesablyan
Date: Mon, 13 Feb 2012 02:05:07 -0800
Subject: Fixed Color on text edit. Also Fixed Indent & Outdent button. toggle
bullet and numbered now bound to text tool
---
.../text-properties.reel/text-properties.css | 4 +
.../text-properties.reel/text-properties.html | 8 +-
.../text-properties.reel/text-properties.js | 116 +++++++++++++++++----
3 files changed, 103 insertions(+), 25 deletions(-)
(limited to 'js/components/tools-properties/text-properties.reel')
diff --git a/js/components/tools-properties/text-properties.reel/text-properties.css b/js/components/tools-properties/text-properties.reel/text-properties.css
index 6aa61812..f7bb8295 100644
--- a/js/components/tools-properties/text-properties.reel/text-properties.css
+++ b/js/components/tools-properties/text-properties.reel/text-properties.css
@@ -12,6 +12,10 @@
padding: 0px 8px;
}
+.optionsTextTool select {
+ margin: 2px;
+}
+
.optionsTextTool > *, .optionsTextTool .btnGroup > * {
float:left;
}
diff --git a/js/components/tools-properties/text-properties.reel/text-properties.html b/js/components/tools-properties/text-properties.reel/text-properties.html
index 7ded1236..a7d2af10 100644
--- a/js/components/tools-properties/text-properties.reel/text-properties.html
+++ b/js/components/tools-properties/text-properties.reel/text-properties.html
@@ -236,7 +236,7 @@
"element": {"#": "indent"},
"pressedClass": "active",
"preventFocus": true,
- "identifier": "outdent",
+ "identifier": "indent",
"label": ">>"
},
"listeners": [
@@ -253,7 +253,7 @@
"element": {"#": "outdent"},
"pressedClass": "active",
"preventFocus": true,
- "identifier": "<<",
+ "identifier": "outdent",
"label": "<<"
},
"listeners": [
@@ -310,10 +310,10 @@
-
+
-
+
diff --git a/js/components/tools-properties/text-properties.reel/text-properties.js b/js/components/tools-properties/text-properties.reel/text-properties.js
index 55274322..7ae0cfda 100644
--- a/js/components/tools-properties/text-properties.reel/text-properties.js
+++ b/js/components/tools-properties/text-properties.reel/text-properties.js
@@ -6,6 +6,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
var Montage = require("montage/core/core").Montage;
var Component = require("montage/ui/component").Component;
+var ArrayController = require("montage/ui/controller/array-controller").ArrayController;
var ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties;
exports.TextProperties = Montage.create(ToolProperties, {
@@ -29,18 +30,57 @@ exports.TextProperties = Montage.create(ToolProperties, {
outdent: {value: null},
numberedList: {value: null},
bulletedList: {value: null},
+ fontTypes: {value: null},
+ fontSizes: {value: null},
prepareForDraw: {
value: function() {
+ // code commented out because montage ui element select-input is incomplete. Will switch back when they fix or actually complete the component
+// this.fontTypes = Montage.create(ArrayController);
+// this.fontTypes.content = [
+// { value: "Arial", text: "Arial" },
+// { value: "Arial Black", text: "Arial Black" },
+// { value: "Courier New", text: "Courier New" },
+// { value: "Garamond", text: "Garamond" },
+// { value: "Georgia", text: "Georgia" },
+// { value: "Open Sans", text: "Open Sans" },
+// { value: "Tahoma", text: "Tahoma" },
+// { value: "Times New Roman", text: "Times New Roman" },
+// { value: "Trebuchet MS", text: "Trebuchet MS" },
+// { value: "Verdana", text: "Verdana" }
+// ];
+
+ //this.fontSelection.contentController = this.fontTypes;
+//
+// this.fontSizes = Montage.create(ArrayController);
+// this.fontSizes.content = [
+// { value: 1, text: "8pt" },
+// { value: 2, text: "10pt" },
+// { value: 3, text: "12pt" },
+// { value: 4, text: "14pt" },
+// { value: 5, text: "18pt" },
+// { value: 6, text: "24pt" },
+// { value: 7, text: "36pt" }
+// ];
+// this.fontSize.contentController = this.fontSizes;
+
this.fontSelection.items = ["Arial", "Arial Black", "Courier New", "Garamond", "Georgia", "Open Sans", "Tahoma", "Times New Roman", "Trebuchet MS", "Verdana"];
- this.tagType.items = ["div", "span", "p", "section", "article", "h1", "h2", "h3", "h4", "h5", "h6"];
this.fontSize.items = ["8pt","10pt","12pt","14pt","18pt","24pt","36pt"];
+ this.tagType.items = ["div", "span", "p", "section", "article", "h1", "h2", "h3", "h4", "h5", "h6"];
}
},
handleEditorSelect: {
value: function(e) {
this.application.ninja.stage.textTool.updateStates();
+// this.fontSelection.value = this.application.ninja.stage.textTool.states.fontname;
+//
+// for( var i = 0; i < this.fontSize.items.length; i++) {
+// if (this.application.ninja.stage.textTool.states.fontsize == i + 1) {
+// this.fontSize.value = this.fontSize.items[i]
+// break;
+// }
+// }
}
},
@@ -133,6 +173,18 @@ exports.TextProperties = Montage.create(ToolProperties, {
}
},
+ handleBulletedListAction: {
+ value: function(e) {
+ this.application.ninja.stage.textTool.doAction("insertunorderedlist");
+ }
+ },
+
+ handleNumberedListAction: {
+ value: function(e) {
+ this.application.ninja.stage.textTool.doAction("insertorderedlist");
+ }
+ },
+
handleFontSizeChange: {
value: function(e) {
//We need the index of whats selected. This is a temporary solution til we can have a variable amount for font-size.
@@ -214,6 +266,34 @@ exports.TextProperties = Montage.create(ToolProperties, {
oneway: true
});
+ Object.defineBinding(this.numberedList, "pressed", {
+ boundObject: this.application.ninja.stage.textTool,
+ boundObjectPropertyPath: "states.insertorderedlist",
+ boundValueMutator: this.validatePressed,
+ oneway: true
+ });
+
+ Object.defineBinding(this.bulletedList, "pressed", {
+ boundObject: this.application.ninja.stage.textTool,
+ boundObjectPropertyPath: "states.insertunorderedlist",
+ boundValueMutator: this.validatePressed,
+ oneway: true
+ });
+
+ Object.defineBinding(this.fontSelection, "value", {
+ boundObject: this.application.ninja.stage.textTool,
+ boundObjectPropertyPath: "states.fontname",
+ boundValueMutator: this.validateFont,
+ oneway: true
+ });
+
+ Object.defineBinding(this.fontSize, "value", {
+ boundObject: this.application.ninja.stage.textTool,
+ boundObjectPropertyPath: "states.fontsize",
+ boundValueMutator: this.validateFontSize.bind(this),
+ oneway: true
+ });
+
this.initialized = true;
}
@@ -226,40 +306,34 @@ exports.TextProperties = Montage.create(ToolProperties, {
}
},
- initialized: {
- value: false
+ validateFont: {
+ value: function(val) {
+ return val;
+ }
},
- handleFontSelectionChange: {
- value: function() {
- this.application.ninja.stage.textTool.doAction("fontname", this.fontSelection.value);
- this.application.ninja.stage.textTool.element.focus();
+ validateFontSize: {
+ value: function(val) {
+ val = parseInt(val);
+ return this.fontSize.items[val];
}
},
- handleNumberedListAction: {
- value: function(e) {
- //this.numberedList.value = false;
- this.bulletedList.value = false;
- this.application.ninja.stage.textTool.doAction("insertorderedlist");
- this.application.ninja.stage.textTool.element.focus();
- }
+ initialized: {
+ value: false
},
- handleBulletedListAction: {
+ handleFontSelectionChange: {
value: function(e) {
- this.numberedList.value = false;
- //this.bulletedList.value = false;
- this.application.ninja.stage.textTool.doAction("insertunorderedlist");
+ this.application.ninja.stage.textTool.doAction("fontname", this.fontSelection.value);
this.application.ninja.stage.textTool.element.focus();
}
},
handleFontColorChange: {
value: function(e) {
- this.application.ninja.stage.textTool.element.style.color = e._event.color.css;
- this.application.ninja.stage.textTool.element.focus();
-
+ this.application.ninja.stage.textTool.element.firstChild.style.color = e._event.color.css;
+ this.application.ninja.stage.textTool.element.firstChild.focus();
//this.application.ninja.stage.textTool.doAction("forecolor",e._event.color.css);
}
--
cgit v1.2.3
From 36cefa3526988cb4dfea107fedaa954a2703260d Mon Sep 17 00:00:00 2001
From: Armen Kesablyan
Date: Mon, 13 Feb 2012 02:20:23 -0800
Subject: Fixed binding to font size dropdown
---
js/components/tools-properties/text-properties.reel/text-properties.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'js/components/tools-properties/text-properties.reel')
diff --git a/js/components/tools-properties/text-properties.reel/text-properties.js b/js/components/tools-properties/text-properties.reel/text-properties.js
index 7ae0cfda..88d38ffe 100644
--- a/js/components/tools-properties/text-properties.reel/text-properties.js
+++ b/js/components/tools-properties/text-properties.reel/text-properties.js
@@ -315,7 +315,7 @@ exports.TextProperties = Montage.create(ToolProperties, {
validateFontSize: {
value: function(val) {
val = parseInt(val);
- return this.fontSize.items[val];
+ return this.fontSize.items[val - 1];
}
},
--
cgit v1.2.3
From 695d1235cd6715a5e911eb61c43af4464a128129 Mon Sep 17 00:00:00 2001
From: Valerio Virgillito
Date: Thu, 16 Feb 2012 14:52:10 -0800
Subject: fixing the Text tool toggle buttons
Signed-off-by: Valerio Virgillito
---
.../text-properties.reel/text-properties.html | 30 ++++++++++++++--------
1 file changed, 20 insertions(+), 10 deletions(-)
(limited to 'js/components/tools-properties/text-properties.reel')
diff --git a/js/components/tools-properties/text-properties.reel/text-properties.html b/js/components/tools-properties/text-properties.reel/text-properties.html
index a7d2af10..13a88ba7 100755
--- a/js/components/tools-properties/text-properties.reel/text-properties.html
+++ b/js/components/tools-properties/text-properties.reel/text-properties.html
@@ -100,7 +100,8 @@
"pressedClass": "active",
"preventFocus": true,
"identifier": "btnBold",
- "label": "B"
+ "pressedLabel": "B",
+ "unpressedLabel": "B"
},
"listeners": [
{
@@ -117,7 +118,8 @@
"pressedClass": "active",
"preventFocus": true,
"identifier": "btnItalic",
- "label": "I"
+ "pressedLabel": "I",
+ "unpressedLabel": "I"
},
"listeners": [
{
@@ -134,7 +136,8 @@
"pressedClass": "active",
"preventFocus": true,
"identifier": "btnUnderline",
- "label": "U"
+ "pressedLabel": "U",
+ "unpressedLabel": "U"
},
"listeners": [
{
@@ -151,7 +154,8 @@
"pressedClass": "active",
"preventFocus": true,
"identifier": "btnStrikethrough",
- "label": "S"
+ "pressedLabel": "S",
+ "unpressedLabel": "S"
},
"listeners": [
{
@@ -169,7 +173,8 @@
"pressedClass": "active",
"preventFocus": true,
"identifier": "alignLeft",
- "label": "Left"
+ "pressedLabel": "Left",
+ "unpressedLabel": "Left"
},
"listeners": [
{
@@ -186,7 +191,8 @@
"pressedClass": "active",
"preventFocus": true,
"identifier": "alignCenter",
- "label": "Center"
+ "pressedLabel": "Center",
+ "unpressedLabel": "Center"
},
"listeners": [
{
@@ -203,7 +209,8 @@
"pressedClass": "active",
"preventFocus": true,
"identifier": "alignRight",
- "label": "Right"
+ "pressedLabel": "Right",
+ "unpressedLabel": "Right"
},
"listeners": [
{
@@ -220,7 +227,8 @@
"pressedClass": "active",
"preventFocus": true,
"identifier": "alignJustify",
- "label": "Justify"
+ "pressedLabel": "Justify",
+ "unpressedLabel": "Justify"
},
"listeners": [
{
@@ -271,7 +279,8 @@
"pressedClass": "active",
"preventFocus": true,
"identifier": "bulletedList",
- "label": "• • •"
+ "pressedLabel": "• • •",
+ "unpressedLabel": "• • •"
},
"listeners": [
{
@@ -288,7 +297,8 @@
"pressedClass": "active",
"preventFocus": true,
"identifier": "numberedList",
- "label": "1 2 3"
+ "pressedLabel": "1 2 3",
+ "unpressedLabel": "1 2 3"
},
"listeners": [
{
--
cgit v1.2.3