Adobe AIRで過去の遺産を使う
あああなんかだめかもなあ…… Adobe AIRもういやや……
id:kageroh_:20090511:1242023432 をちゃんと?ライブラリにした。試しにapplicaiton.xmlにnamespace拡張でタグ追加してみたけど、エラー出しやがるのでJavaScriptのみ。名前空間は汚してない。あ、AIRAliases.jsは読み込んでるから、airが衝突する恐れはある……ってairが使いたいから、これやってんだろ。
ライセンスは、はて☆すたでお願いします。
application.xml
<?xml version="1.0" encoding="utf-8"?> <application xmlns="http://ns.adobe.com/air/application/1.5"> <id>examples.html.Hoge</id> <filename>ほげ</filename> <initialWindow> <content>LegacyHTMLLoader.xhtml</content> <visible>true</visible> </initialWindow> </application>
LegacyHTMLLoader.xhtml
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja"> <head> <title>LegacyHTMLLoader</title> <script type="text/javascript" charset="utf-8" src="AIRAliases.js"></script> </head> <body> <script type="text/javascript"> // <![CDATA[ (function(url) { air.System.useCodePage = true; var html_loader = new air.HTMLLoader; html_loader.addEventListener(air.Event.COMPLETE, function() { var elem = document.documentElement; elem.parentNode.replaceChild(document.importNode(html_loader.window.document.documentElement, true), elem); }, false); html_loader.load(new air.URLRequest(url)); })('hoge.html'); // ]]> </script> </body> </html>
hoge.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <meta http-equiv="Content-Type" content="text/html; charset=shift_jis" /> <title>ほげ</title> <h1>ほげ</h1>