You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/09/03 02:17:38 UTC

[05/30] Radii8 code base as accepted by IP Clearance

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/views/windows/ExportDocumentWindow.mxml
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/views/windows/ExportDocumentWindow.mxml b/Radii8Library/src/com/flexcapacitor/views/windows/ExportDocumentWindow.mxml
new file mode 100644
index 0000000..45a5673
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/views/windows/ExportDocumentWindow.mxml
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<windows:AnimatedPanelWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" 
+			   xmlns:handlers="com.flexcapacitor.handlers.*" 
+			   xmlns:fc="com.flexcapacitor.effects.popup.*"
+			   xmlns:views="com.flexcapacitor.views.*"
+			   xmlns:panels="com.flexcapacitor.views.panels.*"
+			   xmlns:windows="com.flexcapacitor.views.windows.*" 
+			   
+			   title="Save As..."
+			   creationComplete="panel1_creationCompleteHandler(event)" 
+			   >
+	
+	<fx:Script>
+		<![CDATA[
+			import com.flexcapacitor.controller.Radiate;
+			import com.flexcapacitor.events.RadiateEvent;
+			
+			import mx.events.EffectEvent;
+			import mx.events.FlexEvent;
+			
+			public static const NEW_DOCUMENT:String = "newDocument";
+			public static const CURRENT_DOCUMENT:String = "currentDocument";
+			public static const CURRENT_SELECTION:String = "currentSelection";
+			
+			
+			protected function panel1_creationCompleteHandler(event:FlexEvent):void {
+				codeInspector.exportWindow = true;
+				codeInspector.activate();
+			}
+			
+			protected function eventhandler1_effectEndHandler(event:EffectEvent):void {
+				codeInspector.deactivate();
+			}
+			
+			protected function saveButton_clickHandler(event:MouseEvent):void {
+				var radiate:Radiate = Radiate.getInstance();
+				var codeType:String = codeInspector.codeType.selectedItem as String;
+				var extension:String = (codeType==CodeInspector.HTML) ? "html" : (codeType==CodeInspector.MXML) ? "mxml" : "xml";
+				
+				radiate.saveFileAs(codeInspector.sourceCode, radiate.selectedDocument.name, extension);
+				radiate.addEventListener(RadiateEvent.DOCUMENT_SAVE_COMPLETE, completeHandler, false, 0, true);
+				radiate.addEventListener(RadiateEvent.DOCUMENT_SAVE_AS_CANCEL, cancelHandler, false, 0, true);
+			}
+			
+			protected function completeHandler(event:Event):void {
+				codeInspector.deactivate();
+				closePopUp.startDelay = closePanelDelay;
+				closePopUp.play();
+			}
+			
+			protected function cancelHandler(event:Event):void {
+				//Radiate.log.info("Canceled Save");
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		
+		<!--- hide about popup -->
+		<handlers:EventHandler targets="{cancelButton}" eventName="click" >
+			<s:SetAction property="action" target="{this}" value="cancel"/>
+			<fc:ClosePopUp id="closePopUp" popUp="{this}" effectEnd="eventhandler1_effectEndHandler(event)"/>
+		</handlers:EventHandler>
+		
+		<!--- hide about popup -->
+		<!--<handlers:EventHandler targets="{saveButton}" eventName="click" >
+			<s:SetAction property="action" target="{this}" value="save"/>
+		</handlers:EventHandler>-->
+		
+		<fx:String id="action"></fx:String>
+		
+		<s:RadioButtonGroup id="exportLocation"  />
+	</fx:Declarations>
+	
+	
+	<s:VGroup left="15" 
+				 top="20" 
+				 right="20"
+				 bottom="20">
+		
+		<!--<s:Label x="15" y="65" text="Paste in the MXML code below:" fontWeight="bold"/>-->
+		
+		<panels:CodeInspector id="codeInspector" 
+							 width="100%" height="300"
+							 />
+		
+		<!--<s:HGroup x="14" y="31" width="100%" horizontalAlign="right" verticalAlign="baseline">
+			<s:Label x="15" y="15" text="Export:" fontWeight="bold"/>
+			<s:Spacer width="100%"/>
+			<s:RadioButton x="190" 
+						   y="130" 
+						   label="Current Document" 
+						   group="{exportLocation}"
+						   value="{CURRENT_DOCUMENT}"
+						   />
+			<s:RadioButton x="190" 
+						   y="130" 
+						   label="Selected Component" 
+						   group="{exportLocation}"
+						   value="{CURRENT_SELECTION}"
+						   />
+		</s:HGroup>-->
+		
+		<s:Label id="warningLabel_Ha" 
+				 x="15" y="15" 
+				 text="Warning: XML is invalid" 
+				 fontWeight="bold" 
+				 color="red"
+				 includeInLayout="false"
+				 visible="false"
+				 width="100%"/>
+		
+		<s:HGroup width="100%" right="10" bottom="10" verticalAlign="baseline">
+			<s:Spacer width="100%"/>
+			<s:Button id="cancelButton" label="Cancel" />
+			<s:Button id="saveButton" label="Save" click="saveButton_clickHandler(event)"/>
+		</s:HGroup>
+	</s:VGroup>
+	
+</windows:AnimatedPanelWindow>

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/views/windows/ImportWindow.mxml
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/views/windows/ImportWindow.mxml b/Radii8Library/src/com/flexcapacitor/views/windows/ImportWindow.mxml
new file mode 100644
index 0000000..fa09b94
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/views/windows/ImportWindow.mxml
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<windows:AnimatedPanelWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" 
+			   xmlns:c="com.flexcapacitor.views.*"
+			   xmlns:handlers="com.flexcapacitor.handlers.*"
+			   xmlns:fc="com.flexcapacitor.effects.popup.*"
+			   xmlns:windows="com.flexcapacitor.views.windows.*"
+			   
+			   title="Import"
+			   hide="animatedpanelwindow1_hideHandler(event)" 
+			   >
+	
+	<fx:Script>
+		<![CDATA[
+			import com.flexcapacitor.controller.Radiate;
+			import com.flexcapacitor.model.IDocument;
+			import com.flexcapacitor.utils.SyntaxHighlighter;
+			import com.flexcapacitor.utils.XMLUtils;
+			
+			import mx.controls.Alert;
+			import mx.core.IVisualElement;
+			import mx.events.FlexEvent;
+			
+			public static const NEW_DOCUMENT:String = "newDocument";
+			public static const CURRENT_DOCUMENT:String = "currentDocument";
+			public static const CURRENT_SELECTION:String = "currentSelection";
+			public static const IMPORT:String = "import";
+			
+			private var _code:String;
+
+			public function get code():String {
+				
+				var text:String = mxTextArea.text;
+				return text;
+			}
+
+			public function set code(value:String):void {
+				_code = value;
+			}
+
+			public var warningMessage:String = "Warning: XML is invalid and may not import correctly.";
+			
+			protected function changeHandler(event:Event):void {
+				
+				if (!syntaxHighlighter) {
+					syntaxHighlighter = new SyntaxHighlighter(mxTextArea);
+					syntaxHighlighter.timerInterval = 20;
+					syntaxHighlighter.cssString = SyntaxHighlighter.CRIMSON_EDITOR_CSS;
+				}
+				
+				syntaxHighlighter.highlightCode();
+				
+				var isValid:Boolean = XMLUtils.isValidXML(code);
+				
+				if (!isValid && code!="") {
+					var message:String = XMLUtils.validationError ? "Warning:" +  XMLUtils.validationError.message : warningMessage;
+					warningLabel_Ha.text = message;
+					warningLabel_Ha.visible = true;
+					warningLabel_Ha.includeInLayout = true;
+				}
+				else {
+					warningLabel_Ha.visible = false;
+					warningLabel_Ha.includeInLayout = false;
+				}
+				
+			}
+			
+			
+			/**
+			 * Import 
+			 * */
+			protected function importPopUp_closeHandler(event:Event):void {
+				var radiate:Radiate = Radiate.getInstance();
+				var selectedDocument:IDocument = radiate.selectedDocument;
+				var type:String = importLocation.selectedValue as String;
+				
+				if (action==ImportWindow.IMPORT) {
+					if (type==ImportWindow.NEW_DOCUMENT) {
+						radiate.importMXMLDocument(radiate.selectedProject, null, null, code);
+					}
+					else if (type==ImportWindow.CURRENT_DOCUMENT && selectedDocument) {
+						radiate.importMXMLDocument(radiate.selectedProject, selectedDocument, null, code);
+					}
+					else if (type==ImportWindow.CURRENT_SELECTION && radiate.target is IVisualElement) {
+						if (radiate.target is IVisualElement) {
+							radiate.importMXMLDocument(radiate.selectedProject, selectedDocument, IVisualElement(radiate.target), code);
+						}
+						Alert.show("Please select a visual element");
+					}
+					else {
+						Alert.show("Please select a document");
+					}
+				}
+				
+				closePopUp.startDelay = 500;
+				closePopUp.play();
+			}
+			
+			public var syntaxHighlighter:SyntaxHighlighter;
+			
+			protected function animatedpanelwindow1_hideHandler(event:FlexEvent):void {
+				if (syntaxHighlighter) {
+					syntaxHighlighter.mxTextArea = null;
+				}
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		
+		<!--- hide about popup -->
+		<handlers:EventHandler targets="{cancelButton}" eventName="click" setTriggerEvent="true">
+			<s:SetAction property="action" target="{this}" value="cancel"/>
+			<fc:ClosePopUp popUp="{this}"  />
+		</handlers:EventHandler>
+		
+		<!--- hide about popup -->
+		<handlers:EventHandler targets="{importButton}" eventName="click" setTriggerEvent="true">
+			<s:SetAction property="action" target="{this}" value="import"/>
+			<fc:ClosePopUp id="closePopUp" popUp="{this}"  />
+		</handlers:EventHandler>
+		
+		<fx:String id="action"></fx:String>
+		
+		<s:RadioButtonGroup id="importLocation"  />
+	</fx:Declarations>
+	
+	
+	<s:VGroup left="15" 
+				 top="20" 
+				 right="20"
+				 bottom="20">
+		
+		<s:Label x="15" y="65" text="Paste in the MXML code below:" fontWeight="bold"/>
+		
+		<mx:TextArea id="mxTextArea"  
+					 focusAlpha="0"
+					 fontFamily="Monaco,Menlo,Ubuntu Mono,Consolas,source-code-pro,monospace"
+					 borderVisible="true"
+					 fontSize="12"
+					 width="100%" height="300"
+					 editable="true"
+					 leading="0"
+					 change="changeHandler(event)"
+					 />
+		
+		<s:HGroup x="14" y="31" width="100%" horizontalAlign="right">
+			<s:Label x="15" y="15" text="Import to:" fontWeight="bold"/>
+			<s:Spacer width="100%"/>
+			<s:RadioButton x="91" 
+						   y="128" 
+						   label="New Document" 
+						   selected="false" 
+						   group="{importLocation}"
+						   value="{NEW_DOCUMENT}"
+						   />
+			<s:RadioButton x="190" 
+						   y="130" 
+						   selected="true"
+						   label="Current Document" 
+						   group="{importLocation}"
+						   value="{CURRENT_DOCUMENT}"
+						   />
+			<s:RadioButton x="190" 
+						   y="130" 
+						   label="Selected Component" 
+						   group="{importLocation}"
+						   value="{CURRENT_SELECTION}"
+						   />
+		</s:HGroup>
+		
+		<s:Label id="warningLabel_Ha" 
+				 x="15" y="15" 
+				 text="Warning: XML is invalid" 
+				 fontWeight="bold" 
+				 color="red"
+				 includeInLayout="false"
+				 visible="false"
+				 width="100%"/>
+		
+		<s:HGroup width="100%" right="10" bottom="10" verticalAlign="baseline">
+			<s:Spacer width="100%"/>
+			<s:Button id="cancelButton" label="Cancel" />
+			<s:Button id="importButton" label="Import" />
+		</s:HGroup>
+	</s:VGroup>
+	
+</windows:AnimatedPanelWindow>

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/views/windows/LoginWindow.mxml
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/views/windows/LoginWindow.mxml b/Radii8Library/src/com/flexcapacitor/views/windows/LoginWindow.mxml
new file mode 100644
index 0000000..a76c2f8
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/views/windows/LoginWindow.mxml
@@ -0,0 +1,930 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<windows:AnimatedPanelWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" 
+			   xmlns:handlers="com.flexcapacitor.handlers.*" 
+			   xmlns:fc="com.flexcapacitor.effects.popup.*"
+			   xmlns:controls="com.flexcapacitor.controls.*"
+			   xmlns:c="com.flexcapacitor.views.windows.*"
+			   xmlns:core="com.flexcapacitor.effects.core.*"
+			   xmlns:windows="com.flexcapacitor.views.windows.*"
+			   
+			   title.login="Login"
+			   title.logout="Logout"
+			   title.register="Register"
+			   title.registrationWithSite="Register"
+			   title.lostPassword="Lost Password"
+			   title.lostPasswordConfirmation="Change Password"
+			   title.loginAfterPasswordChanged="Login"
+			   title.changePassword="Change Password"
+			   
+			   creationComplete="creationCompleteHandler(event)"
+			   stateChangeComplete="stateChangeCompleteHandler(event)"
+			   >
+	
+	<fx:Style>
+		@namespace s "library://ns.adobe.com/flex/spark";
+		@namespace c "com.flexcapacitor.controls.*";
+		@namespace mx "library://ns.adobe.com/flex/mx";
+		@namespace handlers "com.flexcapacitor.handlers.*";
+		@namespace fc "com.flexcapacitor.effects.popup.*";
+		
+	</fx:Style>
+	
+	<fx:Script>
+		<![CDATA[
+			import com.flexcapacitor.controller.Radiate;
+			import com.flexcapacitor.events.RadiateEvent;
+			import com.flexcapacitor.utils.StoreLogin;
+			
+			import mx.core.Singleton;
+			import mx.core.mx_internal;
+			import mx.events.FlexEvent;
+			import mx.events.ResizeEvent;
+			import mx.managers.PopUpData;
+			import mx.managers.PopUpManager;
+			import mx.managers.PopUpManagerImpl;
+			
+			use namespace mx_internal;
+			
+			private var username:String;
+			
+			public static const REGISTER:String = "register";
+			public static const LOGIN:String = "login";
+			public static const LOGOUT:String = "logout";
+			public static const LOST_PASSWORD:String = "lostPassword";
+			public static const LOST_PASSWORD_CONFIRMATION:String = "lostPasswordConfirmation";
+			public static const LOGIN_AFTER_PASSWORD_CHANGED:String = "loginAfterPasswordChanged";
+			public static const LOGIN_AFTER_REGISTRATION:String = "loginAfterRegistration";
+			public static const REGISTRATION_WITH_SITE:String = "registrationWithSite";
+			
+			// There should be a form on our HTML page. 
+			// The browser will fill the form with values if the user logged in before
+			// If there are multiple users it will fill it with the last user
+			// Or if it's blank it will autofill the password when a username is entered into the form
+			// 
+			// What we do is this:
+			// 
+			// 1. add scripts to the page when the application loads
+			// 2. check for existing form values set by the browser
+			// 3. fill in our Flash form with those values
+			protected function creationCompleteHandler(event:FlexEvent):void {
+				var savePassword:StoreLogin = new StoreLogin();
+				var savePasswordCreated:Boolean;
+				
+				savePasswordCreated = savePassword.initialize(); // places our javascript onto the page
+				checkForValues();
+				
+				radiate = Radiate.getInstance();
+				//trace("creation");
+				// apply after opened
+				//setStyle("moveEffect", moveEffect);
+			}
+			
+			/**
+			 * Gets form values from page
+			 * */
+			protected function checkForValues():void {
+				var savePassword:StoreLogin = new StoreLogin();
+				var loginItems:Array;
+				
+				loginItems = savePassword.getFormValues(); // gets existing form values
+				
+				if (loginItems.length>0) {
+					if (currentState=="login") {
+						usernameTextInput.text = loginItems[0];
+						passwordTextInput.text = loginItems[1];
+					}
+				}
+			}
+			
+			/**
+			 * To get the browser to save our login we need to submit the form. 
+			 * 
+			 * 4. Copy our login information to the form on the HTML page
+			 * 5. Submit the form - the form is benign (it doesn't go anywhere). 
+			 * this causes the browser to display a save password dialog
+			 * 6. After calling submit form continue to handle the login procedure as 
+			 * you normally would. IE Continue to use HTTPService, URLRequest, etc
+			 **/
+			protected function login():void {
+				var savePassword:StoreLogin = new StoreLogin();
+				var setValues:Boolean = savePassword.setFormValues(usernameTextInput.text, passwordTextInput.text);
+				var results:Boolean;
+				
+				if (rememberLoginCheckbox.selected) {
+					results = savePassword.submitForm();
+				}
+				
+				loginWarningsLabel.text = "";
+				radiate.login(usernameTextInput.text, passwordTextInput.text);
+				radiate.addEventListener(RadiateEvent.LOGIN_RESULTS, loginResultsHandler, false, 0, true);
+				inProgress = true;
+			}
+			
+			
+			// OPTIONAL - support multiple accounts or username required to autofill browsers
+			// - does not work in chrome. the only solution so far is to login with a user 
+			//   for that user to be remembered the next time
+			// 
+			// If the form is blank then it may be because we have multiple accounts
+			// Let the user type in a name / username and then when they tab to password
+			// 7. check if the browser has filled in the password after username is entered
+			// 8. fill in our password field with the password
+			protected function username_focusOutHandler(event:FocusEvent):void {
+				var savePassword:StoreLogin = new StoreLogin();
+				var results:Object;
+				var value:String;
+				
+				// if username or password is blank check for password after supplying username
+				value = savePassword.checkForPassword(usernameTextInput.text);
+				
+				if (value!="") {
+					passwordTextInput.text = value;
+					passwordTextInput.selectAll();
+				}
+				
+				// set focus on our text field
+				passwordTextInput.setFocus();
+				
+				// we have to focus back on flash because of the javascript we use
+				results = savePassword.setFocusOnFlash();
+				
+			}
+			
+			private function logout():void {
+				logoutWarningsLabel.text = "";
+				radiate = Radiate.getInstance();
+				radiate.addEventListener(RadiateEvent.LOGOUT_RESULTS, logoutResultsHandler, false, 0, true);
+				radiate.logout();
+				inProgress = true;
+			}
+			
+			private function register():void {
+				registrationWarningsLabel.text = "";
+				radiate = Radiate.getInstance();
+				radiate.addEventListener(RadiateEvent.REGISTER_RESULTS, registerResultsHandler, false, 0, true);
+				radiate.register(newUsernameTextInput.text, emailTextInput.text);
+				inProgress = true;
+			}
+			
+			private function registerUserAndSite():void {
+				registrationWarningsLabel.text = "";
+				radiate.addEventListener(RadiateEvent.REGISTER_RESULTS, registerResultsHandler, false, 0, true);
+				radiate.registerUserAndSite(newUsernameTextInput.text, emailTextInput.text, newSiteTextInput.text, newSiteTitleTextInput.text);
+				inProgress = true;
+			}
+			
+			protected function goToLoginAfterRegistrationState():void {
+				currentState = LOGIN_AFTER_REGISTRATION;
+			}
+			
+			protected function goToRegistrationWithSiteState():void {
+				currentState = REGISTRATION_WITH_SITE;
+			}
+			
+			protected function goToRegistrationState():void {
+				currentState = REGISTER;
+			}
+			
+			protected function goToLogoutState():void {
+				currentState = LOGOUT;
+			}
+			
+			protected function goToLoginState():void {
+				currentState = LOGIN;
+				checkForValues();
+			}
+			
+			protected function goToLostPasswordState():void {
+				currentState = LOST_PASSWORD;
+			}
+			
+			protected function goToLostPasswordConfirmationState():void {
+				currentState = LOST_PASSWORD_CONFIRMATION;
+			}
+			
+			
+			private function createRandomPassword(hashLen:uint, 
+												  includeLowercase:Boolean = true, 
+												  includeUppercase:Boolean = true, 
+												  includeNumbers:Boolean = true, 
+												  includeCharacters:Boolean = true):String {
+				var strHash:String = "";
+				if (includeLowercase) strHash += "abchefghjkmnpqrstuvwxyz";
+				if (includeNumbers) strHash += "0123456789";
+				if (includeUppercase) strHash += "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+				if (includeCharacters) strHash += "~!@#$%^&*()-_=+[{]}\|;:/?.>,<";
+				
+				var maskPick:Number;
+				var passwordStr:String = "";
+				var maskLen:uint = strHash.length;
+				
+				for (var i:uint = 0; i < hashLen; i++) {
+					maskPick = Math.floor(Math.random() * maskLen);
+					passwordStr += strHash.charAt(maskPick);
+				}
+				
+				return passwordStr;
+			}
+			
+			///////////////////////////////////////////////////////////
+			//
+			//  HANDLERS
+			// 
+			///////////////////////////////////////////////////////////
+			
+			
+			protected function getNewPasswordButton_clickHandler(event:MouseEvent = null):void {
+				inProgress = true;
+				lostPasswordWarningsLabel.text = "";
+				username = usernameOrEmailTextInput.text;
+				radiate.addEventListener(RadiateEvent.LOST_PASSWORD_RESULTS, onLostPasswordResults, false, 0, true);
+				radiate.lostPassword(usernameOrEmailTextInput.text);
+			}
+			
+			protected function changePasswordButton_clickHandler(event:MouseEvent):void {
+				inProgress = true;
+				changePasswordWarningsLabel.text = "";
+				radiate.addEventListener(RadiateEvent.CHANGE_PASSWORD_RESULTS, onChangePasswordResults, false, 0, true);
+				radiate.changePassword(confirmationCodeTextInput.text, username, newPasswordTextInput.text, newPasswordTextInput2.text);
+			}
+			
+			protected function generatePasswordButton_clickHandler(event:MouseEvent):void {
+				var password:String = createRandomPassword(12, true, true, true, false);
+				newPasswordTextInput.text = password;
+				newPasswordTextInput2.text = password;
+			}
+			
+			protected function panel1_resizeHandler(event:ResizeEvent):void {
+				if (stage && !addedEffect.isPlaying) {
+					// to fix bug on line 505 of PopUpManagerImpl
+					var popUpImp:PopUpManagerImpl = PopUpManagerImpl(Singleton.getInstance("mx.managers::IPopUpManager"));
+					var popupInfo:Array = popUpImp.popupInfo;
+					
+					const n:int = popupInfo.length;
+					var instanceIndex:int = -1;
+					
+					for (var i:int = 0; i < n; i++) {
+						var o:PopUpData = popupInfo[i];
+						if (o.owner == this) {
+							instanceIndex = i;
+						}
+					}
+					
+					if (instanceIndex!=-1) {
+						PopUpManager.centerPopUp(this);
+					}
+				}
+			}
+			
+			protected function cancelButton_clickHandler(event:MouseEvent):void {
+				callLater(PopUpManager.removePopUp, [this]);
+			}
+			
+			
+			protected function usernameOrEmailTextInput_keyUpHandler(event:KeyboardEvent):void {
+				if (event.keyCode==Keyboard.ENTER) {
+					getNewPasswordButton_clickHandler(null);
+				}
+			}
+			
+			/**
+			 * Handle logout 
+			 * */
+			protected function logoutResultsHandler(event:RadiateEvent):void {
+				var data:Object = event.data;
+				var error:String;
+				var label:Label;
+				var message:String = "";
+				
+				radiate.removeEventListener(RadiateEvent.LOGOUT_RESULTS, logoutResultsHandler);
+				
+				logoutWarningsLabel.text = "";
+
+				if (data && data is Object) {
+					for each (error in data.errors) {
+						message += error + " ";
+					}
+				}
+				
+				inProgress = false;
+			
+				if (event.faultEvent is IOErrorEvent) {
+				
+					message = "Are you connected to the internet? ";
+					
+					if (event.faultEvent is IOErrorEvent) {
+						message = IOErrorEvent(event.faultEvent).text;
+					}
+					else if (event.faultEvent is SecurityErrorEvent) {
+						
+						if (SecurityErrorEvent(event.faultEvent).errorID==2048) {
+							
+						}
+						
+						message += SecurityErrorEvent(event.faultEvent).text;
+					}
+				}
+				
+				if (data && data is Object && data.loggedIn==false) {
+					closePopUp.startDelay = closePanelDelay;
+					closePopUp.play();
+				}
+				
+				logoutWarningsLabel.text = message;
+			}
+			
+			/**
+			 * Handle register 
+			 * */
+			protected function registerResultsHandler(event:RadiateEvent):void {
+				var data:Object = event.data;
+				var error:String;
+				var label:Label;
+				var message:String = "";
+				var successful:Boolean = event.successful;
+				var errors:Array;
+				
+				radiate.removeEventListener(RadiateEvent.REGISTER_RESULTS, registerResultsHandler);
+				
+				registrationWarningsLabel.text = "";
+		
+				for (error in data.errors) {
+					// user_email, user_name
+					if (error=="incorrect_password") {
+						message += "The password you entered is incorrect. "
+					}
+					else if (error=="invalid_username") {
+						message += "The username you entered is not found. "
+					}
+					else if (data.errors[error] is Array) {
+						errors = data.errors[error] as Array;
+						
+						if (error=="blogname" && errors.indexOf("Only lowercase letters")!=-1) {
+							message += "Only lowercase letters (a-z) and numbers are allowed in the site name.";
+						}
+						else {
+							message += errors.join(" ") + " ";
+						}
+					}
+					else {
+						message += error + " ";
+					}
+					
+				}
+				
+				inProgress = false;
+				
+				message = message.replace(/<strong>ERROR<\/strong>: /i, "");
+	
+				if (event.faultEvent is IOErrorEvent) {
+				
+					message = "Are you connected to the internet? ";
+					
+					if (event.faultEvent is IOErrorEvent) {
+						message = IOErrorEvent(event.faultEvent).text;
+					}
+					else if (event.faultEvent is SecurityErrorEvent) {
+						
+						if (SecurityErrorEvent(event.faultEvent).errorID==2048) {
+							
+						}
+						
+						message += SecurityErrorEvent(event.faultEvent).text;
+					}
+				}
+				
+				if (data && data is Object && successful) {
+					goToLoginAfterRegistrationState();
+					validateNow();
+					
+					if (usernameTextInput) {
+						usernameTextInput.text = newUsernameTextInput.text;
+					}
+					
+					if (data.site) {
+						message = data.site.message;
+						message = message ? message.replace(/site/g, "account") : null;
+					}
+					else {
+						message = "You have successfully registered your username.";
+					}
+					
+					loginAfterRegistrationLabel.text = message;
+					return;
+				}
+				
+				registrationWarningsLabel.text = message;
+			}
+			
+			/**
+			 * Login results handler
+			 * */
+			protected function loginResultsHandler(event:RadiateEvent):void {
+				var data:Object = event.data;
+				var error:String;
+				var label:Label;
+				var message:String = "";
+				var successful:Boolean = event.successful;
+
+				radiate.removeEventListener(RadiateEvent.LOGIN_RESULTS, loginResultsHandler);
+				
+				loginWarningsLabel.text = "";
+				
+				for (error in data.errors) {
+					
+					if (error=="incorrect_password") {
+						message += "The password you entered is incorrect. "
+					}
+					else if (error=="invalid_username") {
+						message += "The username you entered is not found. "
+					}
+					else {
+						error = data.errors[error][0].replace(/<strong>ERROR<\/strong>: /i, "");
+						message += error + " ";
+					}
+				}
+				
+				inProgress = false;
+			
+				if (event.faultEvent is IOErrorEvent) {
+					message = "Are you connected to the internet? ";
+					
+					if (event.faultEvent is IOErrorEvent) {
+						message = IOErrorEvent(event.faultEvent).text;
+					}
+					else if (event.faultEvent is SecurityErrorEvent) {
+						
+						if (SecurityErrorEvent(event.faultEvent).errorID==2048) {
+							
+						}
+						
+						message += SecurityErrorEvent(event.faultEvent).text;
+					}
+				}
+				
+				
+				if (data && data is Object && successful) {
+					dispatchEvent(new Event(LOGIN));
+					closePopUp.startDelay = 250;
+					closePopUp.play();
+				}
+				
+				
+				loginWarningsLabel.text = message;
+			}
+			
+			protected function onLostPasswordResults(event:RadiateEvent):void {
+				var data:Object = event.data;
+				var error:String;
+				var message:String = "";
+				inProgress = false;
+			
+				if (data && data is Object && data.sent==true) {
+					loginWarningsLabel.text = "";
+					currentState = LOST_PASSWORD_CONFIRMATION;
+					//logoutWarningsLabel.text = "";
+					//closePopUp.startDelay = 250;
+					//closePopUp.play();
+					return;
+				}
+				
+				lostPasswordWarningsLabel.text = "";
+				
+				for (error in data.errors) {
+					
+					if (error=="incorrect_password") {
+						lostPasswordWarningsLabel.text += "The password you entered is incorrect."
+					}
+					else if (error=="invalid_username") {
+						lostPasswordWarningsLabel.text += "The username you entered is not found."
+					}
+					else {
+						error = data.errors[error][0].replace(/<strong>ERROR<\/strong>: /i, "");
+						lostPasswordWarningsLabel.text += error;
+					}
+				}
+				
+				radiate.removeEventListener(RadiateEvent.LOST_PASSWORD_RESULTS, onLostPasswordResults);
+			}
+			
+			protected function onChangePasswordResults(event:RadiateEvent):void {
+				var data:Object = event.data;
+				var error:String;
+				var message:String = "";
+				inProgress = false;
+				
+	
+				if (data && data is Object && data.reset==true) {
+					currentState = LOGIN_AFTER_PASSWORD_CHANGED;
+					usernameTextInput.text = username;
+					passwordTextInput.text = newPasswordTextInput.text;
+					//logoutWarningsLabel.text = "";
+					//closePopUp.startDelay = 250;
+					//closePopUp.play();
+					return;
+				}
+				
+				changePasswordWarningsLabel.text = "";
+				
+				for (error in data.errors) {
+					
+					if (error=="invalid_key") {
+						changePasswordWarningsLabel.text += "The key you entered is invalid."
+					}
+					else if (error=="expired_key") {
+						changePasswordWarningsLabel.text += "The key you entered has expired."
+					}
+					else if (error=="invalid_login") {
+						changePasswordWarningsLabel.text += "The username is invalid."
+					}
+					else if (error=="password_not_set") {
+						changePasswordWarningsLabel.text += "The password is not set."
+					}
+					else if (error=="password_reset_mismatch") {
+						changePasswordWarningsLabel.text += "The passwords do not match."
+					}
+					else {
+						error = data.errors[error][0].replace(/<strong>ERROR<\/strong>: /i, "");
+						changePasswordWarningsLabel.text += error;
+					}
+				}
+					
+				radiate.removeEventListener(RadiateEvent.CHANGE_PASSWORD_RESULTS, onChangePasswordResults);
+			}
+			
+			protected function stateChangeCompleteHandler(event:FlexEvent):void {
+				
+				addMoveEffect();
+				PopUpManager.centerPopUp(this);
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		
+		<!--- hide about popup -->
+		<handlers:EventHandler targets="{cancelButton}" eventName="clickNOT">
+			<fc:ClosePopUp id="closePopUp" popUp="{this}" />
+		</handlers:EventHandler>
+
+		
+		<!--- hide about popup -->
+		<!--<handlers:EventHandler targets="{importButton}" eventName="click">
+			<s:SetAction property="action" target="{this}" value="import"/>
+			<fc:ClosePopUp popUp="{this}"  />
+		</handlers:EventHandler>-->
+		
+		<fx:String id="action"></fx:String>
+		
+	</fx:Declarations>
+	
+	
+	<c:states>
+		<s:State name="login" />
+		<s:State name="logout" />
+		<s:State name="loginAfterPasswordChanged" basedOn="login" />
+		<s:State name="loginAfterRegistration" basedOn="login" />
+		<s:State name="register" />
+		<s:State name="registrationWithSite" basedOn="register"/>
+		<s:State name="lostPassword" />
+		<s:State name="lostPasswordConfirmation" />
+		<s:State name="changePassword" />
+	</c:states>
+	
+	
+	<!-- REGISTRATION -->
+	<s:Label text.register="Please enter a user name and email."
+			 text.registrationWithSite="Please enter a user name, email, site name and title. If you leave the site name and site title blank your username will be used. "
+			 fontSize="13"
+			 top="70"
+			 right="20"
+			 width="45%"
+			 includeIn="register,registrationWithSite" />
+	
+	<controls:VerticalLine height="60%" horizontalCenter="0" top="20" includeIn="register,registrationWithSite"/>
+	
+	<s:VGroup left="15" 
+				 top="20" 
+				 right="20" 
+				 bottom="20"
+				 gap="10"
+				 includeIn="register, registrationWithSite"
+				 >
+		
+		<s:Label text="Username" fontSize="18" styleName="textInputStyles"/>
+		<s:TextInput id="newUsernameTextInput" 
+					 text="" 
+					 prompt="Username"
+					 minWidth="220"
+					 fontSize="18" 
+					 styleName="textInputStyles"
+					 />
+		<s:Label text="E-mail" fontSize="18" styleName="textInputStyles"/>
+		<s:TextInput id="emailTextInput" 
+					 text="" 
+					 prompt="Email"
+					 fontSize="18" 
+					 minWidth="220"
+					 styleName="textInputStyles"
+					 />
+		
+		<!-- registration of site -->
+		<s:Label text="Site Name" 
+				 fontSize="18" 
+				 styleName="textInputStyles"
+				 includeIn="registrationWithSite"/>
+		<s:TextInput id="newSiteTextInput" 
+					 text="" 
+					 prompt="Site name"
+					 minWidth="220"
+					 fontSize="18" 
+					 styleName="textInputStyles"
+					 includeIn="registrationWithSite"
+					 />
+		<s:Label text="Site Title" 
+				 fontSize="18" 
+				 styleName="textInputStyles"
+				 includeIn="registrationWithSite"/>
+		<s:TextInput id="newSiteTitleTextInput" 
+					 text="" 
+					 prompt="Title"
+					 fontSize="18" 
+					 minWidth="220"
+					 styleName="textInputStyles"
+					 includeIn="registrationWithSite"
+					 />
+		
+		
+		<s:Label id="registrationWarningsLabel" 
+				 x="15" y="15" 
+				 text="" 
+				 fontWeight="bold" 
+				 color="red"
+				 width="50%"/>
+		
+		<s:HGroup width="100%" horizontalAlign="right" verticalAlign="baseline">
+			<s:Label text="Login" 
+					 styleName="stateLabel" 
+					 click="goToLoginState()"
+					 useHandCursor="true"
+					 buttonMode="true"/>
+			<s:Label text="Please wait..." 
+					 visible="{inProgress}"
+					 />
+			<s:Spacer width="100%"/>
+			<s:Button label="Register" 
+					  click.register="register()" 
+					  click.registrationWithSite="registerUserAndSite()"/>
+		</s:HGroup>
+		
+	</s:VGroup>
+
+	<!-- LOGIN AFTER REGISTRATION -->
+	<s:TextArea id="loginAfterRegistrationLabel" 
+			 text="A password will be emailed to you. Check your email for login information. If you don't see the email check your spam folder. " 
+			 fontSize="13"
+			 top="30"
+			 right="20"
+			 width="45%"
+			 height="130"
+			 includeIn="loginAfterRegistration"
+			 editable="false"
+			 borderVisible="false"/>
+	
+	<controls:VerticalLine height="60%" horizontalCenter="0" top="20" includeIn="loginAfterRegistration"/>
+	
+	<!-- LOGIN -->
+	<s:VGroup left="15" 
+				 top="20" 
+				 right="20"
+				 bottom="20"
+				 gap="10"
+				 includeIn="login"
+				 >
+		
+		<s:Label text="Username" fontSize="18" />
+		<s:TextInput id="usernameTextInput" 
+					 text="" 
+					 focusOut="username_focusOutHandler(event)" 
+					 prompt="Username"
+					 fontSize="18" styleName="textInputStyles"
+					 />
+		<s:Label text="Password" fontSize="18" />
+		<s:TextInput id="passwordTextInput" 
+					 text="" 
+					 displayAsPassword="true" 
+					 prompt="Password"
+					 fontSize="18" styleName="textInputStyles"
+					 />
+		
+		<s:Label id="loginWarningsLabel" 
+				 x="15" y="15" 
+				 text="" 
+				 fontWeight="bold" 
+				 color="red"
+				 width="100%"/>
+		
+		<s:HGroup width="100%" horizontalAlign="right" verticalAlign="baseline">
+			<s:Label text="Register" 
+					 styleName="stateLabel" 
+					 click="goToRegistrationWithSiteState()"
+					 useHandCursor="true"
+					 buttonMode="true"/>
+			<controls:VerticalLine />
+			<s:Label text="Lost Password" 
+					 styleName="stateLabel" 
+					 click="goToLostPasswordState()"
+					 useHandCursor="true"
+					 buttonMode="true"/>
+			<s:Label text="Logging in..." 
+					 visible="{inProgress}"
+					 />
+			<s:Spacer width="100%"/>
+			<s:CheckBox id="rememberLoginCheckbox" label="Remember Me" selected="true" />
+			<s:Button id="cancelButton" label="Cancel" click="cancelButton_clickHandler(event)" />
+			<s:Button label="Login" click="login()" />
+		</s:HGroup>
+		
+	</s:VGroup>
+	
+	<!-- LOST PASSWORD -->
+	<s:Label text="Please enter your username or email address. You will receive a passkey to create a new password via email." 
+			 fontSize="14"
+			 top="30"
+			 right="20"
+			 width="45%"
+			 includeIn="lostPassword"/>
+	
+	<controls:VerticalLine height="60%" horizontalCenter="-20" top="20" includeIn="lostPassword"/>
+	
+	<!-- LOST PASSWORD -->
+	<s:VGroup left="15" 
+				 top="20" 
+				 right="20"
+				 bottom="20"
+				 gap="10"
+				 includeIn="lostPassword"
+				 >
+		
+		<s:Label text="Username or email" fontSize="18" />
+		<s:TextInput id="usernameOrEmailTextInput" 
+					 text="" 
+					 prompt="Username or email"
+					 fontSize="18" styleName="textInputStyles"
+					 width="240" 
+					 keyUp="usernameOrEmailTextInput_keyUpHandler(event)"
+					 />
+		
+		
+		<s:Label id="lostPasswordWarningsLabel" 
+				 x="15" y="15" 
+				 text="" 
+				 fontWeight="bold" 
+				 color="red"
+				 width="100%"/>
+		
+		<s:HGroup width="100%" horizontalAlign="right" verticalAlign="baseline">
+			<s:Label text="Login" 
+					 styleName="stateLabel" 
+					 click="goToLoginState()"
+					 useHandCursor="true"
+					 buttonMode="true"/>
+			<s:Label text="Please wait..." 
+					 visible="{inProgress}"
+					 />
+			<s:Spacer width="100%"/>
+			<s:Button id="lostPasswordButton" label="Get New Password" click="getNewPasswordButton_clickHandler(event)" />
+		</s:HGroup>
+		
+	</s:VGroup>
+	
+	<!-- LOST PASSWORD CONFIRMATION -->
+	
+	<s:Label text="Check your email.&#xd;&#xd;A message was sent containing a confirmation code. Enter the code here and choose a new password." 
+			 fontSize="14"
+			 top="70"
+			 right="20"
+			 width="45%"
+			 includeIn="lostPasswordConfirmation"/>
+	
+	<controls:VerticalLine height="75%" horizontalCenter="-10" top="20" includeIn="lostPasswordConfirmation"/>
+	
+	<s:VGroup left="15" 
+				 top="20" 
+				 right="20"
+				 bottom="20"
+				 gap="10"
+				 includeIn="lostPasswordConfirmation"
+				 >
+		
+		<s:Label text="Confirmation Code" fontSize="18" />
+		<s:TextInput id="confirmationCodeTextInput" 
+					 text="" 
+					 fontSize="18" styleName="textInputStyles"
+					 width="240"
+					 />
+		<s:Label text="New Password" fontSize="18" />
+		<s:TextInput id="newPasswordTextInput" 
+					 text="" 
+					 fontSize="18" styleName="textInputStyles"
+					 width="240"
+					 displayAsPassword="true"
+					 />
+		<s:Label text="Confirm Password" fontSize="18" />
+		<s:TextInput id="newPasswordTextInput2" 
+					 text="" 
+					 fontSize="18" styleName="textInputStyles"
+					 width="240"
+					 displayAsPassword="true"
+					 />
+		
+		<s:Label id="changePasswordWarningsLabel" 
+				 x="15" y="15" 
+				 text="" 
+				 fontWeight="bold" 
+				 color="red"
+				 width="100%"/>
+		
+		<s:HGroup width="100%" horizontalAlign="right" verticalAlign="baseline">
+			<s:Label text="Lost Password" 
+					 styleName="stateLabel" 
+					 click="goToLostPasswordState()"
+					 useHandCursor="true"
+					 buttonMode="true"/>
+			<s:Label text="Please wait..." 
+					 visible="{inProgress}"
+					 />
+			<s:Spacer width="100%"/>
+			<s:Button id="generatePasswordButton" label="Generate Password For Me" click="generatePasswordButton_clickHandler(event)" />
+			<s:Button id="changePasswordButton" label="Change Password" click="changePasswordButton_clickHandler(event)" />
+		</s:HGroup>
+		
+	</s:VGroup>
+	
+	
+	<!-- PASSWORD CHANGED -->
+	<s:Label text="Your password has been changed!&#xd;&#xd;Please store it in a safe place. Your password has been filled in for you. You may now login. " 
+			 fontSize="13"
+			 top="50"
+			 right="20"
+			 width="45%"
+			 includeIn="loginAfterPasswordChanged"/>
+	
+	<controls:VerticalLine height="60%" horizontalCenter="0" top="20" includeIn="loginAfterPasswordChanged"/>
+	
+	
+	
+	<!-- LOGOUT -->
+	
+	<s:VGroup left="15" 
+				 top="20" 
+				 right="20"
+				 bottom="20"
+				 gap="10"
+				 includeIn="logout"
+				 >
+		
+		<s:Label text="Are you sure you want to logout?" fontSize="18" />
+		
+		<s:Spacer height="100%"/>
+		
+		<s:HGroup width="100%" horizontalAlign="right" verticalAlign="baseline">
+			
+			<s:Label text="Logging out..." 
+					 visible="{inProgress}"
+					 includeInLayout="{inProgress}"
+					 />
+			<s:Label id="logoutWarningsLabel" 
+					 x="15" y="15" 
+					 text="" 
+					 fontWeight="bold" 
+					 color="red"
+					 width="100%"/>
+			<s:Spacer width="100%"/>
+			<s:Button id="cancelLogoutButton" label="Cancel" click="cancelButton_clickHandler(event)" />
+			<s:Button label="Logout" click="logout()" />
+		</s:HGroup>
+		
+	</s:VGroup>
+</windows:AnimatedPanelWindow>

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/views/windows/LogoutWindow.mxml
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/views/windows/LogoutWindow.mxml b/Radii8Library/src/com/flexcapacitor/views/windows/LogoutWindow.mxml
new file mode 100644
index 0000000..1abb3df
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/views/windows/LogoutWindow.mxml
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<s:Panel xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" 
+			   xmlns:handlers="com.flexcapacitor.handlers.*" 
+			   xmlns:fc="com.flexcapacitor.effects.popup.*"
+			   
+			   title="Logout"
+			   creationComplete="creationCompleteHandler(event)"
+			   >
+	
+	<fx:Script>
+		<![CDATA[
+			import com.flexcapacitor.controller.Radiate;
+			import com.flexcapacitor.services.WPService;
+			import com.flexcapacitor.services.WPServiceEvent;
+			
+			import mx.events.FlexEvent;
+			
+			public var service:WPService;
+			
+			[Bindable]
+			public var inProgress:Boolean;
+
+			protected function creationCompleteHandler(event:FlexEvent):void {
+				service = new WPService();
+				service.host = Radiate.WP_HOST;
+				service.addEventListener(WPServiceEvent.RESULT, onWPServiceResult, false, 0, true);
+				service.addEventListener(WPServiceEvent.FAULT, onWPServiceFault, false, 0, true);
+			}
+			
+			
+			protected function onWPServiceResult(event:WPServiceEvent):void {
+				var data:Object = event.data;
+				
+				inProgress = false;
+				
+				if (data) {
+					logoutWarningsLabel.text = "";
+					
+					for each (var error:String in data.errors) {
+						logoutWarningsLabel.text += error;
+					}
+					
+					if (data.loggedIn==false) {
+						
+						logoutWarningsLabel.text = "";
+						closePopUp.startDelay = 250;
+						closePopUp.play();
+					}
+				}
+				else {
+					logoutWarningsLabel.text = "";
+				}
+				
+			}
+			
+			protected function onWPServiceFault(event:WPServiceEvent):void {
+				inProgress = false;
+				logoutWarningsLabel.text = "Could not connect to server. " + event.message;
+			}
+			
+			private function logout():void {
+				logoutWarningsLabel.text = "";
+				service.logoutUser();
+				inProgress = true;
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		
+		<!--- hide about popup -->
+		<handlers:EventHandler targets="{cancelButton}" eventName="click">
+			<s:SetAction property="action" target="{this}" value="cancel"/>
+			<fc:ClosePopUp id="closePopUp" popUp="{this}"  />
+		</handlers:EventHandler>
+		
+		<!--- hide about popup -->
+		<!--<handlers:EventHandler targets="{importButton}" eventName="click">
+			<s:SetAction property="action" target="{this}" value="import"/>
+			<fc:ClosePopUp popUp="{this}"  />
+		</handlers:EventHandler>-->
+		
+		<fx:String id="action"></fx:String>
+		
+	</fx:Declarations>
+	
+	
+	<s:VGroup left="15" 
+				 top="20" 
+				 right="20"
+				 bottom="1"
+				 gap="10"
+				 >
+		
+		
+		<s:Label text="Are you sure you want to logout?" fontSize="18" />
+		
+		<s:HGroup width="100%" horizontalAlign="right" verticalAlign="baseline">
+			
+			<s:Label text="Logging out..." 
+					 visible="{inProgress}"
+					 />
+			<s:Spacer width="100%"/>
+			<s:Button id="cancelButton" label="Cancel"  />
+			<s:Button label="Logout" click="logout()" />
+		</s:HGroup>
+		
+		<s:Label id="logoutWarningsLabel" 
+				 x="15" y="15" 
+				 text="" 
+				 fontWeight="bold" 
+				 color="red"
+				 width="100%"/>
+	</s:VGroup>
+	
+</s:Panel>

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/views/windows/NewDocumentWindow.mxml
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/views/windows/NewDocumentWindow.mxml b/Radii8Library/src/com/flexcapacitor/views/windows/NewDocumentWindow.mxml
new file mode 100644
index 0000000..a77c8d1
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/views/windows/NewDocumentWindow.mxml
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<c:AnimatedPanelWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" 
+			   xmlns:handlers="com.flexcapacitor.handlers.*"
+			   xmlns:fc="com.flexcapacitor.effects.popup.*"
+			   xmlns:c="com.flexcapacitor.views.windows.*"
+			   
+			   title.project="New Project"
+			   title.document="New Document"
+			   title.resource="New Resource"
+			   creationComplete="creationCompleteHandler(event)"
+			   stateChangeComplete="stateChangeCompleteHandler(event)"
+			   >
+	
+	<fx:Style>
+		@namespace s "library://ns.adobe.com/flex/spark";
+		@namespace c "com.flexcapacitor.controls.*";
+		@namespace mx "library://ns.adobe.com/flex/mx";
+		@namespace handlers "com.flexcapacitor.handlers.*";
+		@namespace fc "com.flexcapacitor.effects.popup.*";
+		
+	</fx:Style>
+	
+	<fx:Script>
+		<![CDATA[
+			import com.flexcapacitor.controller.Radiate;
+			
+			import mx.core.mx_internal;
+			import mx.events.FlexEvent;
+			import mx.events.ValidationResultEvent;
+			import mx.managers.PopUpManager;
+			
+			public static const DOCUMENT:String = "document";
+			public static const PROJECT:String = "project";
+			public static const RESOURCE:String = "resource";
+			
+			public static const CANCELED:String = "canceled";
+			public static const FINISH:String = "finish";
+			use namespace mx_internal;
+			
+			protected function finish_clickHandler():void {
+				var results:ValidationResultEvent;
+				var results2:ValidationResultEvent;
+				
+				if (currentState==DOCUMENT) {
+					results = documentNameValidator.validate();
+					
+					if (results.type==ValidationResultEvent.VALID) {
+						documentName = documentNameText.text;
+						infoLabel.text = "";
+						playSuccessfulMessage();
+					}
+					else {
+						infoLabel.text = results.message;
+					}
+				}
+				else if (currentState==PROJECT) {
+					results = projectNameValidator.validate();
+					//results2 = documentNameValidator2.validate();
+					
+					//if (results.type==ValidationResultEvent.VALID && results2.type==ValidationResultEvent.VALID) {
+					if (results.type==ValidationResultEvent.VALID) {
+						projectName = projectNameText.text;
+						//documentName = documentNameText2.text;
+						infoLabel.text = "";
+						playSuccessfulMessage();
+					}
+					else {
+						if (results.type==ValidationResultEvent.INVALID) {
+							infoLabel.text = results.message;
+						}
+						/*else if (results2.type==ValidationResultEvent.INVALID) {
+							infoLabel.text = results2.message;
+						}*/
+						
+					}
+					
+				}
+				else if (currentState==RESOURCE) {
+					
+				}
+				
+			}
+			
+			/**
+			 * Sets the action to finish
+			 * */
+			public function playSuccessfulMessage():void {
+				action = FINISH;
+				//closePopUp.startDelay = 1000;
+				closePopUp.play();
+			}
+			
+			protected function cancelButton_clickHandler(event:MouseEvent):void {
+				action = CANCELED;
+				callLater(PopUpManager.removePopUp, [this]);
+			}
+			
+			protected function creationCompleteHandler(event:FlexEvent):void {
+				radiate = Radiate.getInstance();
+				
+			}
+			
+			protected function stateChangeCompleteHandler(event:FlexEvent):void {
+				addMoveEffect();
+				PopUpManager.centerPopUp(this);
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		<mx:StringValidator id="documentNameValidator" 
+							source="{documentNameText}" 
+							property="text" 
+							required="true"/>
+		<!--<mx:StringValidator id="documentNameValidator2" 
+							source="{documentNameText2}" 
+							property="text" 
+							required="true"/>-->
+		<mx:StringValidator id="projectNameValidator" source="{projectNameText}" property="text" required="true"/>
+		<mx:StringValidator id="resourceNameValidator" source="{documentNameText}" property="text" required="true"/>
+		
+		<fx:String id="action"></fx:String>
+		<fx:String id="projectName"></fx:String>
+		<fx:String id="documentName"></fx:String>
+		<fx:String id="resourceName"></fx:String>
+		
+		<fc:ClosePopUp id="closePopUp" popUp="{this}" />
+	</fx:Declarations>
+	
+	
+	<fx:Declarations>
+	</fx:Declarations>
+	
+	<c:states>
+		<s:State name="document"/>
+		<s:State name="project"/>
+		<s:State name="resource"/>
+	</c:states>
+	
+	
+	<s:VGroup left="15" 
+				 top="20" 
+				 right="20"
+				 bottom="20"
+				 gap="10"
+				 >
+		
+		<s:HGroup verticalAlign="middle">
+			<s:Label text="Project Name:" minWidth="110" includeIn="project"/>
+	
+			<s:TextInput id="projectNameText" 
+						 minWidth="250"
+						 focusAlpha="0"
+						 borderColor="#cccccc"
+						 text="My Project"
+						 />
+		</s:HGroup>
+		<!--<s:HGroup verticalAlign="middle">
+			<s:Label text="Document Name:" minWidth="110" includeIn="project"/>
+	
+			<s:TextInput id="documentNameText2" 
+						 minWidth="250"
+						 focusAlpha="0"
+						 borderColor="#cccccc"
+						 text="Document"
+						 />
+		</s:HGroup>-->
+		
+		
+		<s:HGroup verticalAlign="middle" includeIn="document">
+			<s:Label text="Name:" minWidth="110" />
+	
+			<s:TextInput id="documentNameText" 
+						 minWidth="250"
+						 focusAlpha="0"
+						 borderColor="#cccccc"
+						 />
+		</s:HGroup>
+		
+		
+		<s:HGroup width="100%" horizontalAlign="right" verticalAlign="baseline">
+			<s:Label id="infoLabel" text="" />
+			<s:Spacer width="100%"/>
+			<s:Button id="cancelButton" label="Cancel" click="cancelButton_clickHandler(event)" />
+			<s:Button label="Finish" click="finish_clickHandler()" />
+		</s:HGroup>
+		
+	</s:VGroup>
+	
+	
+</c:AnimatedPanelWindow>

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/views/windows/PrintWindow.mxml
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/views/windows/PrintWindow.mxml b/Radii8Library/src/com/flexcapacitor/views/windows/PrintWindow.mxml
new file mode 100644
index 0000000..9b92200
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/views/windows/PrintWindow.mxml
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<windows:AnimatedPanelWindow  xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" 
+			   xmlns:handlers="com.flexcapacitor.handlers.*" 
+			   xmlns:fc="com.flexcapacitor.effects.popup.*"
+			   xmlns:views="com.flexcapacitor.views.*"
+			   xmlns:c="com.flexcapacitor.views.*"
+			   xmlns:windows="com.flexcapacitor.views.windows.*"
+			   
+			   title="Print"
+			   creationComplete="panel1_creationCompleteHandler(event)" 
+			   >
+	
+	<fx:Script>
+		<![CDATA[
+			import com.flexcapacitor.controller.Radiate;
+			import com.flexcapacitor.events.RadiateEvent;
+			
+			import mx.events.FlexEvent;
+			import mx.printing.FlexPrintJobScaleType;
+			
+			public static const CURRENT_DOCUMENT:String = "currentDocument";
+			public static const CURRENT_SELECTION:String = "currentSelection";
+			
+			
+			protected function printButton_clickHandler(event:MouseEvent):void {
+				var scaleType:String = scaleTypeGroup.selectedValue as String;
+				var imageType:Boolean = imageTypeGroup.selectedValue ? true : false;
+				
+				if (printableObjectGroup.selectedValue==CURRENT_DOCUMENT) {
+					radiate.print(radiate.selectedDocument, scaleType, imageType);
+				}
+				else if (printableObjectGroup.selectedValue==CURRENT_SELECTION) {
+					radiate.print(radiate.target, scaleType, imageType);
+				}
+			}
+			
+			protected function panel1_creationCompleteHandler(event:FlexEvent):void {
+				radiate = Radiate.getInstance();
+				radiate.addEventListener(RadiateEvent.PRINT_CANCELLED, printCanceledHandler, false, 0, true);
+				radiate.addEventListener(RadiateEvent.PRINT_COMPLETE, printCompleteHandler, false, 0, true);
+			}
+			
+			protected function printCanceledHandler(event:Event):void {
+				//trace("print cancelled");
+			}
+			
+			protected function printCompleteHandler(event:Event):void {
+				closeWindow.play();
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		
+		<!--- hide about popup -->
+		<handlers:EventHandler targets="{cancelButton}" setTriggerEvent="true" eventName="click">
+			<s:SetAction property="action" target="{this}" value="cancel"/>
+			<fc:ClosePopUp id="closeWindow" popUp="{this}" />
+		</handlers:EventHandler>
+		
+		<!--- hide about popup -->
+		<handlers:EventHandler targets="{printButton}" eventName="click">
+			<s:SetAction property="action" target="{this}" value="print"/>
+			<!--<fc:ClosePopUp popUp="{this}"  />-->
+		</handlers:EventHandler>
+		
+		<fx:String id="action"></fx:String>
+		
+		<s:RadioButtonGroup id="printableObjectGroup"  />
+		<s:RadioButtonGroup id="scaleTypeGroup"  />
+		<s:RadioButtonGroup id="imageTypeGroup"  />
+	</fx:Declarations>
+	
+	
+	<s:VGroup left="15" 
+				 top="20" 
+				 right="20"
+				 bottom="20">
+		
+		
+		<s:Label text="Select area to print" fontSize="12" styleName="textInputStyles"/>
+		
+		<s:HGroup x="14" y="31" width="100%" horizontalAlign="right">
+			<s:RadioButton x="190" 
+						   y="130" 
+						   label="Document" 
+						   group="{printableObjectGroup}"
+						   value="{CURRENT_DOCUMENT}"
+						   selected="true"
+						   />
+			<s:RadioButton x="190" 
+						   y="130" 
+						   label="Selection" 
+						   group="{printableObjectGroup}"
+						   value="{CURRENT_SELECTION}"
+						   />
+			<s:Spacer width="100%"/>
+		</s:HGroup>
+		
+		<s:Spacer height="1"/>
+		
+		<s:Label text="Select how to scale the content" fontSize="12" styleName="textInputStyles"/>
+		
+		<s:HGroup x="14" y="31" width="100%" horizontalAlign="right">
+			<s:RadioButton x="190" 
+						   y="130" 
+						   label="Match width" 
+						   group="{scaleTypeGroup}"
+						   value="{FlexPrintJobScaleType.MATCH_WIDTH}"
+						   selected="true"
+						   toolTip="(Default) Scales the object to fill the available page width. If the resulting object height exceeds the page height, the output spans multiple pages."
+						   />
+			<s:RadioButton x="190" 
+						   y="130" 
+						   label="Match height" 
+						   group="{scaleTypeGroup}"
+						   value="{FlexPrintJobScaleType.MATCH_HEIGHT}"
+						   toolTip="Scales the object to fill the available page height. If the resulting object width exceeds the page width, the output spans multiple pages."
+						   />
+			<s:RadioButton x="190" 
+						   y="130" 
+						   label="Fill page" 
+						   group="{scaleTypeGroup}"
+						   value="{FlexPrintJobScaleType.FILL_PAGE}"
+						   toolTip="Scales the object to fill at least one page completely; that is, it selects the larger of the MATCH_WIDTH or MATCH_HEIGHT scale types."
+						   />
+			<s:RadioButton x="190" 
+						   y="130" 
+						   label="None" 
+						   group="{scaleTypeGroup}"
+						   value="{FlexPrintJobScaleType.NONE}"
+						   toolTip="Does not scale the output. The printed page has the same dimensions as the object on the screen. If the object height, width, or both dimensions exceed the page width or height, the output spans multiple pages."
+						   />
+			<s:RadioButton x="190" 
+						   y="130" 
+						   label="Show all" 
+						   group="{scaleTypeGroup}"
+						   value="{FlexPrintJobScaleType.SHOW_ALL}"
+						   toolTip="Scales the object to fit on a single page, filling one dimension; that is, it selects the smaller of the MATCH_WIDTH or MATCH_HEIGHT scale types."
+						   />
+			<s:Spacer width="100%"/>
+		</s:HGroup>
+		
+		<s:Spacer height="1"/>
+		
+		<s:Label text="Print as a bitmap" fontSize="12" styleName="textInputStyles"/>
+		
+		<s:HGroup x="14" y="31" width="100%" horizontalAlign="right">
+			<s:RadioButton x="190" 
+						   y="130" 
+						   label="Print in vector" 
+						   group="{imageTypeGroup}"
+						   value="false"
+						   selected="true"
+						   toolTip="(Default) Prints in vector format. Text is selectable. "
+						   />
+			<s:RadioButton x="190" 
+						   y="130" 
+						   label="Print as bitmap" 
+						   group="{imageTypeGroup}"
+						   value="true"
+						   toolTip="Prints in a rasterized format. Text is not selectable."
+						   />
+			<s:Spacer width="100%"/>
+		</s:HGroup>
+		
+		<s:Spacer height="2"/>
+		
+		
+		<s:Label id="warningLabel" 
+				 x="15" y="15" 
+				 text="" 
+				 fontWeight="bold" 
+				 color="red"
+				 includeInLayout="false"
+				 visible="false"
+				 width="100%"/>
+		
+		<s:Label text="Notes" 
+				 fontSize="12" 
+				 fontWeight="bold"
+				 styleName="textInputStyles" 
+				 width="90%"/>
+		
+		<s:HGroup width="100%" right="10" bottom="10" verticalAlign="baseline">
+			
+			<s:Label text="{scaleTypeGroup.selection.toolTip}" 
+					 fontSize="12" 
+					 styleName="textInputStyles" 
+					 width="100%"/>
+			<s:Spacer width="10%"/>
+			<s:Button id="cancelButton" label="Cancel" />
+			<s:Button id="printButton" label="Print" click="printButton_clickHandler(event)"/>
+		</s:HGroup>
+	</s:VGroup>
+	
+</windows:AnimatedPanelWindow >

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/views/windows/PublishWindow.mxml
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/views/windows/PublishWindow.mxml b/Radii8Library/src/com/flexcapacitor/views/windows/PublishWindow.mxml
new file mode 100644
index 0000000..5a9e69d
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/views/windows/PublishWindow.mxml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<s:Panel xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" 
+			   xmlns:handlers="com.flexcapacitor.handlers.*" 
+			   xmlns:fc="com.flexcapacitor.effects.popup.*"
+			   
+			   width="400" height="300"
+			   title="Publish"
+			   >
+	
+	<fx:Declarations>
+		
+		<!--- hide about popup -->
+		<handlers:EventHandler targets="{[publishButton,cancelButton]}" eventName="click">
+			<fc:ClosePopUp popUp="{this}"  />
+		</handlers:EventHandler>
+	</fx:Declarations>
+	
+	<s:Label x="15" y="15" text="Publish location:" fontWeight="bold"/>
+
+	<s:HGroup x="14" y="31">
+		<s:RadioButton x="91" label="Local" y="128" selected="true"/>
+		<s:RadioButton x="190" label="Server" y="130"/>
+	</s:HGroup>
+
+	<s:Label x="15" y="65" text="Publishing is not supported at this time. " fontWeight="bold"/>
+	<!--<s:Label x="15" y="85" text="This window will eventually publish the HTML to a server." fontWeight="bold"/>-->
+
+	<s:Label x="15" y="85" text="Use the code view to access the generated code." fontWeight="bold"/>
+	
+
+	
+	<s:HGroup right="10" bottom="10">
+		<s:Button id="cancelButton" label="Cancel" />
+		<s:Button id="publishButton" label="Publish" />
+	</s:HGroup>
+</s:Panel>

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8Library/src/com/flexcapacitor/views/windows/SaveBeforeCloseWindow.mxml
----------------------------------------------------------------------
diff --git a/Radii8Library/src/com/flexcapacitor/views/windows/SaveBeforeCloseWindow.mxml b/Radii8Library/src/com/flexcapacitor/views/windows/SaveBeforeCloseWindow.mxml
new file mode 100644
index 0000000..0739c3a
--- /dev/null
+++ b/Radii8Library/src/com/flexcapacitor/views/windows/SaveBeforeCloseWindow.mxml
@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<windows:AnimatedPanelWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
+			   xmlns:s="library://ns.adobe.com/flex/spark" 
+			   xmlns:mx="library://ns.adobe.com/flex/mx" 
+			   xmlns:c="com.flexcapacitor.views.windows.*"
+			   xmlns:handlers="com.flexcapacitor.handlers.*"
+			   xmlns:fc="com.flexcapacitor.effects.popup.*"
+			   xmlns:windows="com.flexcapacitor.views.windows.*"
+			   
+			   title.project="Save Project"
+			   title.document="Save Document"
+			   
+			   creationComplete="panel1_creationCompleteHandler(event)" 
+			   >
+	
+	<fx:Style>
+		@namespace s "library://ns.adobe.com/flex/spark";
+		@namespace c "com.flexcapacitor.controls.*";
+		@namespace mx "library://ns.adobe.com/flex/mx";
+		@namespace handlers "com.flexcapacitor.handlers.*";
+		@namespace fc "com.flexcapacitor.effects.popup.*";
+		
+	</fx:Style>
+	
+	<fx:Script>
+		<![CDATA[
+			import com.flexcapacitor.controller.Radiate;
+			import com.flexcapacitor.events.RadiateEvent;
+			import com.flexcapacitor.model.IDocument;
+			import com.flexcapacitor.model.IDocumentData;
+			import com.flexcapacitor.model.IProject;
+			
+			import mx.core.mx_internal;
+			import mx.events.FlexEvent;
+			import mx.managers.PopUpManager;
+			
+			use namespace mx_internal;
+			
+			public static const DOCUMENT:String = "document";
+			public static const PROJECT:String = "project";
+			
+			[Bindable]
+			public var documentData:IDocumentData;
+			
+			[Bindable]
+			public var documentName:String;
+			
+			protected function saveResource():void {
+				var canBeSaved:Boolean;
+				saveWarningsLabel.text = "";
+				radiate = Radiate.getInstance();
+				
+				if (currentState==DOCUMENT) {
+					if (documentData==null) {
+						documentData = radiate.selectedDocument;
+					}
+					if (documentData) {
+						radiate.addEventListener(RadiateEvent.DOCUMENT_SAVE_COMPLETE, saveResultsHandler, false, 0, true);
+						radiate.addEventListener(RadiateEvent.DOCUMENT_SAVE_FAULT, saveResultsHandler, false, 0, true);
+						canBeSaved = radiate.saveDocument(IDocument(documentData));
+					}
+				}
+				else if (currentState==PROJECT) {
+					if (documentData==null) {
+						documentData = radiate.selectedProject;
+					}
+					
+					if (documentData) {
+						radiate.addEventListener(RadiateEvent.PROJECT_SAVED, saveResultsHandler, false, 0, true);
+						canBeSaved = radiate.saveProject(IProject(documentData));
+					}
+				}
+				
+				if (canBeSaved) {
+					infoLabel.text = "Saving...";
+					inProgress = true;
+				}
+				else {
+					//radiate.addEventListener(RadiateEvent.PROJECT_DELETED, deleteResultsHandler, false, 0, true);
+					//radiate.addEventListener(RadiateEvent.PROJECT_REMOVED, deleteResultsHandler, false, 0, true);
+				}
+			}
+			
+			protected function saveResultsHandler(event:RadiateEvent):void {
+				var data:Object = event.data;
+				var error:String;
+				var status:String = event.status;
+				var successful:Boolean = event.successful;
+				var message:String = "";
+				var iDocument:IDocument = event.selectedItem as IDocument;
+			
+				inProgress = false;
+				
+				radiate.removeEventListener(RadiateEvent.DOCUMENT_SAVE_COMPLETE, saveResultsHandler);
+				radiate.removeEventListener(RadiateEvent.DOCUMENT_SAVE_FAULT, saveResultsHandler);
+				
+				if (data && data is Object && "status" in data) {
+					//closePopUp.startDelay = 250;
+					//closePopUp.play();
+				}
+				
+				if (status=="error") {
+					
+					if (data && "error" in data) {
+						message += "Error. The item was not saved. " + data.error + " ";
+					}
+					else {
+						message += "Error. The item was not saved.";
+					}
+				}
+				else {
+					if (data==null && iDocument!=null && iDocument.id!=null) {
+						message += "Error. The item may have been saved already. Reload or resave the project. ";
+					}
+				}
+				
+				
+				if (event.faultEvent) {
+					message += "Are you connected to the internet? ";
+					
+					if (event.faultEvent is IOErrorEvent) {
+						message += IOErrorEvent(event.faultEvent).text;
+					}
+					else if (event.faultEvent is SecurityErrorEvent) {
+						
+						if (SecurityErrorEvent(event.faultEvent).errorID==2048) {
+							
+						}
+						
+						message += SecurityErrorEvent(event.faultEvent).text;
+					}
+				}
+				
+				
+				saveWarningsLabel.text = message;
+			
+				
+				if (successful) {
+					infoLabel.text = "Saved";
+					closePopUp.startDelay = 500;
+					closePopUp.play();
+				}
+			}
+			
+			protected function cancelButton_clickHandler(event:MouseEvent):void {
+				callLater(PopUpManager.removePopUp, [this]);
+			}
+			
+			protected function panel1_creationCompleteHandler(event:FlexEvent):void {
+				radiate = Radiate.getInstance();
+				
+				if (currentState==DOCUMENT) {
+					if (documentData==null) {
+						documentData = radiate.selectedDocument;
+					}
+				}
+				else if (currentState==PROJECT) {
+					if (documentData==null) {
+						documentData = radiate.selectedProject;
+					}
+					
+				}
+			
+				if (documentData) {
+					documentName = documentData.name;
+				}
+			}
+			
+		]]>
+	</fx:Script>
+	
+	<fx:Declarations>
+		
+		<!--- hide about popup -->
+		<handlers:EventHandler targets="{cancelButton}" eventName="clickNOT">
+			<fc:ClosePopUp id="closePopUp" popUp="{this}" />
+		</handlers:EventHandler>
+		
+		<!--- hide about popup -->
+		<!--<handlers:EventHandler targets="{importButton}" eventName="click">
+			<s:SetAction property="action" target="{this}" value="import"/>
+			<fc:ClosePopUp popUp="{this}"  />
+		</handlers:EventHandler>-->
+		
+		<fx:String id="action"></fx:String>
+		
+	</fx:Declarations>
+	
+	<c:states>
+		<s:State name="document"/>
+		<s:State name="project"/>
+	</c:states>
+	
+	<s:VGroup left="15" 
+				 top="20" 
+				 right="20"
+				 bottom="20"
+				 gap="10"
+				 >
+		
+		<s:Label text="Are you sure you want to save the project, '{documentName}'?" 
+				 fontSize="16" includeIn="project"/>
+		<s:Label text="Are you sure you want to save the document, '{documentName}'?" 
+				 fontSize="16" includeIn="document"/>
+		
+		<s:Label id="saveWarningsLabel" 
+				 x="15" y="15" 
+				 text="" 
+				 fontWeight="bold" 
+				 color="red"
+				 width="100%"/>
+		
+		<s:HGroup width="100%" horizontalAlign="right" verticalAlign="baseline">
+			<s:Label id="infoLabel" text="Saving..." 
+					 visible="{inProgress}"
+					 />
+			<s:Spacer width="100%"/>
+			<s:Button id="cancelButton" label="Close" click="cancelButton_clickHandler(event)" />
+			<s:Button label="Save" click="saveResource()" />
+		</s:HGroup>
+		
+	</s:VGroup>
+	
+	
+</windows:AnimatedPanelWindow>

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8LibraryAssets/.actionScriptProperties
----------------------------------------------------------------------
diff --git a/Radii8LibraryAssets/.actionScriptProperties b/Radii8LibraryAssets/.actionScriptProperties
new file mode 100644
index 0000000..7a16cb4
--- /dev/null
+++ b/Radii8LibraryAssets/.actionScriptProperties
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<actionScriptProperties analytics="false" mainApplicationPath="Radii8LibraryAssets.as" projectUUID="f27f648c-2e4e-4522-b8e9-562353eea694" version="11">
+  <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="false" flexSDK="Apache Flex 4.12.1 FP13.0 AIR13.0 en_US" fteInMXComponents="false" generateAccessible="false" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" useFlashSDK="false" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="0">
+      <libraryPathEntry kind="4" path="">
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/core.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="Radii8LibraryAssets.as"/>
+  </applications>
+  <modules/>
+  <workers/>
+  <buildCSSFiles/>
+  <flashCatalyst validateFlashCatalystCompatibility="false"/>
+</actionScriptProperties>

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8LibraryAssets/.flexLibProperties
----------------------------------------------------------------------
diff --git a/Radii8LibraryAssets/.flexLibProperties b/Radii8LibraryAssets/.flexLibProperties
new file mode 100644
index 0000000..3de4ff6
--- /dev/null
+++ b/Radii8LibraryAssets/.flexLibProperties
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<flexLibProperties includeAllClasses="true" useMultiPlatformConfig="false" version="3">
+  <includeClasses/>
+  <includeResources/>
+  <namespaceManifests/>
+</flexLibProperties>

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8LibraryAssets/.project
----------------------------------------------------------------------
diff --git a/Radii8LibraryAssets/.project b/Radii8LibraryAssets/.project
new file mode 100644
index 0000000..f5012d9
--- /dev/null
+++ b/Radii8LibraryAssets/.project
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<projectDescription>
+	<name>Radii8LibraryAssets</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.adobe.flexbuilder.project.flexbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.adobe.flexbuilder.project.flexlibnature</nature>
+		<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
+	</natures>
+</projectDescription>

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8LibraryAssets/.settings/org.eclipse.core.resources.prefs
----------------------------------------------------------------------
diff --git a/Radii8LibraryAssets/.settings/org.eclipse.core.resources.prefs b/Radii8LibraryAssets/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..d404a21
--- /dev/null
+++ b/Radii8LibraryAssets/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Sat Jun 30 14:08:21 CDT 2012
+eclipse.preferences.version=1
+encoding/<project>=utf-8

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8LibraryAssets/designs/logo2.png
----------------------------------------------------------------------
diff --git a/Radii8LibraryAssets/designs/logo2.png b/Radii8LibraryAssets/designs/logo2.png
new file mode 100644
index 0000000..d3060fb
Binary files /dev/null and b/Radii8LibraryAssets/designs/logo2.png differ

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8LibraryAssets/designs/radii8_logo2.png
----------------------------------------------------------------------
diff --git a/Radii8LibraryAssets/designs/radii8_logo2.png b/Radii8LibraryAssets/designs/radii8_logo2.png
new file mode 100644
index 0000000..6b68eb7
Binary files /dev/null and b/Radii8LibraryAssets/designs/radii8_logo2.png differ

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8LibraryAssets/src/Radii8LibraryAssets.as
----------------------------------------------------------------------
diff --git a/Radii8LibraryAssets/src/Radii8LibraryAssets.as b/Radii8LibraryAssets/src/Radii8LibraryAssets.as
new file mode 100644
index 0000000..6e348bd
--- /dev/null
+++ b/Radii8LibraryAssets/src/Radii8LibraryAssets.as
@@ -0,0 +1,172 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package {
+	
+	public class Radii8LibraryAssets {
+		
+		public function Radii8LibraryAssets() {
+			
+		}
+		
+		
+		///////////////////////////////////////////////////////
+		// EDIT
+		///////////////////////////////////////////////////////
+		
+		[Embed(source="assets/icons/general/NewFileBW.png")]
+		public static const newFile:Class;
+		
+		[Embed(source="assets/icons/general/CopyBW.png")]
+		public static const copy:Class;
+		
+		[Embed(source="assets/icons/general/undo2.png")]
+		public static const undo:Class;
+		
+		[Embed(source="assets/icons/general/redo2.png")]
+		public static const redo:Class;
+		
+		[Embed(source="assets/icons/general/EditBW.png")]
+		public static const edit:Class;
+		
+		[Embed(source="assets/icons/general/Selection.png")]
+		public static const selection:Class;
+		
+		[Embed(source="assets/icons/general/Save-icon.png")]
+		public static const save:Class;
+		
+		[Embed(source="assets/icons/general/TrashCan.png")]
+		public static const trashCan:Class;
+		/*[Embed(source="assets/icons/general/Trash2.png")]
+		public static const trashCan2:Class;
+		[Embed(source="assets/icons/general/Trash3.png")]
+		public static const trashCan3:Class;*/
+		
+		[Embed(source="assets/icons/general/OpenFolder.png")]
+		public static const openFolder:Class;
+		
+		[Embed(source="assets/icons/general/Refresh.png")]
+		public static const refresh:Class;
+		
+		[Embed(source="assets/icons/general/ClosedFolder.png")]
+		public static const closedFolder:Class;
+		
+		[Embed(source="assets/icons/general/Cancel.png")]
+		public static const cancel:Class;
+		
+		[Embed(source="assets/icons/general/Clear.png")]
+		public static const clear:Class;
+		
+		[Embed(source="assets/icons/general/visible.png")]
+		public static const visible:Class;
+		
+		[Embed(source="assets/icons/general/arrow.png")]
+		public static const arrow:Class;
+		
+		[Embed(source="assets/icons/effects/tree_viewBW.png")]
+		public static const treeView:Class;
+		
+		[Embed(source="assets/icons/effects/tree_view_closeBW.png")]
+		public static const treeViewClosed:Class;
+		
+		[Embed(source="assets/icons/general/ZoomToFit.png")]
+		public static const zoomToFit:Class;
+		
+		[Embed(source="assets/icons/general/ActualSize.png")]
+		public static const actualSize:Class;
+		
+		[Embed(source="assets/icons/general/CenterAlignment3.png")]
+		public static const centerAlignment:Class;
+		
+		[Embed(source="assets/icons/general/PortraitMode.png")]
+		public static const portraitMode:Class;
+		
+		[Embed(source="assets/icons/general/LandscapeMode.png")]
+		public static const landscapeMode:Class;
+		
+		[Embed(source="assets/icons/general/export.png")]
+		public static const exportIcon:Class;
+		
+		[Embed(source="assets/icons/general/import.png")]
+		public static const importIcon:Class;
+		
+		[Embed(source="assets/icons/general/upload.png")]
+		public static const upload:Class;
+		
+		[Embed(source="assets/icons/general/connected.png")]
+		public static const connected:Class;
+		
+		[Embed(source="assets/icons/general/disconnected.png")]
+		public static const disconnected:Class;
+		
+		[Embed(source="assets/icons/general/logo64.png")]
+		public static const logo64:Class;
+		
+		[Embed(source="assets/icons/general/logo3.png")]
+		public static const logo3:Class;
+		
+		[Embed(source="assets/icons/general/logo20.png")]
+		public static const logo:Class;
+		
+		
+		///////////////////////////////////////////////////////
+		// TYPES
+		///////////////////////////////////////////////////////
+		
+		
+		[Embed(source="assets/icons/general/ApplicationBW.png")]
+		public static const applicationIcon:Class;
+		
+		[Embed(source="assets/icons/general/Component.png")]
+		public static const componentIcon:Class;
+		
+		[Embed(source="assets/icons/general/Document.png")]
+		public static const documentIcon:Class;
+		
+		[Embed(source="assets/icons/general/ItemRenderer.png")]
+		public static const itemRendererIcon:Class;
+		
+		[Embed(source="assets/icons/general/Module.png")]
+		public static const moduleIcon:Class;
+		
+		[Embed(source="assets/icons/general/Package.png")]
+		public static const packageIcon:Class;
+		
+		//[Embed(source="assets/icons/general/ProjectFolder.png")]
+		[Embed(source="assets/icons/general/Document.png")]
+		public static const projectIcon:Class;
+		
+		[Embed(source="assets/icons/general/Skin.png")]
+		public static const skinIcon:Class;
+		
+		[Embed(source="assets/icons/general/property.png")]
+		public static const propertyIcon:Class;
+		
+		[Embed(source="assets/icons/general/style.png")]
+		public static const styleIcon:Class;
+		
+		[Embed(source="assets/icons/general/effect.png")]
+		public static const effectIcon:Class;
+		
+		[Embed(source="assets/icons/general/event.png")]
+		public static const eventIcon:Class;
+		
+		
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-radii8/blob/f370bfcf/Radii8LibraryAssets/src/Radii8LibraryDeviceAssets.as
----------------------------------------------------------------------
diff --git a/Radii8LibraryAssets/src/Radii8LibraryDeviceAssets.as b/Radii8LibraryAssets/src/Radii8LibraryDeviceAssets.as
new file mode 100644
index 0000000..6ecaa7a
--- /dev/null
+++ b/Radii8LibraryAssets/src/Radii8LibraryDeviceAssets.as
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package {
+	
+	
+	/**
+	 * List of devices to include. 
+	 * 
+	 * Be sure to add a reference to the RadiateReferences.
+	 * */
+	public class Radii8LibraryDeviceAssets {
+		
+		public function Radii8LibraryDeviceAssets() {
+			
+		}
+		
+		///////////////////////////////////////////////////////
+		// CORE
+		///////////////////////////////////////////////////////
+		
+		/**
+		 * var xml:XML = new XML(new Radii8LibraryDeviceAssets.devicesManifestDefaults());
+		 * // get list of device items
+		 * items = XML(xml).device;
+		 * */
+		[Embed(source="/assets/data/devices-manifest-defaults.xml", mimeType="application/octet-stream")]
+		public static const devicesManifestDefaults:Class;
+		
+		
+		///////////////////////////////////////////////////////
+		// ICONS
+		///////////////////////////////////////////////////////
+		
+		
+		
+		
+	}
+}
\ No newline at end of file