- OpenLaszlo紹介
- プログラム構造関連
- スクリプト
- Javascript基礎
- 基礎知識
- ビュー<view>
- レイアウト
- 動かす
- 入力デバイス
- 文字
- 数値
- 日付
- オブジェクト指向
- 標準コンポーネント
- データの扱い
- データ操作(基礎)
- 応用編
–
当サイトの左上にあるアプリです。とりあえず、指定したID(ここではopenlaszlo_ason)のtwitterタイムラインの表示だけです。
(OpenLaszlo4.6.1/swf8)
<?xml version="1.0" encoding="UTF-8"?> <canvas proxied="false" width="100%" height="200" bgcolor="0x444444"> <method name="get_time" args="t"> var v = t.split(" "); return (v[1].toString()+' '+v[2].toString()+' '+v[5].toString()); </method> <dataset name="ds" type="http" request="true" src="http://www.openlaszlo-ason.com/php/request.php?url=http://twitter.com/statuses/user_timeline/openlaszlo_ason.xml?count=10"/> <simplelayout/> <text fgcolor="0x33ccff" fontsize="13" fontstyle="bold" text="OpenLaszlo ひとことTIPS"> <handler name="onclick"> lz.Browser.loadURL('http://twitter.com/openlaszlo_ason/','_blank'); </handler> <handler name="onmouseover"> this.setAttribute('textdecoration','underline'); this.setAttribute('fgcolor',0xffffff); msg.animate('opacity',1,200,false); </handler> <handler name="onmouseout"> this.setAttribute('textdecoration','none'); this.setAttribute('fgcolor',0x33ccff); msg.animate('opacity',0,200,false); </handler> </text> <view width="${canvas.width}" height="${canvas.height-30}" clip="true"> <vbox x="${sb.width/2}" datapath="ds:/statuses" width="${parent.width-sb.width*2}" spacing="2" > <vbox datapath="status" width="${parent.width}" bgcolor="0xeeeeee"> <handler name="onclick"> var id = this.datapath.xpathQuery('id/text()'); lz.Browser.loadURL('http://twitter.com/openlaszlo_ason/statuses/'+id,'_blank'); </handler> <handler name="onmouseover"> sb.setAttribute('isMouseover',true); this.setAttribute('bgcolor',0xffffff); </handler> <handler name="onmouseout"> sb.setAttribute('isMouseover',false); this.setAttribute('bgcolor',0xeeeeee); </handler> <text datapath="created_at/text()" fgcolor="0x555555"> <handler name="ontext"> this.setAttribute('text',canvas.get_time(this.text)); </handler> </text> <text x="5" width="${parent.width-5}" datapath="text/text()" multiline="true" > <attribute name="orgH"/> <attribute name="dspH" value="17"/> <handler name="ontext"> this.setAttribute('orgH',this.height); this.setAttribute('height',this.dspH); </handler> <handler name="onmouseover" reference="parent"> this.animate('height',this.orgH,300,false); </handler> <handler name="onmouseout" reference="parent"> this.animate('height',this.dspH,300,false); </handler> </text> </vbox> </vbox> <scrollbar id="sb" visible="${this.scrollable}" > <attribute name="isMouseover" value="false"/> <handler name="onmousewheeldelta" reference="lz.Keys" args="d"> if(this.isMouseover)this.step(-d); </handler> </scrollbar> <view id="msg" width="${parent.width}" height="${parent.height}" opacity="0"> <view width="${parent.width}" height="${parent.height}" bgcolor="black" opacity="0.9"/> <vbox align="center" y="500" spacing="3" fontsize="12"> <text fgcolor="white">OpenLaszloの</text> <text fgcolor="white">技術的な情報を</text> <text fgcolor="white">twitterで不定期に</text> <text fgcolor="white">つぶやいています。</text> <text fgcolor="white" align="right">ason</text> <handler name="onopacity" reference="msg"><![CDATA[ if(msg.opacity==1)this.anm.doStart(); if(msg.opacity<0.2)this.setAttribute('y',500); ]]></handler> <animator name="anm" start="false" attribute="y" from="500" to="${msg.height/2-parent.height/2}" duration="300" /> </vbox> </view> </view> </canvas>
▼request.php
<?php $url = $_GET['url']; header("Content-type: application/xml; charset=UTF-8"); readfile($url); ?>