Changeset 35681
- Timestamp:
- 10/22/09 15:17:51 (4 years ago)
- Location:
- platform/air/Whony
- Files:
-
- 1 added
- 4 modified
-
lib/as3httpclientlib-1_0_5.swc (added)
-
src/model/threads/SerializeTabThread.as (modified) (3 diffs)
-
src/net/APIPostThread.as (modified) (6 diffs)
-
src/view/TabConfig.mxml (modified) (2 diffs)
-
src/view/TabConfigMain.as (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/air/Whony/src/model/threads/SerializeTabThread.as
r35391 r35681 1 /*1 /* 2 2 * Whony - Wassr Client Software 3 3 * … … 30 30 import com.seacolorswind.dbi.AirDao; 31 31 import model.entity.UsableTab; 32 import mx.utils.ObjectUtil; 32 33 import org.libspark.thread.Thread; 33 34 import model.entity.Tab; … … 94 95 logger.debug("newTabs.length: {0}", newTabs.length); 95 96 newTabs.forEach(function(item:Object, index:int, array:Array):void { 96 logger.debug("item: {0}", item);97 logger.debug("item: {0}", ObjectUtil.toString(item)); 97 98 var serializeTab:Object = searchTab(serializedTabs, item); 98 99 if (serializeTab) { -
platform/air/Whony/src/net/APIPostThread.as
r35391 r35681 1 /*1 /* 2 2 * Whony - Wassr Client Software 3 3 * … … 29 29 { 30 30 import com.adobe.net.URI; 31 import flash.filesystem.File; 32 import flash.filesystem.FileMode; 33 import flash.filesystem.FileStream; 31 34 import flash.net.URLRequest; 32 35 import org.httpclient.http.multipart.Part; 33 36 import org.httpclient.http.Post; 34 import org.httpclient.HttpClient;35 import org.httpclient.HttpHeader;36 37 import org.httpclient.HttpRequest; 37 38 import org.libspark.thread.Thread; … … 41 42 import flash.net.URLVariables; 42 43 import org.httpclient.http.multipart.Multipart; 43 import org.httpclient.http.multipart.FilePart; 44 import org.httpclient.events.HttpRequestEvent; 45 import org.httpclient.events.HttpErrorEvent; 44 //import org.httpclient.http.multipart.FilePart; 46 45 import mx.logging.ILogger; 47 46 import mx.logging.Log; … … 77 76 params.push({name: key, value: param[key]}); 78 77 } 79 setFormData(params);78 _request.setFormData(params); 80 79 } else { 81 80 var parts:Array = new Array(); … … 84 83 parts.push(new Part(key, param[key])); 85 84 } else { 86 parts.push(new FilePart(param[key])); 87 } 85 /* var fileStream:FileStream = new FileStream(); 86 fileStream.open(File(param[key]), FileMode.READ); 87 var imageBytes:ByteArray = new ByteArray(); 88 fileStream.readBytes(imageBytes); 89 parts.push(new Part("file", imageBytes, "image/png", [ { name:"filename", value:"img.png" } ], "binary")); 90 */ } 88 91 } 89 92 _request.setMultipart(new Multipart(parts)); … … 92 95 this.callback = callback; 93 96 this.errorHandler = errorHandler; 94 }95 96 /**97 * @private98 */99 private function setFormData(params:Array, sep:String = "&"):void {100 _request.header.replace("Content-Type", "application/x-www-form-urlencoded");101 102 var body:ByteArray = new ByteArray();103 body.writeUTFBytes(params.map(function(item:*, index:int, array:Array):String {104 return encodeURIComponent(item.name) + "=" + encodeURIComponent(item.value);105 }).join(sep));106 107 body.position = 0;108 109 _request.body = body;110 111 _request.header.replace("Content-Length", String(body.length));112 97 } 113 98 -
platform/air/Whony/src/view/TabConfig.mxml
r35391 r35681 1 <?xml version="1.0" encoding="utf-8"?>1 <?xml version="1.0" encoding="utf-8"?> 2 2 <!-- 3 3 Whony - Wassr Client Software … … 31 31 <mx:VBox> 32 32 <mx:Label text="現在のタブ" /> 33 <mx:List dropEnabled="true" dragEnabled="true" dragMoveEnabled="true" dataProvider="{locator.tabData}" width="150" />33 <mx:List id="wnTabs" dropEnabled="true" dragEnabled="true" dragMoveEnabled="true" dataProvider="{locator.tabData}" width="150" /> 34 34 </mx:VBox> 35 35 <mx:VBox> 36 36 <mx:Label text="利用可能なタブ" /> 37 <mx:List dropEnabled="true" dragEnabled="true" dragMoveEnabled="true" dataProvider="{locator.usableTabData}" width="150" />37 <mx:List id="wnUsableTabs" dropEnabled="true" dragEnabled="true" dragMoveEnabled="true" dataProvider="{locator.usableTabData}" width="150" /> 38 38 </mx:VBox> 39 39 </mx:HBox> -
platform/air/Whony/src/view/TabConfigMain.as
r35391 r35681 1 /*1 /* 2 2 * Whony - Wassr Client Software 3 3 * … … 36 36 import mx.collections.SortField; 37 37 import mx.containers.HBox; 38 import mx.controls.List; 38 39 import mx.core.ClassFactory; 40 import mx.core.ScrollPolicy; 39 41 import mx.core.Window; 40 42 import model.threads.ThreadManager; 41 43 import com.adobe.utils.ArrayUtil; 44 import mx.events.DragEvent; 45 import mx.events.FlexEvent; 42 46 43 47 /** … … 50 54 [Bindable] 51 55 protected var locator:ModelLocator = ModelLocator.instance; 52 53 public var wn_config:HBox;54 56 55 57 public function TabConfigMain() … … 109 111 110 112 ThreadManager.startThread(new SerializeTabThread(locator.settingsMC, locator.tabData.source, locator.usableTabData.source)); 111 //new SerializeTabThread(locator.settingsMC, locator.tabData.source, locator.usableTabData.source).start();112 113 113 114 this.close();
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)