Yahoo/ウィジェット/HelloWorld

1月 1, 2003 · Posted in Yahoo, ウィジェット · Comment 

ソースコード

<?xml version="1.0" encoding="UTF-8"?>
<widget version="1.0" minimumVersion="3.0" debug="on">
<window name="window" title="window" visible="true">
<text name="text"
data="Hello World!"
size="30"
color="#000000"
bgColor="#ffffff"
hOffset="50"
vOffset="50"
bgOpacity="255"
/>
</window>
</widget>

ソースコード2

<?xml version="1.0" encoding="UTF-8"?>
<widget>
<version>1.0</version>
<minimumVersion>3.0</minimumVersion>
<debug>on</debug>
<window>
<name>window</name>
<title>window</title>
<visible>true</visible>
<text>
<name>text</name>
<data>Hello World!</data>
<size>30</size>
<color>#000000</color>
<bgColor>#ffffff</bgColor>
<hOffset>50</hOffset>
<vOffset>50</vOffset>
<bgOpacity>255</bgOpacity>
</text>
</window>
</widget>

実行イメージ

Yahoo/ウィジェット/JavaScriptリファレンス

1月 1, 2003 · Posted in Yahoo, ウィジェット · Comment 

JavaScript仕様

Yahoo!ウィジェットエンジンは、JavaScript 1.5標準(ECMA262、改訂3版)
準拠のJavaScriptエンジン(Mozilla Spidermonkey)を実装しています。

Yahoo/ウィジェット/XMLリファレンス

1月 1, 2003 · Posted in Yahoo, ウィジェット · Comment 

全体

<widget>
<about-box/>
<action/>
<frame/>
<hotkey/>
<image/>
<preference/>
<security/>
<scrollbar/>
<text/>
<textarea/>
<window/>
</widget>

widgetルート要素

-author
-company
-copyright
-debug
-defaultTracking
-image
-minimumVersion
-option
-requiredPlatform
-version

about-boxaboutボックスの定義

-image/about-image 画像の定義
複数指定可能。複数指定した場合は、繰り返し順番に表示される。

-about-text 文字列の定義
-以下の要素を指定可能
–color/colour
–data
–hOffset
–font
–size
–style
–shadow
–url
–vOffset

-about-version バージョン情報の定義
バージョン番号の表示位置のみを指定。バージョン番号は、ウィジェット定義のversion属性から直接取り込まれる。

actionあるタイミングで自動的に実行する処理の定義

-file 外部JavaScriptファイルのパス
-interval 廃止。後述のタイマーに置き換わり。
-trigger 読み込んだコードを発生させるタイミングを指定。以下の値を指定可能
–onGainFocus
–onIdle
–onKeyDown
–onKeyUp
–onKonsposeActivated
–onKonsposeDeactivated
–onLoad
–onLoseFocus
–onMouseDown
–onMouseEnter
–onMouseExit
–onMouseUp
–onPreferencesChanged
–onRunCommandInBgComplete
–onScreenChanged
–onTellWidget
–onTimer
–onUnload
–onWakeFromSleep
–onWillChangePreferences
–onYahooLoginChanged

frame他オブジェクトのコンテナ

-contextMenuItems コンテキストメニュー(右クリックメニュー)の配列を指定
-hAlign 水平方向の位置。left,right,center
-height 高さ
-hLineSize データ行のサイズ。スクロール時に使用する
-hOffset 水平方向のオフセット(余白)
-hScrollBar 水平スクロールバー
-onContextMenu コンテキストメニュー表示時のアクション
-onDragDrop 何かがドラッグ&ドロップされたときのアクション
-onDragEnter 何かがドラッグされたときのアクション
-onDragExit 項目が外にドラッグされたときのアクション
-onMouseDown マウスのボタンが押下されたときのアクション
-onMouseEnter マウスがオブジェクトの内側に移動したときのアクション
-onMouseExit マウスがオブジェクトの外に移動したときのアクション
-onMouseMove マウスを動かしたときのアクション
-onMouseUp マウスボタンを話したときのアクション
-onMouseWheel マウスホイールが動作したときのアクション
-onMultiClick マウスを複数回クリックしたときのアクション
-opacity オブジェクトの不透明度を指定(0-255)
-scrollX 水平方向のスクロールオフセット
-scrollY 垂直方向のスクロールオフセット
-visible 画像の表示/非表示の切り替え
-vAlign 垂直方向の位置。top,bottom,center
-vLineSize データ行のサイズ。スクロール時に使用する。
-vOffset 垂直方向のオフセット
-width 幅
-vScrollBar 水平スクロールバー
-window オブジェクトが所属するウィンドウオブジェクト
-zOrder オブジェクトの重なり(表示)順

