You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2013/06/21 23:20:23 UTC
[2/2] git commit: [flex-asjs] [refs/heads/develop] - Set a className
for Alert, Panel,
and TitleBar and then gave ids to key elements. This enables style definitions
such as .Alert #titleBar #title { color: blue} to set style of Alert title
bars.
Set a className for Alert, Panel, and TitleBar and then gave ids to key elements. This enables style definitions such as .Alert #titleBar #title { color: blue} to set style of Alert title bars.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c7d57650
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c7d57650
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c7d57650
Branch: refs/heads/develop
Commit: c7d57650e2dbf7e7deae1b7720a05c585be37ca8
Parents: ffb4c73
Author: Peter Ent <pe...@apache.org>
Authored: Fri Jun 21 17:20:13 2013 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Fri Jun 21 17:20:13 2013 -0400
----------------------------------------------------------------------
.../apache/flex/html/staticControls/Alert.js | 78 ++++++++++----------
.../apache/flex/html/staticControls/Panel.js | 2 +
.../apache/flex/html/staticControls/TitleBar.js | 2 +
3 files changed, 45 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c7d57650/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Alert.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Alert.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Alert.js
index 15cc4e1..7374c8c 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Alert.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Alert.js
@@ -15,10 +15,10 @@
goog.provide('org.apache.flex.html.staticControls.Alert');
goog.require('org.apache.flex.core.UIBase');
-goog.require('org.apache.flex.html.staticControls.TitleBar');
+goog.require('org.apache.flex.html.staticControls.Container');
goog.require('org.apache.flex.html.staticControls.Label');
goog.require('org.apache.flex.html.staticControls.TextButton');
-goog.require('org.apache.flex.html.staticControls.Container');
+goog.require('org.apache.flex.html.staticControls.TitleBar');
/**
@@ -28,99 +28,103 @@ goog.require('org.apache.flex.html.staticControls.Container');
org.apache.flex.html.staticControls.Alert = function() {
goog.base(this);
};
-
goog.inherits(org.apache.flex.html.staticControls.Alert,
org.apache.flex.html.staticControls.Container);
-
-org.apache.flex.html.staticControls.Alert.YES = 0x000001;
-org.apache.flex.html.staticControls.Alert.NO = 0x000002;
-org.apache.flex.html.staticControls.Alert.OK = 0x000004;
+
+org.apache.flex.html.staticControls.Alert.YES = 0x000001;
+org.apache.flex.html.staticControls.Alert.NO = 0x000002;
+org.apache.flex.html.staticControls.Alert.OK = 0x000004;
org.apache.flex.html.staticControls.Alert.CANCEL = 0x000008;
-
+
org.apache.flex.html.staticControls.Alert.prototype.addToParent = function(p) {
goog.base(this, 'addToParent', p);
+ this.element.className = "Alert";
+
// add in a title bar
this.titleBar = new org.apache.flex.html.staticControls.TitleBar();
this.titleBar.addToParent(this);
-
+ this.titleBar.element.id = "titleBar";
+
this.message = new org.apache.flex.html.staticControls.Label();
this.message.addToParent(this);
-
+ this.message.element.id = "message";
+
// add a place for the buttons
this.buttonArea = new org.apache.flex.html.staticControls.Container();
this.buttonArea.addToParent(this);
+ this.buttonArea.element.id = "buttonArea";
};
-org.apache.flex.html.staticControls.Alert.show = function( message, host, title, flags ) {
+org.apache.flex.html.staticControls.Alert.show = function(message, host, title, flags ) {
var a = new org.apache.flex.html.staticControls.Alert();
a.addToParent(host);
a.set_title(title);
a.set_text(message);
a.set_flags(flags);
-
- a.positioner.style.position = "relative";
- a.positioner.style.width = "200px";
- a.positioner.style.margin = "auto";
- a.positioner.style.top = "100px";
-}
-
-org.apache.flex.html.staticControls.Alert.prototype.set_title = function( value )
+
+ a.positioner.style.position = 'relative';
+ a.positioner.style.width = '200px';
+ a.positioner.style.margin = 'auto';
+ a.positioner.style.top = '100px';
+};
+
+org.apache.flex.html.staticControls.Alert.prototype.set_title = function(value )
{
this.titleBar.set_title(value);
-}
+};
org.apache.flex.html.staticControls.Alert.prototype.get_title = function()
{
return this.titleBar.get_title();
-}
+};
-org.apache.flex.html.staticControls.Alert.prototype.set_text = function( value )
+org.apache.flex.html.staticControls.Alert.prototype.set_text = function(value )
{
this.message.set_text(value);
-}
+};
org.apache.flex.html.staticControls.Alert.prototype.get_text = function()
{
return this.message.get_text();
-}
+};
-org.apache.flex.html.staticControls.Alert.prototype.set_flags = function( value )
+org.apache.flex.html.staticControls.Alert.prototype.set_flags = function(value )
{
this.flags = value;
-
+
// add buttons based on flags
- if( this.flags & org.apache.flex.html.staticControls.Alert.OK ) {
+ if (this.flags & org.apache.flex.html.staticControls.Alert.OK) {
var ok = new org.apache.flex.html.staticControls.TextButton();
ok.addToParent(this.buttonArea);
- ok.set_text("OK");
+ ok.set_text('OK');
goog.events.listen(ok.element, 'click', goog.bind(this.dismissAlert, this));
}
- if( this.flags & org.apache.flex.html.staticControls.Alert.CANCEL ) {
+ if (this.flags & org.apache.flex.html.staticControls.Alert.CANCEL) {
var cancel = new org.apache.flex.html.staticControls.TextButton();
cancel.addToParent(this.buttonArea);
- cancel.set_text("Cancel");
+ cancel.set_text('Cancel');
goog.events.listen(cancel.element, 'click', goog.bind(this.dismissAlert, this));
}
- if( this.flags & org.apache.flex.html.staticControls.Alert.YES ) {
+ if (this.flags & org.apache.flex.html.staticControls.Alert.YES) {
var yes = new org.apache.flex.html.staticControls.TextButton();
yes.addToParent(this.buttonArea);
- yes.set_text("YES");
+ yes.set_text('YES');
goog.events.listen(yes.element, 'click', goog.bind(this.dismissAlert, this));
}
- if( this.flags & org.apache.flex.html.staticControls.Alert.NO ) {
+ if (this.flags & org.apache.flex.html.staticControls.Alert.NO) {
var nob = new org.apache.flex.html.staticControls.TextButton();
nob.addToParent(this.buttonArea);
- nob.set_text("NO");
+ nob.set_text('NO');
goog.events.listen(nob.element, 'click', goog.bind(this.dismissAlert, this));
}
-}
+};
org.apache.flex.html.staticControls.Alert.prototype.get_flags = function()
{
return this.flags;
-}
+};
org.apache.flex.html.staticControls.Alert.prototype.dismissAlert = function(event)
{
this.element.parentElement.removeChild(this.element);
-}
\ No newline at end of file
+};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c7d57650/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js
index a566736..3e81565 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/Panel.js
@@ -41,9 +41,11 @@ org.apache.flex.html.staticControls.Panel.prototype.addToParent =
var cb;
this.element = document.createElement('div');
+ this.element.className = "Panel";
this.titleBar = new org.apache.flex.html.staticControls.TitleBar();
this.titleBar.addToParent(this);
+ this.titleBar.element.id = "titleBar";
this.titleBar.title = "Sample Panel";
p.internalAddChild(this.element);
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c7d57650/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js
index 8b9a45c..71841d7 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/TitleBar.js
@@ -46,11 +46,13 @@ org.apache.flex.html.staticControls.TitleBar.prototype.addToParent =
this.titleLabel = new org.apache.flex.html.staticControls.Label();
this.titleLabel.addToParent(this);
+ this.titleLabel.element.id = "title";
this.titleLabel.positioner.style.display = "inline-block";
this.titleLabel.set_className("TitleBarLabel");
this.titleButton = new org.apache.flex.html.staticControls.TextButton();
this.titleButton.addToParent(this);
+ this.titleButton.element.id = "closeButton";
this.titleButton.text = 'Close';
this.titleButton.positioner.style.display = this._showCloseButton ? "inline-block" : "none";
this.titleButton.positioner.style.position = "absolute";