hotkeyホットキーの動作

-key ファンクションキー名
-modifier Control,Commandボタン
-name 参照名
-onKeyDown ホットキーが押されたときのアクション
-onKeyUp ホットキーが離されたときのアクション

image画像の表示

-alignment
-clipRect
-colorize
-contextMenuItems
-fillMode
-height
-hAlign
-hOffset
-hRegistrationPoint
-hslAdjustment
-hslTinting
-loadingSrc
-missingSrc
-name
-onContextMenu
-onDragDrop
-onDragEnter
-onDragExit
-onImageLoaded
-onMouseDown
-onMouseEnter
-onMouseExit
-onMouseMove
-onMouseUp
-onMultiClick
-opacity
-remoteAsync
-rotation
-src
-srcHeight
-srcWidth
-tileOrigin
-useFileIcon
-visible
-vAlign
-vOffset
-vRegistrationPoint
-width
-window
-zOrder

preference設定/プロパティの利用

-defaultValue
-description
-directory
-extension
-file
-group
-hidden
-kind
-maxLength
-minLength
-name
-notSaved
-option
-optionValue
-secure
-style
-ticks
-tickLabel
-title
-type
-value

menuItemメニューアイテムの追加

-checked チェックボックスON/OFFの設定
-enabled 項目を有効化する
-onSelect 項目選択時のアクション
-title メニュー項目の表示文字列

preferenceGroup一連の設定をグループ化

securityオブジェクトのセキュリティプロパティの利用

-name
-icon
-order
-title

scrollbarスクロールバーの使用

-autoHide
-hAlign
-height
-hOffset
-max
-min
-onValueChanged
-opacity
-orientation
-pageSize
-thumbColor
-vAlign
-value
-visible
-width
-window
-zOrder

textテキストオブジェクトの利用

-alignment
-bgColor
-bgOpacity
-color
-contextMenuItems
-data
-font
-height
-hAlign
-hOffset
-name
-onContextMenu
-onDragDrop
-onDragEnter
-onDragExit
-onKeyUp
-onKeyDown
-onMouseDown
-onMouseEnter
-onMouseExit
-onMouseMove
-onMouseUp
-onMultiClick
-opacity
-shadow
-size
-style
-truncation
-visible
-vOffset
-width
-window
-zOrder

textareaテキストエリアの利用

-alignment
-bgColor
-bgOpacity
-color
-columns
-contextMenuItems
-bgColor
-bgOpacity
-data
-editable
-font
-height
-hAlign
-hOffset
-lines
-name
-onContextMenu
-onDragDrop
-onDragEnter
-onDragExit
-onGainFocus
-onKeyUp
-onKeyDown
-onKeyPress
-onLoseFocus
-onMouseDown
-onMouseEnter
-onMouseExit
-onMouseUp
-onMultiClick
-opacity
-secure
-scrollbar
-size
-spellcheck
-style
-tooltip
-visible
-vAlign
-vOffset
-width
-window
-zOrder

windowメインウィンドウ

-alignment
-contextMenuItems
-height
-hOffset
-level
-name
-onContextMenu
-onFirstDisplay
-onGainFocus
-onLoseFocus
-onMultiClick
-opacity
-shadow
-title
-visible
-vOffset
-width

timerタイマーの利用

-interval
-name
-ticking
-onTimerFired