Added wrt files, prior to converting into Qt/C++.
authorMax Waterman <davidmaxwaterman@jeeves.(none)>
Sat, 6 Feb 2010 07:45:00 +0000 (09:45 +0200)
committerMax Waterman <davidmaxwaterman@jeeves.(none)>
Sat, 6 Feb 2010 07:45:00 +0000 (09:45 +0200)
371 files changed:
wrt/misc/RSS-Widget-Source.zip [new file with mode: 0644]
wrt/misc/rss-widget.deb [new file with mode: 0644]
wrt/misc/rss/.project [new file with mode: 0644]
wrt/misc/rss/FeedUpdateBroker.js [new file with mode: 0644]
wrt/misc/rss/Icon.png [new file with mode: 0644]
wrt/misc/rss/Info.plist [new file with mode: 0644]
wrt/misc/rss/RSSReader.css [new file with mode: 0644]
wrt/misc/rss/RSSReader.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/CheckBox.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ContentPanelFoldIcons.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ControlAssemblyBackground.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/DocumentBackground.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/FormButtonCenter.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/FormButtonLeft.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/FormButtonRight.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ListViewCaptionBackground.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/NotificationPopupBackground.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/NotificationPopupTypeIndicator.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ProgressBar0.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ProgressBar10.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ProgressBar100.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ProgressBar20.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ProgressBar30.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ProgressBar40.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ProgressBar50.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ProgressBar60.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ProgressBar70.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ProgressBar80.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ProgressBar90.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ProgressBarUnknown.gif [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/RadioButton.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ScrollbarThumbBottom.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ScrollbarThumbMiddle.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ScrollbarThumbTop.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ScrollbarTrackBottom.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ScrollbarTrackMiddle.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/ScrollbarTrackTop.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/SeparatorCenter.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/SeparatorLeft.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/SeparatorRight.png [new file with mode: 0644]
wrt/misc/rss/WRTKit/Resources/UI.css [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/ActionControl.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/Ajax.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/ContentPanel.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/Control.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/FormButton.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/Label.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/ListView.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/NavigationButton.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/NotificationPopup.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/Scrollbar.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/SelectionControl.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/SelectionList.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/SelectionMenu.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/Separator.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/TextArea.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/TextEntryControl.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/TextField.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/UIElement.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/UIInit.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/UIManager.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/UI/View.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/Utils/Logger.js [new file with mode: 0644]
wrt/misc/rss/WRTKit/WRTKit.js [new file with mode: 0644]
wrt/misc/rss/feed.xml [new file with mode: 0644]
wrt/misc/rss/index.html [new file with mode: 0644]
wrt/misc/rss/preview/css/style.css [new file with mode: 0644]
wrt/misc/rss/preview/data/appManager_data.js [new file with mode: 0644]
wrt/misc/rss/preview/data/calendar_data.js [new file with mode: 0644]
wrt/misc/rss/preview/data/contact_data.js [new file with mode: 0644]
wrt/misc/rss/preview/data/landmarks_data.js [new file with mode: 0644]
wrt/misc/rss/preview/data/location_data.js [new file with mode: 0644]
wrt/misc/rss/preview/data/logging_data.js [new file with mode: 0644]
wrt/misc/rss/preview/data/mediaManagement_data.js [new file with mode: 0644]
wrt/misc/rss/preview/data/messaging_data.js [new file with mode: 0644]
wrt/misc/rss/preview/data/sensor_data.js [new file with mode: 0644]
wrt/misc/rss/preview/data/sysInfo_data.js [new file with mode: 0644]
wrt/misc/rss/preview/images/BrowserNotificationBar-Toogle.gif [new file with mode: 0644]
wrt/misc/rss/preview/images/Gradient0Background.png [new file with mode: 0644]
wrt/misc/rss/preview/images/IconArea-hover.png [new file with mode: 0644]
wrt/misc/rss/preview/images/TransperantImage.png [new file with mode: 0644]
wrt/misc/rss/preview/images/active-orientation-icon.png [new file with mode: 0644]
wrt/misc/rss/preview/images/battery-icon.png [new file with mode: 0644]
wrt/misc/rss/preview/images/console-clear-button.png [new file with mode: 0644]
wrt/misc/rss/preview/images/console-close-icon.png [new file with mode: 0644]
wrt/misc/rss/preview/images/console-icon.gif [new file with mode: 0644]
wrt/misc/rss/preview/images/console-open-icon.png [new file with mode: 0644]
wrt/misc/rss/preview/images/default-Icon.png [new file with mode: 0644]
wrt/misc/rss/preview/images/device/240x320/Landscape.png [new file with mode: 0644]
wrt/misc/rss/preview/images/device/240x320/Portrait.png [new file with mode: 0644]
wrt/misc/rss/preview/images/device/320x240/Landscape.png [new file with mode: 0644]
wrt/misc/rss/preview/images/device/320x240/Portrait.png [new file with mode: 0644]
wrt/misc/rss/preview/images/device/360x640/Landscape.png [new file with mode: 0644]
wrt/misc/rss/preview/images/device/360x640/Portrait.png [new file with mode: 0644]
wrt/misc/rss/preview/images/device/360x640/hs-landscape.png [new file with mode: 0644]
wrt/misc/rss/preview/images/device/360x640/hs-portrait.png [new file with mode: 0644]
wrt/misc/rss/preview/images/device/800x352/Landscape.png [new file with mode: 0644]
wrt/misc/rss/preview/images/device/MenuItem-keys-Bg2.png [new file with mode: 0644]
wrt/misc/rss/preview/images/device/menuKeys-bg.png [new file with mode: 0644]
wrt/misc/rss/preview/images/errorIcon.png [new file with mode: 0644]
wrt/misc/rss/preview/images/gradient-bg.png [new file with mode: 0644]
wrt/misc/rss/preview/images/hs-iframeMask.png [new file with mode: 0644]
wrt/misc/rss/preview/images/infoIcon.png [new file with mode: 0644]
wrt/misc/rss/preview/images/memory-icon.png [new file with mode: 0644]
wrt/misc/rss/preview/images/messaging-icon.png [new file with mode: 0644]
wrt/misc/rss/preview/images/normal-orientation-icon.png [new file with mode: 0644]
wrt/misc/rss/preview/images/settings-icon.png [new file with mode: 0644]
wrt/misc/rss/preview/images/statusBar_240x320.png [new file with mode: 0644]
wrt/misc/rss/preview/images/statusBar_320x240.png [new file with mode: 0644]
wrt/misc/rss/preview/images/statusBar_360x640.png [new file with mode: 0644]
wrt/misc/rss/preview/images/statusBar_640x360.png [new file with mode: 0644]
wrt/misc/rss/preview/images/statusBar_800x352.png [new file with mode: 0644]
wrt/misc/rss/preview/images/sub-menu-arrow.png [new file with mode: 0644]
wrt/misc/rss/preview/images/th-bg-gradient.png [new file with mode: 0644]
wrt/misc/rss/preview/images/warningIcon.png [new file with mode: 0644]
wrt/misc/rss/preview/images/wrt-help-icon.png [new file with mode: 0644]
wrt/misc/rss/preview/nopreview.html [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/000000_40x100_textures_05_inset_soft_25.png [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_leftright.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_updown.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_close.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_doc.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_closed.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_open.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_minus.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_plus.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_down.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_left.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_right.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_up.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/555555_40x100_textures_02_glass_20.png [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_leftright.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_updown.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_close.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_doc.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_closed.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_open.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_minus.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_plus.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_resize_se.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_down.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_left.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_right.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_up.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/f58400_40x100_textures_05_inset_soft_30.png [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_leftright.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_updown.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_close.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_doc.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_closed.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_open.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_minus.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_plus.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_down.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_left.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_right.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_up.gif [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/slider-handle.png [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/ui.all.css [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/js/jquery-1.2.6.min.js [new file with mode: 0644]
wrt/misc/rss/preview/script/jquery-ui/js/jquery-ui-1.6.custom.min.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/console.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/device.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/loader.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/menu.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/menuItem.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/sapi/AppManager.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/sapi/Calendar.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/sapi/Contact.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/sapi/Landmarks.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/sapi/Location.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/sapi/Logging.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/sapi/MediaManagement.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/sapi/Messaging.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/sapi/Sensor.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/sapi/SysInfo.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/systeminfo.js [new file with mode: 0644]
wrt/misc/rss/preview/script/lib/widget.js [new file with mode: 0644]
wrt/misc/rss/preview/script/nokia.js [new file with mode: 0644]
wrt/misc/rss/preview/script/resolution.js [new file with mode: 0644]
wrt/misc/rss/preview/script/xml2json.js [new file with mode: 0644]
wrt/misc/rss/wrt_preview_frame.html [new file with mode: 0644]
wrt/misc/rss/wrt_preview_main.html [new file with mode: 0644]
wrt/misc/widget.deb [new file with mode: 0644]
wrt/zouba/.project [new file with mode: 0644]
wrt/zouba/.settings/com.aptana.ide.editor.js.prefs [new file with mode: 0644]
wrt/zouba/.settings/org.eclipse.ltk.core.refactoring.prefs [new file with mode: 0644]
wrt/zouba/.tmp_index.html.21831~ [new file with mode: 0644]
wrt/zouba/.tmp_index.html.61682~ [new file with mode: 0644]
wrt/zouba/Icon.png [new file with mode: 0644]
wrt/zouba/Info.plist [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/CheckBox.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ContentPanelFoldIcons.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ControlAssemblyBackground.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/DocumentBackground.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/FormButtonCenter.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/FormButtonLeft.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/FormButtonRight.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ListViewCaptionBackground.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/NotificationPopupBackground.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/NotificationPopupTypeIndicator.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ProgressBar0.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ProgressBar10.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ProgressBar100.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ProgressBar20.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ProgressBar30.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ProgressBar40.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ProgressBar50.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ProgressBar60.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ProgressBar70.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ProgressBar80.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ProgressBar90.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ProgressBarUnknown.gif [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/RadioButton.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ScrollbarThumbBottom.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ScrollbarThumbMiddle.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ScrollbarThumbTop.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ScrollbarTrackBottom.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ScrollbarTrackMiddle.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/ScrollbarTrackTop.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/SeparatorCenter.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/SeparatorLeft.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/SeparatorRight.png [new file with mode: 0644]
wrt/zouba/WRTKit/Resources/UI.css [new file with mode: 0644]
wrt/zouba/WRTKit/UI/ActionControl.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/Ajax.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/ContentPanel.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/Control.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/FormButton.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/Label.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/ListView.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/NavigationButton.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/NotificationPopup.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/Scrollbar.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/SelectionControl.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/SelectionList.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/SelectionMenu.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/Separator.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/TextArea.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/TextEntryControl.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/TextField.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/UIElement.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/UIInit.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/UIManager.js [new file with mode: 0644]
wrt/zouba/WRTKit/UI/View.js [new file with mode: 0644]
wrt/zouba/WRTKit/Utils/Logger.js [new file with mode: 0644]
wrt/zouba/WRTKit/WRTKit.js [new file with mode: 0644]
wrt/zouba/basic.css [new file with mode: 0644]
wrt/zouba/basic.js [new file with mode: 0644]
wrt/zouba/index.html [new file with mode: 0644]
wrt/zouba/preview/css/style.css [new file with mode: 0644]
wrt/zouba/preview/data/appManager_data.js [new file with mode: 0644]
wrt/zouba/preview/data/calendar_data.js [new file with mode: 0644]
wrt/zouba/preview/data/contact_data.js [new file with mode: 0644]
wrt/zouba/preview/data/landmarks_data.js [new file with mode: 0644]
wrt/zouba/preview/data/location_data.js [new file with mode: 0644]
wrt/zouba/preview/data/logging_data.js [new file with mode: 0644]
wrt/zouba/preview/data/mediaManagement_data.js [new file with mode: 0644]
wrt/zouba/preview/data/messaging_data.js [new file with mode: 0644]
wrt/zouba/preview/data/sensor_data.js [new file with mode: 0644]
wrt/zouba/preview/data/sysInfo_data.js [new file with mode: 0644]
wrt/zouba/preview/images/BrowserNotificationBar-Toogle.gif [new file with mode: 0644]
wrt/zouba/preview/images/Gradient0Background.png [new file with mode: 0644]
wrt/zouba/preview/images/IconArea-hover.png [new file with mode: 0644]
wrt/zouba/preview/images/TransperantImage.png [new file with mode: 0644]
wrt/zouba/preview/images/active-orientation-icon.png [new file with mode: 0644]
wrt/zouba/preview/images/battery-icon.png [new file with mode: 0644]
wrt/zouba/preview/images/console-clear-button.png [new file with mode: 0644]
wrt/zouba/preview/images/console-close-icon.png [new file with mode: 0644]
wrt/zouba/preview/images/console-icon.gif [new file with mode: 0644]
wrt/zouba/preview/images/console-open-icon.png [new file with mode: 0644]
wrt/zouba/preview/images/default-Icon.png [new file with mode: 0644]
wrt/zouba/preview/images/device/240x320/Landscape.png [new file with mode: 0644]
wrt/zouba/preview/images/device/240x320/Portrait.png [new file with mode: 0644]
wrt/zouba/preview/images/device/320x240/Landscape.png [new file with mode: 0644]
wrt/zouba/preview/images/device/320x240/Portrait.png [new file with mode: 0644]
wrt/zouba/preview/images/device/360x640/Landscape.png [new file with mode: 0644]
wrt/zouba/preview/images/device/360x640/Portrait.png [new file with mode: 0644]
wrt/zouba/preview/images/device/360x640/hs-landscape.png [new file with mode: 0644]
wrt/zouba/preview/images/device/360x640/hs-portrait.png [new file with mode: 0644]
wrt/zouba/preview/images/device/800x352/Landscape.png [new file with mode: 0644]
wrt/zouba/preview/images/device/MenuItem-keys-Bg2.png [new file with mode: 0644]
wrt/zouba/preview/images/device/menuKeys-bg.png [new file with mode: 0644]
wrt/zouba/preview/images/errorIcon.png [new file with mode: 0644]
wrt/zouba/preview/images/gradient-bg.png [new file with mode: 0644]
wrt/zouba/preview/images/hs-iframeMask.png [new file with mode: 0644]
wrt/zouba/preview/images/infoIcon.png [new file with mode: 0644]
wrt/zouba/preview/images/memory-icon.png [new file with mode: 0644]
wrt/zouba/preview/images/messaging-icon.png [new file with mode: 0644]
wrt/zouba/preview/images/normal-orientation-icon.png [new file with mode: 0644]
wrt/zouba/preview/images/settings-icon.png [new file with mode: 0644]
wrt/zouba/preview/images/statusBar_240x320.png [new file with mode: 0644]
wrt/zouba/preview/images/statusBar_320x240.png [new file with mode: 0644]
wrt/zouba/preview/images/statusBar_360x640.png [new file with mode: 0644]
wrt/zouba/preview/images/statusBar_640x360.png [new file with mode: 0644]
wrt/zouba/preview/images/statusBar_800x352.png [new file with mode: 0644]
wrt/zouba/preview/images/sub-menu-arrow.png [new file with mode: 0644]
wrt/zouba/preview/images/th-bg-gradient.png [new file with mode: 0644]
wrt/zouba/preview/images/warningIcon.png [new file with mode: 0644]
wrt/zouba/preview/images/wrt-help-icon.png [new file with mode: 0644]
wrt/zouba/preview/nopreview.html [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/000000_40x100_textures_05_inset_soft_25.png [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_leftright.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_updown.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_close.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_doc.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_closed.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_open.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_minus.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_plus.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_down.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_left.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_right.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_up.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/555555_40x100_textures_02_glass_20.png [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_leftright.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_updown.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_close.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_doc.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_closed.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_open.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_minus.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_plus.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_resize_se.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_down.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_left.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_right.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_up.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/f58400_40x100_textures_05_inset_soft_30.png [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_leftright.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_updown.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_close.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_doc.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_closed.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_open.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_minus.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_plus.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_down.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_left.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_right.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_up.gif [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/slider-handle.png [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/css/ui-darkness/ui.all.css [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/js/jquery-1.2.6.min.js [new file with mode: 0644]
wrt/zouba/preview/script/jquery-ui/js/jquery-ui-1.6.custom.min.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/console.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/device.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/loader.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/menu.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/menuItem.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/sapi/AppManager.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/sapi/Calendar.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/sapi/Contact.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/sapi/Landmarks.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/sapi/Location.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/sapi/Logging.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/sapi/MediaManagement.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/sapi/Messaging.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/sapi/Sensor.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/sapi/SysInfo.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/systeminfo.js [new file with mode: 0644]
wrt/zouba/preview/script/lib/widget.js [new file with mode: 0644]
wrt/zouba/preview/script/nokia.js [new file with mode: 0644]
wrt/zouba/preview/script/resolution.js [new file with mode: 0644]
wrt/zouba/preview/script/xml2json.js [new file with mode: 0644]
wrt/zouba/test.xml [new file with mode: 0644]
wrt/zouba/wrt_preview_frame.html [new file with mode: 0644]
wrt/zouba/wrt_preview_main.html [new file with mode: 0644]
wrt/zouba/zouba.wgz [new file with mode: 0644]

diff --git a/wrt/misc/RSS-Widget-Source.zip b/wrt/misc/RSS-Widget-Source.zip
new file mode 100644 (file)
index 0000000..d58eb60
Binary files /dev/null and b/wrt/misc/RSS-Widget-Source.zip differ
diff --git a/wrt/misc/rss-widget.deb b/wrt/misc/rss-widget.deb
new file mode 100644 (file)
index 0000000..8afe5cd
Binary files /dev/null and b/wrt/misc/rss-widget.deb differ
diff --git a/wrt/misc/rss/.project b/wrt/misc/rss/.project
new file mode 100644 (file)
index 0000000..01a4f58
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<projectDescription>\r
+       <name>TestRSS</name>\r
+       <comment></comment>\r
+       <projects>\r
+       </projects>\r
+       <buildSpec>\r
+               <buildCommand>\r
+                       <name>com.nokia.wrt.widgetPreviewBuilder</name>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+       </buildSpec>\r
+       <natures>\r
+               <nature>com.nokia.wrt.WidgetProjectNature</nature>\r
+               <nature>com.aptana.ide.project.nature.web</nature>\r
+       </natures>\r
+</projectDescription>\r
diff --git a/wrt/misc/rss/FeedUpdateBroker.js b/wrt/misc/rss/FeedUpdateBroker.js
new file mode 100644 (file)
index 0000000..5df242c
--- /dev/null
@@ -0,0 +1,173 @@
+///////////////////////////////////////////////////////////////////////////////\r
+// The FeedUpdateBroker class implements a simple RSS fetcher and parser.\r
+\r
+// Constructor.\r
+function FeedUpdateBroker() {\r
+    this.httpReq = null;\r
+    this.callback = null;\r
+}\r
+\r
+// Fetches a feed from the specified URL and calls the callback when the feed\r
+// has been fetched and parsed, or if the process results in an error.\r
+FeedUpdateBroker.prototype.fetchFeed = function(feedURL, callback) {\r
+    // remember callback\r
+    this.callback = callback;\r
+    \r
+    // create new XML HTTP request
+
+    //netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");\r
+    this.httpReq = new Ajax();\r
+    \r
+    // set callback\r
+    var self = this;\r
+    this.httpReq.onreadystatechange = function() { self.readyStateChanged(); };\r
+\r
+    // append the current time after the URL to bypass caches\r
+    var fullURL = feedURL;\r
+    if (fullURL.indexOf("?") == -1) {\r
+        fullURL += "?";\r
+    } else {\r
+        fullURL += "&";\r
+    }\r
+    fullURL += "nocache=" + (new Date().getTime());\r
+    \r
+    // initiate the request\r
+    this.httpReq.open("GET", fullURL, true);\r
+    this.httpReq.send(null);\r
+}\r
+\r
+// Callback for ready-state change events in the XML HTTP request.\r
+FeedUpdateBroker.prototype.readyStateChanged = function() {\r
+    // complete request?\r
+    if (this.httpReq.readyState == 4) {\r
+        // attempt to get response status\r
+        var responseStatus = null;\r
+        try {\r
+            responseStatus = this.httpReq.status;\r
+        } catch (noStatusException) {}\r
+        \r
+        // handle the response and call the registered callback\r
+        this.callback.call(this, this.handleResponse(responseStatus, this.httpReq.responseXML));\r
+    }\r
+}\r
+\r
+// Handles a completed response.\r
+FeedUpdateBroker.prototype.handleResponse = function(responseStatus, xmlDoc) {\r
+    if (((responseStatus == 200)||(responseStatus == 0)) && xmlDoc != null) {\r
+        // node ref for iterating\r
+        var node;\r
+        \r
+        // get last modified time - default to current time\r
+        var lastModified = new Date().getTime();\r
+        var channelElements = xmlDoc.getElementsByTagName("channel");\r
+        if (channelElements.length > 0) {\r
+            node = channelElements[0].firstChild;\r
+            while (node != null) {\r
+                if (node.nodeType == Node.ELEMENT_NODE) {\r
+                    if (node.nodeName == "pubDate" ||\r
+                            node.nodeName == "lastBuildDate" ||\r
+                            node.nodeName == "dc:date") {\r
+                        lastModified = this.getTextOfNode(node);\r
+                        break;\r
+                    }\r
+                }\r
+                node = node.nextSibling;\r
+            }\r
+        }\r
+        \r
+        // init feed items array\r
+        var items = [];\r
+        \r
+        // we got the feed XML so now we'll parse it\r
+        var itemElements = xmlDoc.getElementsByTagName("item");\r
+        for (var i = 0; i < itemElements.length; i++) {\r
+            // iterate through child nodes of this item and gather\r
+            // all the data we need for a feed item\r
+            var title = null;\r
+            var date = null;\r
+            var description = null;\r
+            var url = null;\r
+            \r
+            node = itemElements[i].firstChild;\r
+            while (node != null) {\r
+                if (node.nodeType == Node.ELEMENT_NODE) {\r
+                    if (node.nodeName == "title") {\r
+                        // item title\r
+                        title = this.getTextOfNode(node);\r
+                    } else if (node.nodeName == "pubDate" || node.nodeName == "dc:date") {\r
+                        // item publishing date\r
+                        date = this.getTextOfNode(node);\r
+                    } else if (node.nodeName == "description") {\r
+                        // item description\r
+                        description = this.getTextOfNode(node);\r
+                    } else if (node.nodeName == "link") {\r
+                        // link URL\r
+                        url = this.getTextOfNode(node);\r
+                    }\r
+                }\r
+                node = node.nextSibling;\r
+            }\r
+            \r
+            // create the item and add to the items array\r
+            items.push({ title: title, date: date, description: description, url: url });\r
+        }\r
+        \r
+        // update was completed successfully\r
+        return { status: "ok", lastModified: lastModified, items: items };\r
+    } else {\r
+        // update failed\r
+        return { status: "error" };\r
+    }\r
+}\r
+\r
+// Returns the text of a node.\r
+FeedUpdateBroker.prototype.getTextOfNode = function(node) {\r
+    var buf = "";\r
+    \r
+    // iterate through all child elements and collect all text to the buffer\r
+    var child = node.firstChild;\r
+    while (child != null) {\r
+        if (child.nodeType == Node.TEXT_NODE || child.nodeType == Node.CDATA_SECTION_NODE) {\r
+            // append text to buffer\r
+            if (buf != "") {\r
+                buf += " ";\r
+            }\r
+            buf += child.nodeValue;\r
+        }\r
+        child = child.nextSibling;\r
+    }\r
+    \r
+    // strip all tags from the buffer\r
+    var strippedBuf = "";\r
+    var textStartPos = -1;\r
+    var tagBalance = 0;\r
+    \r
+    // iterate through the text and append all text to the stripped buffer\r
+    // that is at a tag balance of 0\r
+    for (pos = 0; pos < buf.length; pos++) {\r
+        var c = buf.charAt(pos);\r
+        if (c == '<') {\r
+            // entering a tag\r
+            if (tagBalance == 0 && textStartPos != -1) {\r
+                // everything up to here was valid text\r
+                strippedBuf += buf.substring(textStartPos, pos);\r
+                textStartPos = -1;\r
+            }\r
+            tagBalance++;\r
+        } else if (c == '>') {\r
+            // leaving a tag\r
+            tagBalance--;\r
+            textStartPos = -1;\r
+        } else if (tagBalance == 0 && textStartPos == -1) {\r
+            // first char of text\r
+            textStartPos = pos;\r
+        }\r
+    }\r
+    \r
+    // add remaining text - if any\r
+    if (tagBalance == 0 && textStartPos != -1) {\r
+        strippedBuf += buf.substring(textStartPos, pos);\r
+    }\r
+    \r
+    return strippedBuf;\r
+}\r
diff --git a/wrt/misc/rss/Icon.png b/wrt/misc/rss/Icon.png
new file mode 100644 (file)
index 0000000..c2df90a
Binary files /dev/null and b/wrt/misc/rss/Icon.png differ
diff --git a/wrt/misc/rss/Info.plist b/wrt/misc/rss/Info.plist
new file mode 100644 (file)
index 0000000..4416966
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE plist PUBLIC "-//Nokia//DTD PLIST 1.0//EN" "http://www.nokia.com/DTDs/plist-1.0.dtd">\r
+<plist version="1.0">\r
+    <dict>\r
+        <key>DisplayName</key>\r
+        <string>TestRSS</string>\r
+        <key>Identifier</key>\r
+        <string>com.TestRSS.rssreader.widget</string>\r
+        <key>Version</key>\r
+        <string>1.0</string>\r
+        <key>MainHTML</key>\r
+        <string>index.html</string>\r
+        <key>AllowNetworkAccess</key>\r
+        <true/>\r
+        <key>MiniViewEnabled</key>\r
+        <false/>\r
+    </dict>\r
+</plist>
\ No newline at end of file
diff --git a/wrt/misc/rss/RSSReader.css b/wrt/misc/rss/RSSReader.css
new file mode 100644 (file)
index 0000000..c264a5f
--- /dev/null
@@ -0,0 +1,27 @@
+/* Feed item date */\r
+.FeedItemDate {\r
+    font-style: italic;\r
+}\r
+\r
+/* Feed item text */\r
+.FeedItemDescription {\r
+    padding: 4px 0px;\r
+}\r
+\r
+/* Feed item links */\r
+.FeedItemLink {\r
+    \r
+}\r
+\r
+/* Anchor tags in the context of a feed item link */\r
+.FeedItemLink a {\r
+    text-decoration: underline;\r
+    font-weight: bold;\r
+    color: rgb(0,0,255);\r
+}\r
+\r
+/* Focused anchor tags */\r
+.FeedItemLink a:focus {\r
+    background: rgb(0,0,255);\r
+    color: rgb(255,255,255);\r
+}\r
diff --git a/wrt/misc/rss/RSSReader.js b/wrt/misc/rss/RSSReader.js
new file mode 100644 (file)
index 0000000..586b9d6
--- /dev/null
@@ -0,0 +1,418 @@
+///////////////////////////////////////////////////////////////////////////////\r
+// RSS Reader example widget that demonstrates use of the WRTKit UI toolkit\r
+// in a real-world widget.\r
+\r
+// Feed update frequency.\r
+var updateFrequencyOptions = [\r
+    { value: -1, text: "never" },\r
+    { value: (1000 * 60 * 5), text: "every 5 min" },\r
+    { value: (1000 * 60 * 15), text: "every 15 min" },\r
+    { value: (1000 * 60 * 60), text: "every 60 min" },\r
+];\r
+\r
+// Feed update broker.\r
+var feedUpdateBroker = null;\r
+\r
+// Reference to current feed items controls.\r
+var feedItemControls = [];\r
+\r
+// Feed item control pool.\r
+var feedItemControlPool = [];\r
+\r
+// Time when the feed was last modified.\r
+var feedLastModified = null;\r
+\r
+// Flag that tracks if a feed update is commanded or automatic.\r
+var feedUpdateCommanded = false;\r
+\r
+// Reference to the WRTKit user interface manager and views.\r
+var uiManager;\r
+var mainView;\r
+var settingsView;\r
+\r
+// Reference to settings controls.\r
+var feedNameText;\r
+var feedUrlText;\r
+var feedSelection;\r
+var feedUpdateFrequencySelection;\r
+var settingsSaveButton;\r
+var settingsCancelButton;\r
+\r
+// Constants for menu item identifiers.\r
+var MENU_ITEM_SETTINGS = 0;\r
+var MENU_ITEM_REFRESH = 1;\r
+var MENU_ITEM_ABOUT = 2;\r
+\r
+// Feed update timer identifier.\r
+var updateTimerId = null;\r
+\r
+//About menu lable\r
+var aboutLabel;\r
+\r
+// Feed name, URL and update frequency (in milliseconds; -1 if no auto update).\r
+var feedName = "CNN Top Stories";\r
+var feedURL = "http://rss.cnn.com/rss/cnn_topstories.rss";\r
+//var feedURL = "feed.xml";\r
+var feedUpdateFrequency = -1;\r
+\r
+// Next scheduled update time; -1 if never.\r
+var feedUpdateTime = -1;\r
+\r
+// Called from the onload event handler to initialize the widget.\r
+function init() {\r
+    if (window.widget) {\r
+        // set tab-navigation mode and show softkeys\r
+        widget.setNavigationEnabled(false);\r
+        window.menu.showSoftkeys();\r
+        \r
+        // create menu\r
+        var settingsMenuItem = new MenuItem("Settings", MENU_ITEM_SETTINGS);\r
+        settingsMenuItem.onSelect = menuItemSelected;\r
+        menu.append(settingsMenuItem);\r
+        var refreshMenuItem = new MenuItem("Refresh", MENU_ITEM_REFRESH);\r
+        refreshMenuItem.onSelect = menuItemSelected;\r
+        menu.append(refreshMenuItem);\r
+               var aboutMenuItem = new MenuItem("About", MENU_ITEM_ABOUT);\r
+               aboutMenuItem.onSelect = menuItemSelected;\r
+               menu.append(aboutMenuItem);\r
+    }\r
+    \r
+       // load preferences\r
+       loadPreferences();\r
+\r
+    // create UI manager\r
+    uiManager = new UIManager();\r
+    \r
+    // create main view\r
+    mainView = new ListView();\r
+    \r
+    // create settings view\r
+    settingsView = new ListView(null, "Settings");\r
+       \r
+       //Create about view\r
+       aboutView = new ListView(null, "RSS Reader");\r
+    \r
+    // feed name control\r
+    feedNameText = new TextField('feedNameText', "Feed name", feedName);\r
+    settingsView.addControl(feedNameText);\r
+       \r
+    // feed url control\r
+    feedUrlText = new TextField('feedUrlText', "Feed URL", feedURL);\r
+    settingsView.addControl(feedUrlText);\r
+\r
+       // About lable control\r
+       aboutLabel = new Label();\r
+       aboutView.addControl(aboutLabel);\r
+       \r
+    // feed update frequency selection control\r
+    feedUpdateFrequencySelection = new SelectionList(null, "Check for updates", updateFrequencyOptions);\r
+    settingsView.addControl(feedUpdateFrequencySelection);\r
+    \r
+    // save settings button\r
+    settingsSaveButton = new FormButton(null, "Save");\r
+    settingsSaveButton.addEventListener("ActionPerformed", saveSettingsClicked);\r
+    settingsView.addControl(settingsSaveButton);\r
+    \r
+    // cancel settings button\r
+    settingsCancelButton = new FormButton(null, "Cancel");\r
+    settingsCancelButton.addEventListener("ActionPerformed", showMainView);\r
+    settingsView.addControl(settingsCancelButton);\r
+    \r
+    // display the main view if a feed has been configured\r
+    // otherwise show the settings view\r
+       if (feedURL != null) {\r
+        showMainView();\r
+        updateFeed();\r
+    } else {\r
+        showSettings();\r
+    }\r
+    // start feed update timer (called once every second)\r
+    updateTimerId = setInterval(updateFeedTimerFunc, 1000);\r
+}\r
+\r
+// Callback for when menu items are selected.\r
+function menuItemSelected(id) {\r
+    switch (id) {\r
+        case MENU_ITEM_SETTINGS:\r
+            showSettings();\r
+            break;\r
+        case MENU_ITEM_REFRESH:\r
+            updateFeed();\r
+            break;\r
+               case MENU_ITEM_ABOUT:\r
+                       showAboutView();\r
+                       break;\r
+    }\r
+}\r
+\r
+// Loads widget preferences.\r
+function loadPreferences() {\r
+    if (window.widget) {\r
+        // read feed URL, name and update frequency from the widget settings\r
+               \r
+               if (typeof widget.preferenceForKey("FeedURL") != 'undefined' && typeof widget.preferenceForKey("FeedName") != 'undefined') {\r
+                       feedURL = widget.preferenceForKey("FeedURL");\r
+                       feedName = widget.preferenceForKey("FeedName");\r
+                       var feedUpdateFrequencyStr = widget.preferenceForKey("FeedUpdateFrequency");\r
+                       feedUpdateFrequency = (feedUpdateFrequencyStr == null) ? -1 : parseInt(feedUpdateFrequencyStr);\r
+               }\r
+    }\r
+}\r
+\r
+// Loads widget preferences.\r
+function savePreferences() {\r
+    if (window.widget) {\r
+        // save settings in widget preferences store\r
+        widget.setPreferenceForKey(feedURL, "FeedURL");\r
+        widget.setPreferenceForKey(feedName, "FeedName");\r
+        widget.setPreferenceForKey(feedUpdateFrequency.toString(), "FeedUpdateFrequency");\r
+    }\r
+}\r
+\r
+// Callback for settings view save button.\r
+function saveSettingsClicked() {\r
+    // remember old URL\r
+    var oldURL = feedURL;\r
+    \r
+    // update feed name and URL\r
+    var selectedFeed = feedUrlText.getText();\r
+\r
+    if (selectedFeed != null) {\r
+        feedURL = selectedFeed;\r
+        feedName = feedNameText.getText();\r
+    } else {\r
+        feedURL = null;\r
+        feedName = null;\r
+    }\r
+    \r
+    // update frequency\r
+    var selectedFrequency = feedUpdateFrequencySelection.getSelected();\r
+    feedUpdateFrequency = (selectedFrequency != null) ? selectedFrequency.value : -1;\r
+    \r
+    // save preferences\r
+    savePreferences();\r
+    \r
+    // return to main view\r
+    showMainView();\r
+    \r
+    // update the feed if the feed URL has changed\r
+    if (feedURL != oldURL) {\r
+        feedLastModified = null;\r
+        removeFeedItems();\r
+        updateFeed();\r
+    }\r
+}\r
+\r
+// Show main view.\r
+function showMainView() {\r
+    // set main view caption from feed name\r
+    var mainViewCaption = (feedName == null) ? null : feedName;\r
+    mainView.setCaption(mainViewCaption);\r
+    \r
+    // set right softkey to "exit"\r
+    if (window.widget) {\r
+        menu.setRightSoftkeyLabel("", null);\r
+    }\r
+    \r
+    // show the main view\r
+    uiManager.setView(mainView);\r
+}\r
+\r
+// Show settings view.\r
+function showSettings() {\r
+    // Feed Name\r
+    feedNameText.setText(feedName);\r
+\r
+    // URL\r
+    feedUrlText.setText(feedURL);\r
+               \r
+    // frequency\r
+    var feedUpdateFrequencyOption = feedUpdateFrequencySelection.getOptionForValue(feedUpdateFrequency);\r
+    feedUpdateFrequencySelection.setSelected(feedUpdateFrequencyOption);\r
+    \r
+    if (feedURL == null) {\r
+        // no valid configuration\r
+        // disable cancel button - set right softkey to "exit"\r
+        settingsCancelButton.setEnabled(false);\r
+        if (window.widget) {\r
+            menu.setRightSoftkeyLabel("", null);\r
+        }\r
+    } else {\r
+        // we have a valid configuration\r
+        // enable cancel button - set right softkey to "cancel"\r
+        settingsCancelButton.setEnabled(true);\r
+        if (window.widget) {\r
+            menu.setRightSoftkeyLabel("Cancel", showMainView);\r
+        }\r
+    }\r
+    \r
+    // show the settings view\r
+    uiManager.setView(settingsView);\r
+}\r
+\r
+//Displays the About view\r
+function showAboutView(){\r
+       aboutLabel.setText("This Widget includes software licensed from Nokia &copy 2008");\r
+       \r
+       setAboutViewSoftkeys();\r
+       uiManager.setView(aboutView);\r
+}\r
+\r
+// Sets the softkeys for about view.\r
+function setAboutViewSoftkeys() {\r
+    if (window.widget) {\r
+        // set right softkey to "Ok" (returns to main view)\r
+        menu.setRightSoftkeyLabel("Ok", showMainView);\r
+    }\r
+}\r
+\r
+// Schedules an immediate feed update.\r
+function updateFeed() {\r
+    feedUpdateTime = 0;\r
+    feedUpdateCommanded = true;\r
+}\r
+\r
+\r
+// Timer function for feed updates - called once every second.\r
+function updateFeedTimerFunc() {\r
+    var now = new Date().getTime();\r
+    \r
+    // check if a feed update has been scheduled, if it's time to update now,\r
+    // and if there's no update currently in progress and if we're in the main view\r
+    if ((feedURL != null) &&\r
+                (feedUpdateTime != -1) &&\r
+                (now > feedUpdateTime) &&\r
+                (feedUpdateBroker == null) && \r
+                (uiManager.getView() == mainView)) {\r
+        // show progress dialog if this is a commanded feed update\r
+        if (feedUpdateCommanded) {\r
+            // no auto hiding, wait-type notification, unknown progress\r
+            uiManager.showNotification(-1, "wait", "Loading feed...", -1);\r
+        }\r
+        \r
+        // fetch the feed from the specified URL\r
+        feedUpdateBroker = new FeedUpdateBroker();\r
+        feedUpdateBroker.fetchFeed(feedURL, feedUpdateCompleted);\r
+        \r
+        if (feedUpdateFrequency != -1) {\r
+            // schedule next update\r
+            feedUpdateTime = now + feedUpdateFrequency;\r
+        } else {\r
+            // feed update frequency is "never"\r
+            feedUpdateTime = -1;\r
+        }\r
+    }\r
+}\r
+\r
+// Callback function that gets called when a feed update has completed.\r
+function feedUpdateCompleted(event) {\r
+    if (event.status == "ok") {\r
+        // if there aren't any feed items yet, we'll hide the progress dialog\r
+        if (feedUpdateCommanded) {\r
+            uiManager.hideNotification();\r
+        }\r
+        \r
+        // check if the feed has updated\r
+        if (event.lastModified != feedLastModified) {\r
+            // remember the last modified timestamp\r
+            feedLastModified = event.lastModified;\r
+            \r
+            // feed fetched and parsed successfully\r
+            setFeedItems(event.items);\r
+            \r
+            // focus the first feed item control\r
+            // (but only if we are in the main view)\r
+            if (uiManager.getView() == mainView) {\r
+                feedItemControls[0].setFocused(true);\r
+            }\r
+        }\r
+    } else {\r
+        // show error message\r
+        uiManager.showNotification(3000, "warning", "Error while updating feed!<br/>(check network settings)");\r
+    }\r
+    \r
+    // null the broker reference to indicate that there's no current\r
+    // update in progress\r
+    feedUpdateBroker = null;\r
+    \r
+    // reset commanded feed update flag\r
+    feedUpdateCommanded = false;\r
+}\r
+\r
+// Removes feed items.\r
+function removeFeedItems() {\r
+    // remove all current feed items from the main view\r
+    for (var i = 0; i < feedItemControls.length; i++) {\r
+        mainView.removeControl(feedItemControls[i]);\r
+    }\r
+    \r
+    // reset feed item control array\r
+    feedItemControls = [];\r
+}\r
+\r
+// Sets feed items.\r
+function setFeedItems(items) {\r
+    // start by removing all current feed items\r
+    removeFeedItems();\r
+    \r
+    // create new feed items and add them to the main view\r
+    // use feed item pool to recycle controls\r
+    for (var i = 0; i < items.length; i++) {\r
+        // get a feed item control from the pool or create one and\r
+        // place it in the pool if there aren't enough feed item controls\r
+        var feedItemControl;\r
+        if (i == feedItemControlPool.length) {\r
+            feedItemControl = new ContentPanel(null, null, null, true);\r
+            feedItemControlPool.push(feedItemControl);\r
+        } else {\r
+            feedItemControl = feedItemControlPool[i];\r
+        }\r
+        \r
+        // initialize feed item control\r
+        var item = items[i];\r
+        feedItemControl.setCaption(item.title);\r
+        feedItemControl.setContent(getContentHTMLForFeedItem(item));\r
+        feedItemControl.setExpanded(false);\r
+        \r
+        // add the feed item control to the main view\r
+        feedItemControls.push(feedItemControl);\r
+        mainView.addControl(feedItemControl);\r
+    }\r
+}\r
+\r
+// Returns the content HTML for a feed item.\r
+function getContentHTMLForFeedItem(item) {\r
+    var buf = "";\r
+    \r
+    // item date\r
+    if (item.date != null) {\r
+        buf += "<div class=\"FeedItemDate\">" + item.date + "</div>";\r
+    }\r
+    \r
+    // item description\r
+    if (item.description != null) {\r
+        buf += "<div class=\"FeedItemDescription\">" + item.description + "</div>";\r
+    }\r
+    \r
+    // item URL\r
+    if (item.url != null) {\r
+        buf += "<div class=\"FeedItemLink\">";\r
+            buf += "<a href=\"JavaScript:void(0)\" onclick=\"openURL('" + item.url + "'); return false;\">";\r
+            buf += "Read more...";\r
+            buf += "</a>";\r
+        buf += "</div>";\r
+    }\r
+    \r
+    return buf;\r
+}\r
+\r
+// Opens a URL.\r
+function openURL(url) {\r
+    if (window.widget) {\r
+        // in WRT\r
+        widget.openURL(url);\r
+    } else {\r
+        // outside WRT\r
+        window.open(url, "NewWindow");\r
+    }\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/Resources/CheckBox.png b/wrt/misc/rss/WRTKit/Resources/CheckBox.png
new file mode 100644 (file)
index 0000000..ca6659a
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/CheckBox.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ContentPanelFoldIcons.png b/wrt/misc/rss/WRTKit/Resources/ContentPanelFoldIcons.png
new file mode 100644 (file)
index 0000000..1b7190f
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ContentPanelFoldIcons.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ControlAssemblyBackground.png b/wrt/misc/rss/WRTKit/Resources/ControlAssemblyBackground.png
new file mode 100644 (file)
index 0000000..93d9908
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ControlAssemblyBackground.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/DocumentBackground.png b/wrt/misc/rss/WRTKit/Resources/DocumentBackground.png
new file mode 100644 (file)
index 0000000..18defee
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/DocumentBackground.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/FormButtonCenter.png b/wrt/misc/rss/WRTKit/Resources/FormButtonCenter.png
new file mode 100644 (file)
index 0000000..c06d9ad
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/FormButtonCenter.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/FormButtonLeft.png b/wrt/misc/rss/WRTKit/Resources/FormButtonLeft.png
new file mode 100644 (file)
index 0000000..af8ca8a
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/FormButtonLeft.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/FormButtonRight.png b/wrt/misc/rss/WRTKit/Resources/FormButtonRight.png
new file mode 100644 (file)
index 0000000..e63121b
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/FormButtonRight.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ListViewCaptionBackground.png b/wrt/misc/rss/WRTKit/Resources/ListViewCaptionBackground.png
new file mode 100644 (file)
index 0000000..8e528c4
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ListViewCaptionBackground.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/NotificationPopupBackground.png b/wrt/misc/rss/WRTKit/Resources/NotificationPopupBackground.png
new file mode 100644 (file)
index 0000000..093701b
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/NotificationPopupBackground.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/NotificationPopupTypeIndicator.png b/wrt/misc/rss/WRTKit/Resources/NotificationPopupTypeIndicator.png
new file mode 100644 (file)
index 0000000..9220fff
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/NotificationPopupTypeIndicator.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ProgressBar0.png b/wrt/misc/rss/WRTKit/Resources/ProgressBar0.png
new file mode 100644 (file)
index 0000000..9d74fad
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ProgressBar0.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ProgressBar10.png b/wrt/misc/rss/WRTKit/Resources/ProgressBar10.png
new file mode 100644 (file)
index 0000000..eaf26a7
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ProgressBar10.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ProgressBar100.png b/wrt/misc/rss/WRTKit/Resources/ProgressBar100.png
new file mode 100644 (file)
index 0000000..51340de
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ProgressBar100.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ProgressBar20.png b/wrt/misc/rss/WRTKit/Resources/ProgressBar20.png
new file mode 100644 (file)
index 0000000..88140ae
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ProgressBar20.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ProgressBar30.png b/wrt/misc/rss/WRTKit/Resources/ProgressBar30.png
new file mode 100644 (file)
index 0000000..e2fea97
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ProgressBar30.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ProgressBar40.png b/wrt/misc/rss/WRTKit/Resources/ProgressBar40.png
new file mode 100644 (file)
index 0000000..9db19a6
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ProgressBar40.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ProgressBar50.png b/wrt/misc/rss/WRTKit/Resources/ProgressBar50.png
new file mode 100644 (file)
index 0000000..f5c3a86
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ProgressBar50.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ProgressBar60.png b/wrt/misc/rss/WRTKit/Resources/ProgressBar60.png
new file mode 100644 (file)
index 0000000..59810c7
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ProgressBar60.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ProgressBar70.png b/wrt/misc/rss/WRTKit/Resources/ProgressBar70.png
new file mode 100644 (file)
index 0000000..d037e58
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ProgressBar70.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ProgressBar80.png b/wrt/misc/rss/WRTKit/Resources/ProgressBar80.png
new file mode 100644 (file)
index 0000000..60d57f2
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ProgressBar80.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ProgressBar90.png b/wrt/misc/rss/WRTKit/Resources/ProgressBar90.png
new file mode 100644 (file)
index 0000000..9955d6b
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ProgressBar90.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ProgressBarUnknown.gif b/wrt/misc/rss/WRTKit/Resources/ProgressBarUnknown.gif
new file mode 100644 (file)
index 0000000..cd6b3f6
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ProgressBarUnknown.gif differ
diff --git a/wrt/misc/rss/WRTKit/Resources/RadioButton.png b/wrt/misc/rss/WRTKit/Resources/RadioButton.png
new file mode 100644 (file)
index 0000000..ad9311a
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/RadioButton.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ScrollbarThumbBottom.png b/wrt/misc/rss/WRTKit/Resources/ScrollbarThumbBottom.png
new file mode 100644 (file)
index 0000000..14e073f
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ScrollbarThumbBottom.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ScrollbarThumbMiddle.png b/wrt/misc/rss/WRTKit/Resources/ScrollbarThumbMiddle.png
new file mode 100644 (file)
index 0000000..e48f493
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ScrollbarThumbMiddle.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ScrollbarThumbTop.png b/wrt/misc/rss/WRTKit/Resources/ScrollbarThumbTop.png
new file mode 100644 (file)
index 0000000..2e79548
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ScrollbarThumbTop.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ScrollbarTrackBottom.png b/wrt/misc/rss/WRTKit/Resources/ScrollbarTrackBottom.png
new file mode 100644 (file)
index 0000000..853452b
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ScrollbarTrackBottom.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ScrollbarTrackMiddle.png b/wrt/misc/rss/WRTKit/Resources/ScrollbarTrackMiddle.png
new file mode 100644 (file)
index 0000000..93bf3fc
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ScrollbarTrackMiddle.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/ScrollbarTrackTop.png b/wrt/misc/rss/WRTKit/Resources/ScrollbarTrackTop.png
new file mode 100644 (file)
index 0000000..883dd14
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/ScrollbarTrackTop.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/SeparatorCenter.png b/wrt/misc/rss/WRTKit/Resources/SeparatorCenter.png
new file mode 100644 (file)
index 0000000..df0b5b6
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/SeparatorCenter.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/SeparatorLeft.png b/wrt/misc/rss/WRTKit/Resources/SeparatorLeft.png
new file mode 100644 (file)
index 0000000..86f3df6
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/SeparatorLeft.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/SeparatorRight.png b/wrt/misc/rss/WRTKit/Resources/SeparatorRight.png
new file mode 100644 (file)
index 0000000..ebd5f7d
Binary files /dev/null and b/wrt/misc/rss/WRTKit/Resources/SeparatorRight.png differ
diff --git a/wrt/misc/rss/WRTKit/Resources/UI.css b/wrt/misc/rss/WRTKit/Resources/UI.css
new file mode 100644 (file)
index 0000000..e7d1a86
--- /dev/null
@@ -0,0 +1,912 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+/******************************************************************************/\r
+/*        Definition of visuals for the WRTKit user interface toolkit         */\r
+/******************************************************************************/\r
+\r
+/******************************************************************************/\r
+/* Document body rules */\r
+\r
+body {\r
+    margin: 0px;\r
+    background: url("DocumentBackground.png") repeat-x fixed;\r
+    font: normal 12px Arial, sans-serif;\r
+    color: rgb(0,0,0);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* Override default WRT styling for HTML form controls */\r
+\r
+/* Textarea when focused */\r
+textarea:focus {\r
+    outline: none;\r
+}\r
+\r
+/* Textarea when hovering */\r
+textarea:hover {\r
+    outline: none;\r
+}\r
+\r
+/* Select elements when focused */\r
+select:focus {\r
+    outline: none;\r
+}\r
+\r
+/* Select elements when hovering */\r
+select:hover {\r
+    outline: none;\r
+}\r
+\r
+/* Input elements when focused */\r
+input:focus {\r
+    outline: none;\r
+}\r
+\r
+/* Input elements when hovering */\r
+input:hover {\r
+    outline: none;\r
+}\r
+\r
+/* Link elements */\r
+a {\r
+    text-decoration: none;\r
+    color: rgb(0,0,0);\r
+}\r
+\r
+/* Links when focused */\r
+a:focus {\r
+    background: none;\r
+    outline: none;\r
+}\r
+\r
+/* Links when hovering */\r
+a:hover {\r
+    background: none;\r
+    outline: none;\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* Rules for default view and document scrollbar containers */\r
+\r
+/* Default view container rules */\r
+.ViewContainer {\r
+    margin: 0px 0px 0px 0px;\r
+}\r
+\r
+/* Default document scrollbar container rules */\r
+.DocumentScrollbarContainer {\r
+    position: fixed;\r
+    right: 0px;\r
+    top: 0px;\r
+    height: 100%;\r
+    width: 7px;\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* View style rules */\r
+\r
+/* Rules for the list view */\r
+.ListView {\r
+    margin: 0px 0px 0px 0px;\r
+}\r
+\r
+/* Rules for the list view caption */\r
+.ListViewCaption {\r
+    background: url("ListViewCaptionBackground.png");\r
+    height: 35px;\r
+}\r
+\r
+/* Rules for the list view caption text */\r
+.ListViewCaptionText {\r
+    font-size: 18px;\r
+    font-weight: bold;\r
+    padding: 7px 0px 0px 11px;\r
+}\r
+\r
+/* Rules for the list view control list element */\r
+.ListViewControlList {\r
+    margin: 1px 10px 1px 3px;\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* Control style rules */\r
+\r
+/* Rules for control root element (rootElement) */\r
+.Control {\r
+    \r
+}\r
+\r
+/* Control assembly rules (assemblyElement) */\r
+.ControlAssembly {\r
+    background: url("ControlAssemblyBackground.png") repeat-x;\r
+    padding: 1px 5px;\r
+}\r
+\r
+/* Control assembly in normal state */\r
+.ControlAssemblyNormal {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Control assembly in focused state */\r
+.ControlAssemblyFocus {\r
+    background-position: 0px -250px;\r
+}\r
+\r
+/* Control assembly in hovering state */\r
+.ControlAssemblyHover {\r
+    background-position: 0px -500px;\r
+}\r
+\r
+/* Control assembly in disabled state */\r
+.ControlAssemblyDisabled {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Caption for controls (captionElement) */\r
+.ControlCaption {\r
+    font-weight: bold;\r
+    padding: 3px 0px 0px 3px;\r
+}\r
+\r
+/* Caption for controls in normal state */\r
+.ControlCaptionNormal {\r
+    \r
+}\r
+\r
+/* Caption for controls when focused */\r
+.ControlCaptionFocus {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* Caption for controls when hovering */\r
+.ControlCaptionHover {\r
+    \r
+}\r
+\r
+/* Caption for controls when disabled */\r
+.ControlCaptionDisabled {\r
+    color: rgb(125,125,125);\r
+}\r
+\r
+/* Control element rules (controlElement) */\r
+.ControlElement {\r
+    padding: 3px 3px 3px 3px;\r
+}\r
+\r
+/******************************************************************************/\r
+/* Label */\r
+\r
+/* Rules for the text value of a Label control */\r
+.LabelText {\r
+    \r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* ContentPanel */\r
+\r
+/* Caption area rules for non-foldable content panels */\r
+.ContentPanelCaptionNonFoldable {\r
+    padding: 3px 0px 0px 3px;\r
+}\r
+\r
+/* Caption area rules for foldable content panels */\r
+.ContentPanelCaptionFoldable {\r
+    padding: 4px 0px 3px 3px;\r
+}\r
+\r
+/* Rules for fold toggling element in content panel */\r
+.ContentPanelFoldToggle {\r
+    background: url("ContentPanelFoldIcons.png") no-repeat;\r
+    padding-left: 16px;\r
+}\r
+\r
+/* Collapsed fold */\r
+.ContentPanelFoldToggleCollapsed {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Expanded fold */\r
+.ContentPanelFoldToggleExpanded {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* Rules for the content panel caption text */\r
+.ContentPanelCaptionText {\r
+    font-weight: bold;\r
+}\r
+\r
+/* Caption text for content panel in normal state */\r
+.ContentPanelCaptionTextNormal {\r
+    \r
+}\r
+\r
+/* Caption text for content panel when focused */\r
+.ContentPanelCaptionTextFocus {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* Caption text for content panel when hovering */\r
+.ContentPanelCaptionTextHover {\r
+    \r
+}\r
+\r
+/* Caption text for content panel when disabled */\r
+.ContentPanelCaptionTextDisabled {\r
+    color: rgb(125,125,125);\r
+}\r
+\r
+/* Rules for content in the content panel */\r
+.ContentPanelContent {\r
+    padding: 2px 2px 2px 8px;\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* FormButton */\r
+\r
+/* Rules for form button */\r
+.FormButton {\r
+    \r
+}\r
+\r
+/* Rules for form button control element */\r
+.FormButtonControlElement {\r
+    \r
+}\r
+\r
+/* Rules for form button table (table) */\r
+.FormButtonTable {\r
+    width: 100%;\r
+    border-spacing: 0px;\r
+    padding: 0px;\r
+    table-layout: fixed;\r
+}\r
+\r
+/* Form button row (tr) */\r
+.FormButtonRow {\r
+    padding: 0px;\r
+}\r
+\r
+/* Rules for form button left cell (td) */\r
+.FormButtonLeftCell {\r
+    width: 8px;\r
+    height: 26px;\r
+    background: url("FormButtonLeft.png") no-repeat;\r
+    padding: 0px;\r
+}\r
+\r
+/* Rules for form button center cell (td) */\r
+.FormButtonCenterCell {\r
+    height: 26px;\r
+    background: url("FormButtonCenter.png") repeat-x;\r
+    padding: 0px;\r
+    vertical-align: middle;\r
+    text-align: center;\r
+}\r
+\r
+/* Rules for form button right cell (td) */\r
+.FormButtonRightCell {\r
+    width: 8px;\r
+    height: 26px;\r
+    background: url("FormButtonRight.png") no-repeat;\r
+    padding: 0px;\r
+}\r
+\r
+/* Rules for form button left cell in normal state (td) */\r
+.FormButtonLeftCellNormal {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Rules for form button left cell in focused state (td) */\r
+.FormButtonLeftCellFocus {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* Rules for form button left cell in hover state (td) */\r
+.FormButtonLeftCellHover {\r
+    background-position: 0px -100px;\r
+}\r
+\r
+/* Rules for form button left cell in disabled state (td) */\r
+.FormButtonLeftCellDisabled {\r
+    background-position: 0px -150px;\r
+}\r
+\r
+/* Rules for form button center cell in normal state (td) */\r
+.FormButtonCenterCellNormal {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Rules for form button center cell in focused state (td) */\r
+.FormButtonCenterCellFocus {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* Rules for form button center cell in hover state (td) */\r
+.FormButtonCenterCellHover {\r
+    background-position: 0px -100px;\r
+}\r
+\r
+/* Rules for form button center cell in disabled state (td) */\r
+.FormButtonCenterCellDisabled {\r
+    background-position: 0px -150px;\r
+}\r
+\r
+/* Rules for form button left cell in normal state (td) */\r
+.FormButtonRightCellNormal {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Rules for form button left cell in focused state (td) */\r
+.FormButtonRightCellFocus {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* Rules for form button left cell in hover state (td) */\r
+.FormButtonRightCellHover {\r
+    background-position: 0px -100px;\r
+}\r
+\r
+/* Rules for form button left cell in disabled state (td) */\r
+.FormButtonRightCellDisabled {\r
+    background-position: 0px -150px;\r
+}\r
+\r
+/* Rules for form button text */\r
+.FormButtonText {\r
+    font-weight: bold;\r
+}\r
+\r
+/* Form button text in normal state */\r
+.FormButtonTextNormal {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* Form button text when focused */\r
+.FormButtonTextFocus {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* Form button text when hovering */\r
+.FormButtonTextHover {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* Form button text when disabled */\r
+.FormButtonTextDisabled {\r
+    color: rgb(200,200,200);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* NavigationButton */\r
+\r
+/* Rules for navigation button */\r
+.NavigationButton {\r
+    \r
+}\r
+\r
+/* Rules for navigation button control element */\r
+.NavigationButtonControlElement {\r
+    padding: 3px 3px 3px 3px;\r
+}\r
+\r
+/* Rules for navigation button table (table) */\r
+.NavigationButtonTable {\r
+    border-spacing: 0px;\r
+    padding: 0px;\r
+}\r
+\r
+/* Navigation button row (tr) */\r
+.NavigationButtonRow {\r
+    padding: 0px;\r
+}\r
+\r
+/* Rules for navigation button image cell (td) */\r
+.NavigationButtonImageCell {\r
+    line-height: 1px;\r
+    font-size: 1px;\r
+    vertical-align: middle;\r
+}\r
+\r
+/* Rules for navigation button text cell (td) */\r
+.NavigationButtonTextCell {\r
+    vertical-align: middle;\r
+    padding: 0px;\r
+}\r
+\r
+/* Rules for navigation button image */\r
+.NavigationButtonImage {\r
+    padding: 0px 5px 0px 0px;\r
+}\r
+\r
+/* Rules for navigation button text */\r
+.NavigationButtonText {\r
+    font-weight: bold;\r
+}\r
+\r
+/* Navigation button text in normal state */\r
+.NavigationButtonTextNormal {\r
+    \r
+}\r
+\r
+/* Navigation button text when focused */\r
+.NavigationButtonTextFocus {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* Navigation button text when hovering */\r
+.NavigationButtonTextHover {\r
+    \r
+}\r
+\r
+/* Navigation button text when disabled */\r
+.NavigationButtonTextDisabled {\r
+    color: rgb(125,125,125);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* TextField */\r
+\r
+/* Rules for textField */\r
+.TextField {\r
+    width: 100%;\r
+    border: 1px solid rgb(0,0,0);\r
+    background: rgb(255,255,255);\r
+    margin: 0px 0px 3px 0px;\r
+}\r
+\r
+/* TextField in normal state */\r
+.TextFieldNormal {\r
+    \r
+}\r
+\r
+/* TextField in focus state */\r
+.TextFieldFocus {\r
+    \r
+}\r
+\r
+/* TextField in hover state */\r
+.TextFieldHover {\r
+    \r
+}\r
+\r
+/* TextField in disabled state */\r
+.TextFieldDisabled {\r
+    color: rgb(50,50,50);\r
+    background: rgb(200,200,200);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* TextArea */\r
+\r
+/* Rules for TextArea */\r
+.TextArea {\r
+    width: 100%;\r
+    border: 1px solid rgb(0,0,0);\r
+    background: rgb(255,255,255);\r
+    margin: 0px 0px 3px 0px;\r
+}\r
+\r
+/* TextArea in normal state */\r
+.TextAreaNormal {\r
+    \r
+}\r
+\r
+/* TextArea in focus state */\r
+.TextAreaFocus {\r
+    \r
+}\r
+\r
+/* TextArea in hover state */\r
+.TextAreaHover {\r
+    \r
+}\r
+\r
+/* TextArea in disabled state */\r
+.TextAreaDisabled {\r
+    color: rgb(50,50,50);\r
+    background: rgb(200,200,200);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* Separator */\r
+\r
+/* Rules for Separator (table) */\r
+.Separator {\r
+    width: 100%;\r
+    padding: 0px;\r
+    border-spacing: 0px;\r
+    table-layout: fixed;\r
+    margin: 3px 0px;\r
+}\r
+\r
+/* Separator row (tr) */\r
+.SeparatorRow {\r
+    padding: 0px;\r
+}\r
+\r
+/* Separator left cell (td) */\r
+.SeparatorLeftCell {\r
+    width: 5px;\r
+    height: 2px;\r
+    background: url("SeparatorLeft.png") no-repeat;\r
+    padding: 0px;\r
+}\r
+\r
+/* Separator center cell (td) */\r
+.SeparatorCenterCell {\r
+    height: 2px;\r
+    background: url("SeparatorCenter.png") repeat-x;\r
+    padding: 0px;\r
+}\r
+\r
+/* Separator right cell (td) */\r
+.SeparatorRightCell {\r
+    width: 6px;\r
+    height: 2px;\r
+    background: url("SeparatorRight.png") no-repeat;\r
+    padding: 0px;\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* SelectionMenu */\r
+\r
+/* Rules for SelectionMenu select element */\r
+.SelectionMenu {\r
+    width: 100%;\r
+    border: 1px solid rgb(0,0,0);\r
+    background: rgb(255,255,255);\r
+    margin: 0px 0px 3px 0px;\r
+}\r
+\r
+/* SelectionMenu in normal state */\r
+.SelectionMenuNormal {\r
+    \r
+}\r
+\r
+/* SelectionMenu in focus state */\r
+.SelectionMenuFocus {\r
+    \r
+}\r
+\r
+/* SelectionMenu in hover state */\r
+.SelectionMenuHover {\r
+    \r
+}\r
+\r
+/* SelectionMenu in disabled state */\r
+.SelectionMenuDisabled {\r
+    color: rgb(50,50,50);\r
+    background: rgb(200,200,200);\r
+}\r
+\r
+/* Rules for SelectionMenu option elements */\r
+.SelectionMenuOption {\r
+    background: rgb(255,255,255);\r
+}\r
+\r
+/* SelectionMenu option in normal state */\r
+.SelectionMenuOptionNormal {\r
+    \r
+}\r
+\r
+/* SelectionMenu option in focus state */\r
+.SelectionMenuOptionFocus {\r
+    \r
+}\r
+\r
+/* SelectionMenu option in hover state */\r
+.SelectionMenuOptionHover {\r
+    \r
+}\r
+\r
+/* SelectionMenu option in disabled state */\r
+.SelectionMenuOptionDisabled {\r
+    color: rgb(50,50,50);\r
+    background: rgb(200,200,200);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* SelectionList */\r
+\r
+/* SelectionList option list element */\r
+.SelectionList {\r
+    \r
+}\r
+\r
+/* SelectionList option list element in normal state */\r
+.SelectionListNormal {\r
+    \r
+}\r
+\r
+/* SelectionList option list element in focus state */\r
+.SelectionListFocus {\r
+    \r
+}\r
+\r
+/* SelectionList option list element in hover state */\r
+.SelectionListHover {\r
+    \r
+}\r
+\r
+/* SelectionList option list element in disabled state */\r
+.SelectionListDisabled {\r
+    \r
+}\r
+\r
+/* SelectionList option element in single selection mode */\r
+.SelectionListOptionSingle {\r
+    padding-left: 19px;\r
+    background: url("RadioButton.png") no-repeat;\r
+    height: 16px;\r
+}\r
+\r
+/* SelectionList option element in single selection mode, unchecked normal state */\r
+.SelectionListOptionSingleUncheckedNormal {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* SelectionList option element in single selection mode, unchecked focus state */\r
+.SelectionListOptionSingleUncheckedFocus {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* SelectionList option element in single selection mode, unchecked diabled state */\r
+.SelectionListOptionSingleUncheckedDisabled {\r
+    background-position: 0px -100px;\r
+}\r
+\r
+/* SelectionList option element in single selection mode, checked normal state */\r
+.SelectionListOptionSingleCheckedNormal {\r
+    background-position: 0px -150px;\r
+}\r
+\r
+/* SelectionList option element in single selection mode, checked focus state */\r
+.SelectionListOptionSingleCheckedFocus {\r
+    background-position: 0px -200px;\r
+}\r
+\r
+/* SelectionList option element in single selection mode, checked diabled state */\r
+.SelectionListOptionSingleCheckedDisabled {\r
+    background-position: 0px -250px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode */\r
+.SelectionListOptionMulti {\r
+    padding-left: 19px;\r
+    background: url("CheckBox.png") no-repeat;\r
+    height: 16px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode, unchecked normal state */\r
+.SelectionListOptionMultiUncheckedNormal {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode, unchecked focus state */\r
+.SelectionListOptionMultiUncheckedFocus {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode, unchecked diabled state */\r
+.SelectionListOptionMultiUncheckedDisabled {\r
+    background-position: 0px -100px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode, checked normal state */\r
+.SelectionListOptionMultiCheckedNormal {\r
+    background-position: 0px -150px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode, checked focus state */\r
+.SelectionListOptionMultiCheckedFocus {\r
+    background-position: 0px -200px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode, checked diabled state */\r
+.SelectionListOptionMultiCheckedDisabled {\r
+    background-position: 0px -250px;\r
+}\r
+\r
+/* SelectionList option text */\r
+.SelectionListOptionText {\r
+    \r
+}\r
+\r
+/* SelectionList option text in normal state */\r
+.SelectionListOptionTextNormal {\r
+    \r
+}\r
+\r
+/* SelectionList option text in focus state */\r
+.SelectionListOptionTextFocus {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* SelectionList option text in hover state */\r
+.SelectionListOptionTextHover {\r
+    \r
+}\r
+\r
+/* SelectionList option text in disabled state */\r
+.SelectionListOptionTextDisabled {\r
+    color: rgb(125,125,125);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* Scrollbar */\r
+\r
+/* Scrollbar root element */\r
+.Scrollbar {\r
+    position: absolute;\r
+    height: 100%;\r
+    width: 7px;\r
+}\r
+\r
+/* Top portion of scrollbar track */\r
+.ScrollbarTrackTop {\r
+    position: absolute;\r
+    background: url("ScrollbarTrackTop.png") no-repeat;\r
+    width: 7px;\r
+    height: 4px;\r
+}\r
+\r
+/* Middle portion of scrollbar track */\r
+.ScrollbarTrackMiddle {\r
+    position: absolute;\r
+    background: url("ScrollbarTrackMiddle.png") repeat-y;\r
+    width: 7px;\r
+}\r
+\r
+/* Bottom portion of scrollbar track */\r
+.ScrollbarTrackBottom {\r
+    position: absolute;\r
+    background: url("ScrollbarTrackBottom.png") no-repeat;\r
+    width: 7px;\r
+    height: 4px;\r
+}\r
+\r
+/* Top portion of scrollbar thumb */\r
+.ScrollbarThumbTop {\r
+    position: absolute;\r
+    background: url("ScrollbarThumbTop.png") no-repeat;\r
+    width: 7px;\r
+    height: 5px;\r
+}\r
+\r
+/* Middle portion of scrollbar thumb */\r
+.ScrollbarThumbMiddle {\r
+    position: absolute;\r
+    background: url("ScrollbarThumbMiddle.png") repeat-y;\r
+    width: 7px;\r
+}\r
+\r
+/* Bottom portion of scrollbar thumb */\r
+.ScrollbarThumbBottom {\r
+    position: absolute;\r
+    background: url("ScrollbarThumbBottom.png") no-repeat;\r
+    width: 7px;\r
+    height: 5px;\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* NotificationPopup */\r
+\r
+/* Container that defines the area for the popup dialog */\r
+.NotificationPopupContainer {\r
+    position: fixed;\r
+    bottom: 0px;\r
+    left: 50%;\r
+    margin-left: -115px;\r
+    width: 230px;\r
+    height: 85px;\r
+}\r
+\r
+/* Notification popup dialog */\r
+.NotificationPopup {\r
+    position: absolute;\r
+    width: 230px;\r
+    height: 85px;\r
+    background: url("NotificationPopupBackground.png") repeat-x;\r
+    border: 1px solid rgb(0,0,0);\r
+}\r
+\r
+/* Notification type indicator */\r
+.NotificationPopupTypeIndicator {\r
+    position: absolute;\r
+    left: 195px;\r
+    top: 10px;\r
+    width: 24px;\r
+    height: 34px;\r
+    background: url("NotificationPopupTypeIndicator.png") no-repeat;\r
+}\r
+\r
+/* Notification type indicator for notifications of undefined type */\r
+.NotificationPopupTypeIndicatorNone {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Notification type indicator for info notifications */\r
+.NotificationPopupTypeIndicatorInfo {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* Notification type indicator for warning notifications */\r
+.NotificationPopupTypeIndicatorWarning {\r
+    background-position: 0px -100px;\r
+}\r
+\r
+/* Notification type indicator for wait notifications */\r
+.NotificationPopupTypeIndicatorWait {\r
+    background-position: 0px -150px;\r
+}\r
+\r
+/* Notification text area */\r
+.NotificationPopupText {\r
+    position: absolute;\r
+    left: 10px;\r
+    top: 8px;\r
+    width: 180px;\r
+    height: 50px;\r
+}\r
+\r
+/* Progress bar */\r
+.NotificationPopupProgressBar {\r
+    position: absolute;\r
+    left: 6px;\r
+    top: 60px;\r
+    width: 218px;\r
+    height: 16px;\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/ActionControl.js b/wrt/misc/rss/WRTKit/UI/ActionControl.js
new file mode 100644 (file)
index 0000000..ecb76e7
--- /dev/null
@@ -0,0 +1,144 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (ÒNokiaÓ) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under NokiaÕs copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The ActionControl class is an abstract base class for action controls like\r
+// buttons. Don't use ActionControl directly.\r
+\r
+// Constructor.\r
+function ActionControl(id, caption) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption);\r
+    }\r
+}\r
+\r
+// ActionControl inherits from Control.\r
+ActionControl.prototype = new Control(UI_NO_INIT_ID);\r
+\r
+// Reference to the button element.\r
+ActionControl.prototype.buttonElement = null;\r
+\r
+// Reference to the link element.\r
+ActionControl.prototype.linkElement = null;\r
+\r
+// Enabled status.\r
+ActionControl.prototype.enabled = false;\r
+\r
+// Initializer - called from constructor.\r
+ActionControl.prototype.init = function(id, caption) {\r
+    uiLogger.debug("ActionControl.init(" + id + ", " + caption + ")");\r
+    \r
+    // call superclass initializer\r
+    Control.prototype.init.call(this, id, caption);\r
+    \r
+    // the control defaults to enabled\r
+    this.enabled = true;\r
+}\r
+\r
+// Common event listeners hookup function called from subclasses.\r
+ActionControl.prototype.bindActionControlListeners = function() {\r
+    var self = this;\r
+    this.linkElement.addEventListener("focus", function() { self.focusStateChanged(true); }, false);\r
+    this.linkElement.addEventListener("blur", function() { self.focusStateChanged(false); }, false);\r
+    this.buttonElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);\r
+    this.buttonElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);\r
+    this.buttonElement.addEventListener("mousedown", function(event) {\r
+                                                       self.controlClicked(event);\r
+                                                       event.stopPropagation();\r
+                                                       event.preventDefault();\r
+                                                   }, true);\r
+    this.buttonElement.addEventListener("keydown", function(event) {\r
+                                                    // center and enter trigger the action\r
+                                                    if (event.keyCode == 0 || event.keyCode == 13) {\r
+                                                        self.controlClicked();\r
+                                                        event.stopPropagation();\r
+                                                        event.preventDefault();\r
+                                                    }\r
+                                                 }, true);\r
+}\r
+\r
+// Returns the enabled state.\r
+ActionControl.prototype.isEnabled = function() {\r
+    return this.enabled;\r
+}\r
+\r
+// Sets the enabled state.\r
+ActionControl.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("ActionControl.setEnabled(" + enabled + ")");\r
+    // switch the state\r
+    this.enabled = enabled;\r
+}\r
+\r
+// Sets the focused state for the control.\r
+// Note: This may not always succeed.\r
+ActionControl.prototype.setFocused = function(focused) {\r
+    uiLogger.debug("ActionControl.setFocused(" + focused + ")");\r
+    if (this.enabled) {\r
+        if (focused) {\r
+            this.linkElement.focus();\r
+        } else {\r
+            this.linkElement.blur();\r
+        }\r
+    }\r
+}\r
+\r
+// Callback for clicks.\r
+ActionControl.prototype.controlClicked = function(event) {\r
+    uiLogger.debug("ActionControl.controlClicked()");\r
+    \r
+    // if we're enabled then a click results in an action performed event\r
+    if (this.enabled) {\r
+        // focus when clicked\r
+        if (!this.focused) {\r
+            this.linkElement.focus();\r
+        }\r
+        \r
+        // notify event listeners\r
+        this.actionPerformed(event);\r
+    }\r
+}\r
+\r
+// Callback for action performed events.\r
+ActionControl.prototype.actionPerformed = function(event) {\r
+    uiLogger.debug("ActionControl.actionPerformed()");\r
+    // notify event listeners\r
+    this.fireEvent(this.createEvent("ActionPerformed", event));\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/Ajax.js b/wrt/misc/rss/WRTKit/UI/Ajax.js
new file mode 100644 (file)
index 0000000..22d0ab4
--- /dev/null
@@ -0,0 +1,103 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// Ajax utility calss to create XmlHttpRequest object\r
+function Ajax() \r
+{\r
+       //      xmlHttpRequest object   \r
+       var request = null;\r
+\r
+    // branch for native XMLHttpRequest object\r
+    if(window.XMLHttpRequest && !(window.ActiveXObject)) {\r
+       try \r
+               {\r
+                       request = new XMLHttpRequest();\r
+                       try\r
+                       {\r
+                               //      attach the Bypass code, if the browser is firefox\r
+                               if(netscape.security.PrivilegeManager.enablePrivilege)\r
+                               {\r
+                                       //      duplicate the function\r
+                                       request._open = request.open;\r
+                                       \r
+                                       //      redefine the function definition\r
+                                       request.open = function(method, url, flag)\r
+                                       {\r
+                                               try\r
+                                               {\r
+                                                       // Enable Universal Browser Read\r
+                                                       netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");\r
+\r
+                                                       //      call the native XmlHttpRequest.open method\r
+                                                       this._open(method, url, flag);\r
+                                               }catch(e)\r
+                                               {\r
+                                                       //      call the native XmlHttpRequest.open method\r
+                                                       this._open(method, url, flag);\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+                       catch(e)\r
+                       {\r
+                               //      eatup all exceptions\r
+                       }\r
+               } \r
+               catch(e) {\r
+                       request = null;\r
+        }\r
+    // branch for IE/Windows ActiveX version\r
+    } else if(window.ActiveXObject) {\r
+               try {\r
+               request = new ActiveXObject("Msxml2.XMLHTTP");\r
+       } catch(e) {\r
+               try {\r
+                       request = new ActiveXObject("Microsoft.XMLHTTP");\r
+               } catch(e) {\r
+                       alert('Failed to create XmlHttprequest');\r
+                               return null;\r
+               }\r
+               }\r
+    }\r
+       \r
+       return (request);\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/ContentPanel.js b/wrt/misc/rss/WRTKit/UI/ContentPanel.js
new file mode 100644 (file)
index 0000000..a6acce7
--- /dev/null
@@ -0,0 +1,367 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The ContentPanel class is a control for displaying content. The panel\r
+// can be expanded and collapsed.\r
+\r
+// Constructor.\r
+function ContentPanel(id, caption, content, foldable, expanded) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, content, foldable, expanded);\r
+    }\r
+}\r
+\r
+// ContentPanel inherits from Control.\r
+ContentPanel.prototype = new Control(UI_NO_INIT_ID);\r
+\r
+// The element hierarchy in a content panel is as follows:\r
+//\r
+// rootElement\r
+//     assemblyElement\r
+//         captionElement\r
+//             foldToggleElement\r
+//                 captionLinkElement\r
+//                     captionTextElement\r
+//     contentElement\r
+//\r
+// captionTextElement is moved under foldToggleElement if disabled\r
+// or captionElement if not foldable\r
+\r
+// The fold toggle element used for folding content panels.\r
+ContentPanel.prototype.foldToggleElement = null;\r
+\r
+// The caption link element of this control.\r
+ContentPanel.prototype.captionLinkElement = null;\r
+\r
+// The caption text element of this control.\r
+ContentPanel.prototype.captionTextElement = null;\r
+\r
+// The content element of this control.\r
+ContentPanel.prototype.contentElement = null;\r
+\r
+// The foldable state of this control.\r
+ContentPanel.prototype.foldable = false;\r
+\r
+// The expanded state of this control.\r
+ContentPanel.prototype.expanded = false;\r
+\r
+// Enabled status.\r
+ContentPanel.prototype.enabled = false;\r
+\r
+// Initializer - called from constructor.\r
+ContentPanel.prototype.init = function(id, caption, content, foldable, expanded) {\r
+    uiLogger.debug("ContentPanel.init(" + id + ", " + caption + ", " + content + ", " + foldable + ", " + expanded + ")");\r
+    \r
+    // call superclass initializer\r
+    Control.prototype.init.call(this, id, caption);\r
+    \r
+    // the control defaults to enabled\r
+    this.enabled = true;\r
+    \r
+    // create caption text element\r
+    this.captionTextElement = document.createElement("span");\r
+    \r
+    // disconnect the control element\r
+    this.assemblyElement.removeChild(this.controlElement);\r
+    \r
+    // set the foldable state\r
+    this.foldable = foldable;\r
+    \r
+    // is this a foldable content panel?\r
+    if (foldable) {\r
+        // create fold toggle element\r
+        this.foldToggleElement = document.createElement("div");\r
+        this.captionElement.appendChild(this.foldToggleElement);\r
+        \r
+        // create caption link and add to caption element\r
+        this.captionLinkElement = document.createElement("a");\r
+        this.captionLinkElement.href = "JavaScript:void(0)";\r
+        this.foldToggleElement.appendChild(this.captionLinkElement);\r
+        \r
+        // add the text element to the link element\r
+        this.captionLinkElement.appendChild(this.captionTextElement);\r
+        \r
+        // bind event listeners\r
+        var self = this;\r
+        this.captionLinkElement.addEventListener("focus", function() { self.focusStateChanged(true); }, false);\r
+        this.captionLinkElement.addEventListener("blur", function() { self.focusStateChanged(false); }, false);\r
+        this.foldToggleElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);\r
+        this.foldToggleElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);\r
+        this.foldToggleElement.addEventListener("mousedown", function(event) {\r
+                                                                 self.captionClicked();\r
+                                                                 event.stopPropagation();\r
+                                                                 event.preventDefault();\r
+                                                             }, true);\r
+        this.foldToggleElement.addEventListener("keydown", function(event) {\r
+                                                               // center and enter trigger the action\r
+                                                               if (event.keyCode == 0 || event.keyCode == 13) {\r
+                                                                   self.captionClicked();\r
+                                                                   event.stopPropagation();\r
+                                                                   event.preventDefault();\r
+                                                               }\r
+                                                           }, true);\r
+        \r
+        this.expanded = expanded;\r
+    } else {\r
+        // since this is not a foldable panel the content should be expanded\r
+        this.expanded = true;\r
+        \r
+        // add the text element directly to the caption element\r
+        this.captionElement.appendChild(this.captionTextElement);\r
+    }\r
+    \r
+    // create content element\r
+    this.contentElement = document.createElement("div");\r
+    this.contentElement.style.display = this.expanded ? "block" : "none";\r
+    this.rootElement.appendChild(this.contentElement);\r
+    \r
+    // set caption, content and expanded state\r
+    this.setCaption(caption);\r
+    this.setContent(content);\r
+    \r
+    // update style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the enabled state.\r
+ContentPanel.prototype.isEnabled = function() {\r
+    return this.enabled;\r
+}\r
+\r
+// Sets the enabled state.\r
+ContentPanel.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("ContentPanel.setEnabled(" + enabled + ")");\r
+    \r
+    // bail out early if there is no change in state\r
+    if (this.enabled == enabled) {\r
+        return;\r
+    }\r
+    \r
+    // set the enabled state\r
+    this.enabled = enabled;\r
+    \r
+    // is this a foldable content?\r
+    if (this.foldable) {\r
+         // the caption link must be disabled\r
+        if (this.enabled) {\r
+            // diabled -> enabled\r
+            this.foldToggleElement.removeChild(this.captionTextElement);\r
+            this.foldToggleElement.appendChild(this.captionLinkElement);\r
+            this.captionLinkElement.appendChild(this.captionTextElement);\r
+        } else {\r
+            // enabled -> diabled\r
+            this.captionLinkElement.removeChild(this.captionTextElement);\r
+            this.foldToggleElement.removeChild(this.captionLinkElement);\r
+            this.foldToggleElement.appendChild(this.captionTextElement);\r
+        }\r
+    }\r
+    \r
+    // update style\r
+    this.updateStyleFromState();    \r
+}\r
+\r
+// Returns the caption; null if none.\r
+ContentPanel.prototype.getCaption = function() {\r
+    return this.caption;\r
+}\r
+\r
+// Sets the caption; null if none.\r
+ContentPanel.prototype.setCaption = function(caption) {\r
+    // bail out if the caption text element has not been created\r
+    // this is to prevent the superclass init calling this before\r
+    // we've initialized our custom caption\r
+    if (this.captionTextElement == null)\r
+        return;\r
+    \r
+    uiLogger.debug("ContentPanel.setCaption(" + caption + ")");\r
+    \r
+    // set the display style\r
+    this.captionElement.style.display = (caption == null) ? "none" : "block";\r
+    \r
+    // set the caption\r
+    this.caption = caption;\r
+    this.captionTextElement.innerHTML = (caption == null) ? "" : caption;\r
+    \r
+    // update style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the content.\r
+ContentPanel.prototype.getContent = function() {\r
+    return this.contentElement.innerHTML;\r
+}\r
+\r
+// Sets the content.\r
+ContentPanel.prototype.setContent = function(content) {\r
+    uiLogger.debug("ContentPanel.setContent(" + content + ")");\r
+    this.contentElement.innerHTML = (content == null) ? "" : content;\r
+}\r
+\r
+// Returns the focusable state for the control.\r
+ContentPanel.prototype.isFocusable = function() {\r
+    // a content panel is focusable if it's foldable and enabled\r
+    return (this.foldable && this.enabled);\r
+}\r
+\r
+// Sets the focused state for the control.\r
+// Note: This may not always succeed.\r
+ContentPanel.prototype.setFocused = function(focused) {\r
+    uiLogger.debug("ContentPanel.setFocused(" + focused + ")");\r
+    if (this.enabled && this.foldable) {\r
+        if (focused) {\r
+            this.captionLinkElement.focus();\r
+        } else {\r
+            this.captionLinkElement.blur();\r
+        }\r
+    }\r
+    // note that this.focused gets set as a result of focusStateChanged() being called\r
+    // rather than setting it explicitly here\r
+}\r
+\r
+// Returns the expanded state.\r
+ContentPanel.prototype.isExpanded = function() {\r
+    return this.expanded;\r
+}\r
+\r
+// Sets the expanded state.\r
+ContentPanel.prototype.setExpanded = function(expanded) {\r
+    uiLogger.debug("ContentPanel.setExpanded(" + expanded + ")");\r
+    \r
+    // make sure only foldable content panels are folded\r
+    if (!this.foldable) {\r
+        uiLogger.warn("Cannot fold a non-foldable content panel!");\r
+        return;\r
+    }\r
+    \r
+    this.expanded = expanded;\r
+    if (this.expanded) {\r
+        // expand\r
+        this.contentElement.style.display = "block";\r
+        \r
+        // find out control top and bottom\r
+        var controlTop = this.getAbsoluteTop(this.rootElement);\r
+        var controlHeight = this.rootElement.clientHeight;\r
+        var controlBottom = controlTop + controlHeight;\r
+        \r
+        // find out the viewport top and bottom\r
+        var viewportTop = window.scrollY;\r
+        var viewportHeight = window.innerHeight;\r
+        var viewportBottom = viewportTop + viewportHeight;\r
+        \r
+        // make sure the control is positioned so that it can be seen\r
+        var overflow = controlBottom - viewportBottom;\r
+        if (overflow > 0) {\r
+            // there's overflow so we need to scroll to get the control\r
+            // into the viewport - however not so far that the control\r
+            // goes past the viewport top.\r
+            var distanceToTop = controlTop - viewportTop;\r
+            var scrollAmount = Math.min(overflow, distanceToTop);\r
+            window.scrollBy(0, scrollAmount);\r
+        }\r
+    } else {\r
+        // collapse\r
+        this.contentElement.style.display = "none";\r
+    }\r
+    \r
+    // notify event listeners\r
+    this.fireEvent(this.createEvent("ExpandedStateChanged", this.expanded));\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the absolute position (y) of the given element.\r
+ContentPanel.prototype.getAbsoluteTop = function(element) {\r
+    // traverse from element to root and add top-offset\r
+    // for each element we find on the way\r
+    var absTop = 0;\r
+    while (element != null) {\r
+        absTop += element.offsetTop;\r
+        element = element.offsetParent;\r
+    }\r
+    return absTop;\r
+}\r
+\r
+// Callback for when the caption is clicked.\r
+ContentPanel.prototype.captionClicked = function() {\r
+    uiLogger.debug("ContentPanel.captionClicked()");\r
+    \r
+    // if we're enabled then a click results toggling the expanded state\r
+    if (this.enabled) {\r
+        // focus when clicked\r
+        if (!this.focused) {\r
+            this.captionLinkElement.focus();\r
+        }\r
+        \r
+        // toggle the expanded state\r
+        this.setExpanded(!this.expanded);\r
+    }\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+ContentPanel.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("ContentPanel.updateStyleFromState()");\r
+\r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set root element class name\r
+    this.setClassName(this.rootElement, "Control");\r
+\r
+    // set the control assembly class names\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);\r
+    \r
+    if (this.foldable) {\r
+        // foldable content panel\r
+        this.setClassName(this.captionElement, "ContentPanelCaptionFoldable");\r
+        this.setClassName(this.foldToggleElement, "ContentPanelFoldToggle ContentPanelFoldToggle" + (this.expanded ? "Expanded" : "Collapsed"));\r
+    } else {\r
+        // non-folding\r
+        this.setClassName(this.captionElement, "ContentPanelCaptionNonFoldable");\r
+    }\r
+    \r
+    // set the content caption text class names\r
+    this.setClassName(this.captionTextElement, "ContentPanelCaptionText ContentPanelCaptionText" + stateName);\r
+    \r
+    // set the content element class names\r
+    this.setClassName(this.contentElement, "ContentPanelContent");\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/Control.js b/wrt/misc/rss/WRTKit/UI/Control.js
new file mode 100644 (file)
index 0000000..e3bee0f
--- /dev/null
@@ -0,0 +1,231 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The Control class is an abstract base class for all user interface controls.\r
+\r
+// Constructor.\r
+function Control(id, caption) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption);\r
+    }\r
+}\r
+\r
+// Control inherits from UIElement.\r
+Control.prototype = new UIElement(UI_NO_INIT_ID);\r
+\r
+// The view that control belongs to.\r
+Control.prototype.view = null;\r
+\r
+// Is the control focused?\r
+Control.prototype.focused = false;\r
+\r
+// Is the pointer over this control?\r
+Control.prototype.hovering = false;\r
+\r
+// The element hierarchy in a control is as follows:\r
+//\r
+// rootElement\r
+//     assemblyElement\r
+//         captionElement\r
+//         controlElement\r
+//\r
+// The assembly element groups the portion of a control that typically handle\r
+// the visual effects for focus and hover states. Having a separate root and\r
+// assembly elements allows other elements to be added to a control without\r
+// them being affected by the CSS rules of the assembly element.\r
+\r
+// The assembly element of this control.\r
+Control.prototype.assemblyElement = null;\r
+\r
+// The caption of this control; null if none.\r
+Control.prototype.caption = null;\r
+\r
+// The caption element of this control.\r
+Control.prototype.captionElement = null;\r
+\r
+// The control element of this control.\r
+Control.prototype.controlElement = null;\r
+\r
+// Initializer - called from constructor.\r
+Control.prototype.init = function(id, caption) {\r
+    uiLogger.debug("Control.init(" + id + ", " + caption + ")");\r
+    \r
+    // call superclass initializer\r
+    UIElement.prototype.init.call(this, id);\r
+    \r
+    // create assembly, caption and control elements\r
+    this.assemblyElement = document.createElement("div");\r
+    this.captionElement = document.createElement("div");\r
+    this.assemblyElement.appendChild(this.captionElement);\r
+    this.controlElement = document.createElement("div");\r
+    this.assemblyElement.appendChild(this.controlElement);\r
+    this.rootElement.appendChild(this.assemblyElement);\r
+    \r
+    // set the caption\r
+    // style is not updated because the subclass will update the style later\r
+    // when it has completely initialized the component\r
+    this.setCaption(caption, true);\r
+}\r
+\r
+// Returns the caption; null if none.\r
+Control.prototype.getCaption = function() {\r
+    return this.caption;\r
+}\r
+\r
+// Sets the caption; null if none.\r
+Control.prototype.setCaption = function(caption, noStyleUpdate) {\r
+    uiLogger.debug("Control.setCaption(" + caption + ")");\r
+    \r
+    // set the display style\r
+    this.captionElement.style.display = (caption == null) ? "none" : "block";\r
+    \r
+    // set the caption\r
+    this.caption = caption;\r
+    this.captionElement.innerHTML = (caption == null) ? "" : caption;\r
+    \r
+    // update style\r
+    if (!noStyleUpdate) {\r
+        this.updateStyleFromState();\r
+    }\r
+}\r
+\r
+// Returns the enabled state.\r
+// Override this in subclasses as required to implement the state change.\r
+Control.prototype.isEnabled = function() {\r
+    return false;\r
+}\r
+\r
+// Sets the enabled state.\r
+// Override this in subclasses as required to implement the state change.\r
+Control.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("Control.setEnabled(" + enabled + ")");\r
+}\r
+\r
+// Returns the focusable state for the control.\r
+// Defaults focusable if enabled - override this in subclasses as required.\r
+Control.prototype.isFocusable = function() {\r
+    return this.isEnabled();\r
+}\r
+\r
+// Returns the focused state for the control.\r
+Control.prototype.isFocused = function() {\r
+    return this.focused;\r
+}\r
+\r
+// Sets the focused state for the control.\r
+// Note: This may not always succeed.\r
+// Override this in subclasses as required to implement the state change.\r
+Control.prototype.setFocused = function(focused) {\r
+    uiLogger.debug("Control.setFocused(" + focused + ")");\r
+    // note that this.focused gets set as a result of focusStateChanged() being called\r
+    // rather than setting it explicitly here\r
+}\r
+\r
+// Called when the focus state has changed for this control.\r
+Control.prototype.focusStateChanged = function(focused) {\r
+    uiLogger.debug("Control.focusStateChanged(" + focused + ")");\r
+    if (this.focused != focused) {\r
+        this.focused = focused;\r
+        \r
+        // let the view know about the focus change\r
+        if (this.view != null) {\r
+            this.view.focusedControlChanged(focused ? this : null);\r
+        }\r
+        \r
+        // update the style from the current state\r
+        this.updateStyleFromState();\r
+        \r
+        // notify event listeners\r
+        this.fireEvent(this.createEvent("FocusStateChanged", focused));\r
+    }\r
+}\r
+\r
+// Called when the hover state has changed for this control.\r
+Control.prototype.hoverStateChanged = function(hovering) {\r
+    uiLogger.debug("Control.hoverStateChanged(" + hovering + ")");\r
+    if (this.hovering != hovering) {\r
+        this.hovering = hovering;\r
+        \r
+        // update the style from the current state\r
+        this.updateStyleFromState();\r
+        \r
+        // notify event listeners\r
+        this.fireEvent(this.createEvent("HoverStateChanged", hovering));\r
+    }\r
+}\r
+\r
+// Helper method that returns the state name for the current state.\r
+Control.prototype.getStyleStateName = function() {\r
+    var focusable = this.isFocusable();\r
+    if (focusable && this.focused) {\r
+        return "Focus";\r
+    } else if (focusable && this.hovering) {\r
+        return "Hover";\r
+    } else if (!this.isEnabled()) {\r
+        return "Disabled";\r
+    } else {\r
+        return "Normal";\r
+    }\r
+}\r
+\r
+// Resets the state tracking for focus and hover.\r
+// Override this in subclasses as required to implement the state reset.\r
+Control.prototype.resetFocusState = function() {\r
+    uiLogger.debug("Control.resetFocusState()");\r
+    this.hovering = false;\r
+    this.focused = false;\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Helper function that sets a classname for an element.\r
+// Only sets the class name if it actually is different from the current value.\r
+Control.prototype.setClassName = function(element, className) {\r
+    if (element.className != className) {\r
+        element.className = className;\r
+    }\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+// Override this in subclasses as required to implement the state change.\r
+Control.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("Control.updateStyleFromState()");\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/FormButton.js b/wrt/misc/rss/WRTKit/UI/FormButton.js
new file mode 100644 (file)
index 0000000..fdf59bf
--- /dev/null
@@ -0,0 +1,177 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The FormButton class implements a button control for use in form-style UIs.\r
+\r
+// Constructor.\r
+function FormButton(id, text) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, text);\r
+    }\r
+}\r
+\r
+// FormButton inherits from ActionControl.\r
+FormButton.prototype = new ActionControl(UI_NO_INIT_ID);\r
+\r
+// Button table element.\r
+FormButton.prototype.tableElement = null;\r
+\r
+// Button table row element.\r
+FormButton.prototype.tableRowElement = null;\r
+\r
+// Button table left cell element.\r
+FormButton.prototype.tableLeftCellElement = null;\r
+\r
+// Button table center cell element.\r
+FormButton.prototype.tableCenterCellElement = null;\r
+\r
+// Button text element.\r
+FormButton.prototype.textElement = null;\r
+\r
+// Button table right cell element.\r
+FormButton.prototype.tableRightCellElement = null;\r
+\r
+// Initializer - called from constructor.\r
+FormButton.prototype.init = function(id, text) {\r
+    uiLogger.debug("FormButton.init(" + id + ", " + text + ")");\r
+    \r
+    // call superclass initializer\r
+    ActionControl.prototype.init.call(this, id, null);\r
+    \r
+    // remove caption element\r
+    this.assemblyElement.removeChild(this.captionElement);\r
+    \r
+    // construct the button\r
+    this.buttonElement = document.createElement("div");\r
+    this.tableElement = document.createElement("table");\r
+    this.tableRowElement = document.createElement("tr");\r
+    this.tableLeftCellElement = document.createElement("td");\r
+    this.tableCenterCellElement = document.createElement("td");\r
+    this.linkElement = document.createElement("a");\r
+    this.linkElement.href = "JavaScript:void(0)";\r
+    this.textElement = document.createElement("span");\r
+    this.tableRightCellElement = document.createElement("td");\r
+    this.tableElement.appendChild(this.tableRowElement);\r
+    this.tableRowElement.appendChild(this.tableLeftCellElement);\r
+    this.tableRowElement.appendChild(this.tableCenterCellElement);\r
+    this.tableCenterCellElement.appendChild(this.linkElement);\r
+    this.linkElement.appendChild(this.textElement);\r
+    this.tableRowElement.appendChild(this.tableRightCellElement);\r
+    this.buttonElement.appendChild(this.tableElement);\r
+    this.controlElement.appendChild(this.buttonElement);\r
+    \r
+    // set the text\r
+    this.setText(text);\r
+    \r
+    // bind event listeners\r
+    this.bindActionControlListeners();\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Sets the enabled state.\r
+FormButton.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("FormButton.setEnabled(" + enabled + ")");\r
+    \r
+    // bail out early if there is no change in state\r
+    if (this.enabled == enabled) {\r
+        return;\r
+    }\r
+    \r
+    // set the enabled state\r
+    this.enabled = enabled;\r
+    \r
+    if (this.enabled) {\r
+        // diabled -> enabled\r
+        this.tableCenterCellElement.removeChild(this.textElement);\r
+        this.tableCenterCellElement.appendChild(this.linkElement);\r
+        this.linkElement.appendChild(this.textElement);\r
+    } else {\r
+        // enabled -> diabled\r
+        this.linkElement.removeChild(this.textElement);\r
+        this.tableCenterCellElement.removeChild(this.linkElement);\r
+        this.tableCenterCellElement.appendChild(this.textElement);\r
+    }\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the button text.\r
+FormButton.prototype.getText = function() {\r
+    return this.textElement.innerHTML;\r
+}\r
+\r
+// Sets the button text.\r
+FormButton.prototype.setText = function(text) {\r
+    uiLogger.debug("FormButton.setText(" + text + ")");\r
+    this.textElement.innerHTML = (text == null) ? "" : text;;\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+FormButton.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("FormButton.updateStyleFromState()");\r
+    \r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set root element class name\r
+    this.setClassName(this.rootElement, "Control");\r
+    \r
+    // set the control assembly class names\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssemblyNormal");\r
+    \r
+    // control element\r
+    this.setClassName(this.controlElement, "ControlElement FormButtonControlElement");\r
+    \r
+    // set the button table class names\r
+    this.setClassName(this.buttonElement, "FormButton");\r
+    this.setClassName(this.tableElement, "FormButtonTable");\r
+    this.setClassName(this.tableRowElement, "FormButtonRow");\r
+    this.setClassName(this.tableLeftCellElement, "FormButtonLeftCell FormButtonLeftCell" + stateName);\r
+    this.setClassName(this.tableCenterCellElement, "FormButtonCenterCell FormButtonLeftCell" + stateName);\r
+    this.setClassName(this.tableRightCellElement, "FormButtonRightCell FormButtonLeftCell" + stateName);\r
+    \r
+    // set the button text class name\r
+    this.setClassName(this.textElement, "FormButtonText FormButtonText" + stateName);\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/Label.js b/wrt/misc/rss/WRTKit/UI/Label.js
new file mode 100644 (file)
index 0000000..0588d72
--- /dev/null
@@ -0,0 +1,105 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The Label class implements a control that displays textual content.\r
+\r
+// Constructor.\r
+function Label(id, caption, text) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, text);\r
+    }\r
+}\r
+\r
+// Label inherits from Control.\r
+Label.prototype = new Control(UI_NO_INIT_ID);\r
+\r
+// Content element for label text.\r
+Label.prototype.contentElement = null;\r
+\r
+// Initializer - called from constructor.\r
+Label.prototype.init = function(id, caption, text) {\r
+    uiLogger.debug("Label.init(" + id + ", " + caption + ", " + text + ")");\r
+    \r
+    // call superclass initializer\r
+    Control.prototype.init.call(this, id, caption);\r
+    \r
+    // create content element\r
+    this.contentElement = document.createElement("div");\r
+    this.controlElement.appendChild(this.contentElement);\r
+    \r
+    // set the text\r
+    this.setText(text);\r
+}\r
+\r
+// Returns the enabled state for the control.\r
+Label.prototype.isEnabled = function() {\r
+    return true;\r
+}\r
+\r
+// Returns the focusable state for the control.\r
+Label.prototype.isFocusable = function() {\r
+    return false;\r
+}\r
+\r
+// Returns the control text.\r
+Label.prototype.getText = function() {\r
+    return this.contentElement.innerHTML;\r
+}\r
+\r
+// Sets the text for the control.\r
+Label.prototype.setText = function(text) {\r
+    uiLogger.debug("Label.setText(" + text + ")");\r
+    this.contentElement.innerHTML = (text == null) ? "" : text;\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+Label.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("Label.updateStyleFromState()");\r
+    \r
+    // set element class names\r
+    this.setClassName(this.rootElement, "Control");\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssemblyNormal");\r
+    this.setClassName(this.captionElement, "ControlCaption ControlCaptionNormal");\r
+    this.setClassName(this.controlElement, "ControlElement");\r
+    this.setClassName(this.contentElement, "LabelText");\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/ListView.js b/wrt/misc/rss/WRTKit/UI/ListView.js
new file mode 100644 (file)
index 0000000..09b71db
--- /dev/null
@@ -0,0 +1,189 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The ListView class implements a vertical list view that hosts controls\r
+// as child components.\r
+\r
+// Constructor.\r
+function ListView(id, caption) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption);\r
+    }\r
+}\r
+\r
+// ListView inherits from View.\r
+ListView.prototype = new View(UI_NO_INIT_ID);\r
+\r
+// The caption of this view; null if none.\r
+ListView.prototype.caption = null;\r
+\r
+// The caption element of this view.\r
+ListView.prototype.captionElement = null;\r
+\r
+// The caption text element of this view.\r
+ListView.prototype.captionTextElement = null;\r
+\r
+// Root HTML element for controls.\r
+ListView.prototype.listElement = null;\r
+\r
+// List of controls in the view.\r
+ListView.prototype.controls = null;\r
+\r
+// Initializer for ListView.\r
+ListView.prototype.init = function(id, caption) {\r
+    uiLogger.debug("ListView.init(" + id + ", " + caption + ")");\r
+    \r
+    // call superclass initializer\r
+    View.prototype.init.call(this, id);\r
+    \r
+    // init control array\r
+    this.controls = [];\r
+    \r
+    // set style class name for root element\r
+    this.rootElement.className = "ListView";\r
+    \r
+    // create caption and caption text elements\r
+    this.captionElement = document.createElement("div");\r
+    this.captionElement.className = "ListViewCaption";\r
+    this.captionTextElement = document.createElement("div");\r
+    this.captionTextElement.className = "ListViewCaptionText";\r
+    this.captionElement.appendChild(this.captionTextElement);\r
+    this.rootElement.appendChild(this.captionElement);\r
+    \r
+    // create root element for controls and add to the view root element\r
+    this.listElement = document.createElement("div");\r
+    this.listElement.className = "ListViewControlList";\r
+    this.rootElement.appendChild(this.listElement);\r
+    \r
+    // set the caption\r
+    this.setCaption(caption);\r
+}\r
+\r
+// Returns the caption; null if none.\r
+ListView.prototype.getCaption = function() {\r
+    return this.caption;\r
+}\r
+\r
+// Sets the caption; null if none.\r
+ListView.prototype.setCaption = function(caption) {\r
+    uiLogger.debug("ListView.setCaption(" + caption + ")");\r
+    \r
+    // set the display style\r
+    this.captionElement.style.display = (caption == null) ? "none" : "block";\r
+    \r
+    // set the caption\r
+    this.caption = caption;\r
+    this.captionTextElement.innerHTML = (caption == null) ? "" : caption;\r
+}\r
+\r
+// Returns an array of controls in the view.\r
+ListView.prototype.getControls = function() {\r
+    return this.controls;\r
+}\r
+\r
+// Adds a control to the view.\r
+ListView.prototype.addControl = function(control) {\r
+    uiLogger.debug("ListView.addControl(" + control + ")");\r
+    \r
+    // add the control to the controls array and attach it to the list element\r
+    this.controls.push(control);\r
+    this.listElement.appendChild(control.rootElement);\r
+    control.view = this;\r
+}\r
+\r
+// Inserts a control to the view before the specified control.\r
+ListView.prototype.insertControl = function(control, beforeControl) {\r
+    uiLogger.debug("ListView.insertControl(" + control + ", " + beforeControl + ")");\r
+    \r
+    // iterate through current controls\r
+    for (var i = 0; i < this.controls.length; i++) {\r
+        // is this the control we should insert before?\r
+        if (this.controls[i] == beforeControl) {\r
+            // we found the control to insert before - insert here and connect to list element\r
+            this.controls.splice(i, 0, control);\r
+            this.listElement.insertBefore(control.rootElement, beforeControl.rootElement);\r
+            control.view = this;\r
+            return;\r
+        }\r
+    }\r
+    \r
+    // the control wasn't found so we'll add it last\r
+    this.addControl(control);\r
+}\r
+\r
+// Removes a control from the view.\r
+ListView.prototype.removeControl = function(control) {\r
+    uiLogger.debug("ListView.removeControl(" + control + ")");\r
+    \r
+    // iterate through current controls\r
+    for (var i = 0; i < this.controls.length; i++) {\r
+        // is this the control we should remove?\r
+        if (this.controls[i] == control) {\r
+            // we found the control to remove - remove it from the list element\r
+            this.controls.splice(i, 1);\r
+            this.listElement.removeChild(control.rootElement);\r
+            control.view = null;\r
+        }\r
+    }\r
+}\r
+\r
+// Attempts to focus the first focusable control.\r
+ListView.prototype.focusFirstControl = function() {\r
+    uiLogger.debug("ListView.focusFirstControl()");\r
+    for (var i = 0; i < this.controls.length; i++) {\r
+        // is this control focusable?\r
+        var control = this.controls[i];\r
+        if (control.isFocusable()) {\r
+            control.setFocused(true);\r
+            break;\r
+        }\r
+    }\r
+}\r
+\r
+// Attempts to reset all control focus states.\r
+// Override in subclasses as required.\r
+ListView.prototype.resetControlFocusStates = function() {\r
+    uiLogger.debug("ListView.resetControlFocusStates()");\r
+    for (var i = 0; i < this.controls.length; i++) {\r
+        this.controls[i].resetFocusState();\r
+    }\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/NavigationButton.js b/wrt/misc/rss/WRTKit/UI/NavigationButton.js
new file mode 100644 (file)
index 0000000..76c3659
--- /dev/null
@@ -0,0 +1,220 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The NavigationButton class implements a button control for use in\r
+// navigational contexts in menu-style UIs.\r
+\r
+// Constructor.\r
+function NavigationButton(id, image, text) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, image, text);\r
+    }\r
+}\r
+\r
+// NavigationButton inherits from ActionControl.\r
+NavigationButton.prototype = new ActionControl(UI_NO_INIT_ID);\r
+\r
+// Button table element.\r
+NavigationButton.prototype.tableElement = null;\r
+\r
+// Button table row element.\r
+NavigationButton.prototype.tableRowElement = null;\r
+\r
+// Button table left cell element.\r
+NavigationButton.prototype.tableLeftCellElement = null;\r
+\r
+// Button table right cell element.\r
+NavigationButton.prototype.tableRightCellElement = null;\r
+\r
+// Button image element.\r
+NavigationButton.prototype.imageElement = null;\r
+\r
+// Button link element.\r
+NavigationButton.prototype.linkElement = null;\r
+\r
+// Button text element.\r
+NavigationButton.prototype.textElement = null;\r
+\r
+// Initializer - called from constructor.\r
+NavigationButton.prototype.init = function(id, image, text) {\r
+    uiLogger.debug("NavigationButton.init(" + id + ", " + image + ", " + text + ")");\r
+    \r
+    // call superclass initializer\r
+    ActionControl.prototype.init.call(this, id, null);\r
+    \r
+    // remove caption element\r
+    this.assemblyElement.removeChild(this.captionElement);\r
+    \r
+    // construct the button\r
+    this.buttonElement = document.createElement("div");\r
+    this.tableElement = document.createElement("table");\r
+    this.tableRowElement = document.createElement("tr");\r
+    this.tableLeftCellElement = document.createElement("td");\r
+    this.tableRightCellElement = document.createElement("td");\r
+    this.imageElement = null;\r
+    this.linkElement = document.createElement("a");\r
+    this.linkElement.href = "JavaScript:void(0)";\r
+    this.textElement = document.createElement("span");\r
+    this.tableElement.appendChild(this.tableRowElement);\r
+    this.tableRowElement.appendChild(this.tableLeftCellElement);\r
+    this.tableRowElement.appendChild(this.tableRightCellElement);\r
+    this.tableRightCellElement.appendChild(this.linkElement);\r
+    this.linkElement.appendChild(this.textElement);\r
+    this.buttonElement.appendChild(this.tableElement);\r
+    this.controlElement.appendChild(this.buttonElement);\r
+    \r
+    // set the image and text\r
+    this.setImage(image);\r
+    this.setText(text);\r
+    \r
+    // bind event listeners\r
+    this.bindActionControlListeners();\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Sets the enabled state.\r
+NavigationButton.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("NavigationButton.setEnabled(" + enabled + ")");\r
+    \r
+    // bail out early if there is no change in state\r
+    if (this.enabled == enabled) {\r
+        return;\r
+    }\r
+    \r
+    // set the enabled state\r
+    this.enabled = enabled;\r
+    \r
+    if (this.enabled) {\r
+        // diabled -> enabled\r
+        this.tableRightCellElement.removeChild(this.textElement);\r
+        this.tableRightCellElement.appendChild(this.linkElement);\r
+        this.linkElement.appendChild(this.textElement);\r
+    } else {\r
+        // enabled -> diabled\r
+        this.linkElement.removeChild(this.textElement);\r
+        this.tableRightCellElement.removeChild(this.linkElement);\r
+        this.tableRightCellElement.appendChild(this.textElement);\r
+    }\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the button image (URL); null if none.\r
+NavigationButton.prototype.getImage = function() {\r
+    return (this.imageElement != null) ? this.imageElement.src : null;\r
+}\r
+\r
+// Sets the button image (URL); null if none.\r
+NavigationButton.prototype.setImage = function(image) {\r
+    uiLogger.debug("NavigationButton.setImage(" + image + ")");\r
+    \r
+    if (image == null) {\r
+        // remove image - if any\r
+        if (this.imageElement != null) {\r
+            this.tableLeftCellElement.removeChild(this.imageElement);\r
+        }\r
+    } else {\r
+        // default to not append image element\r
+        var append = false;\r
+        \r
+        // create image element if one doesn't exist\r
+        if (this.imageElement == null) {\r
+            this.imageElement = document.createElement("img");\r
+            this.imageElement.setAttribute("alt", "");\r
+            append = true;\r
+        }\r
+        \r
+        // set image source URL\r
+        this.imageElement.src = image;\r
+        \r
+        // append the image element to the left cell?\r
+        if (append) {\r
+            this.tableLeftCellElement.appendChild(this.imageElement);\r
+        }\r
+    }\r
+}\r
+\r
+// Returns the button text.\r
+NavigationButton.prototype.getText = function() {\r
+    return this.textElement.innerHTML;\r
+}\r
+\r
+// Sets the button text.\r
+NavigationButton.prototype.setText = function(text) {\r
+    uiLogger.debug("NavigationButton.setText(" + text + ")");\r
+    this.textElement.innerHTML = (text == null) ? "" : text;;\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+NavigationButton.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("NavigationButton.updateStyleFromState()");\r
+    \r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set root element class name\r
+    this.setClassName(this.rootElement, "Control");\r
+    \r
+    // set the control assembly class names\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);\r
+    \r
+    // control element\r
+    this.setClassName(this.controlElement, "ControlElement NavigationButtonControlElement");\r
+    \r
+    // set the button table class names\r
+    this.setClassName(this.buttonElement, "NavigationButton");\r
+    this.setClassName(this.tableElement, "NavigationButtonTable");\r
+    this.setClassName(this.tableRowElement, "NavigationButtonRow");\r
+    this.setClassName(this.tableLeftCellElement, "NavigationButtonImageCell");\r
+    this.setClassName(this.tableRightCellElement, "NavigationButtonTextCell");\r
+    \r
+    // set image class names\r
+    if (this.imageElement) {\r
+        this.setClassName(this.imageElement, "NavigationButtonImage");\r
+    }\r
+    \r
+    // set the button text class name\r
+    this.setClassName(this.textElement, "NavigationButtonText NavigationButtonText" + stateName);\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/NotificationPopup.js b/wrt/misc/rss/WRTKit/UI/NotificationPopup.js
new file mode 100644 (file)
index 0000000..b661797
--- /dev/null
@@ -0,0 +1,330 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The NotificationPopup class handles the display of notifications such as\r
+// warnings, information messages and progress indication.\r
+\r
+// Constructor.\r
+function NotificationPopup() {\r
+    // create notification popup\r
+    this.containerElement = document.createElement("div");\r
+    this.containerElement.className = "NotificationPopupContainer";\r
+    this.popupElement = document.createElement("div");\r
+    this.popupElement.className = "NotificationPopup";\r
+    this.typeIndicatorElement = document.createElement("div");\r
+    this.typeIndicatorElement.className = "NotificationPopupTypeIndicator";\r
+    this.textElement = document.createElement("div");\r
+    this.textElement.className = "NotificationPopupText";\r
+    this.progressBarElement = document.createElement("div");\r
+    this.progressBarElement.className = "NotificationPopupProgressBar";\r
+    \r
+    // assemble popup\r
+    this.popupElement.appendChild(this.typeIndicatorElement);\r
+    this.popupElement.appendChild(this.textElement);\r
+    this.popupElement.appendChild(this.progressBarElement);\r
+    this.containerElement.appendChild(this.popupElement);\r
+    \r
+    // create progress bar image element and initialize it\r
+    this.progressBarImageElement = document.createElement("img");\r
+    var self = this;\r
+    this.progressBarImageElement.addEventListener("load", function() { self.progressBarImageLoadingCompleted(); }, false);\r
+    this.progressBarImageElement.setAttribute("alt", "");\r
+    this.progressBarImageURL = this.getProgressBarImage(0);\r
+    this.progressBarImageElement.src = this.progressBarImageURL;\r
+    this.progressBarElement.appendChild(this.progressBarImageElement);\r
+    \r
+    // init the popup to be fully down\r
+    this.popupElement.style.top = "100%";\r
+    \r
+    // set default popup contents\r
+    this.setPopupContents(null, null, null);\r
+}\r
+\r
+// Notification container element.\r
+NotificationPopup.prototype.containerElement = null;\r
+\r
+// Notification popup element.\r
+NotificationPopup.prototype.popupElement = null;\r
+\r
+// Type indicator element.\r
+NotificationPopup.prototype.typeIndicatorElement = null;\r
+\r
+// Notification text element.\r
+NotificationPopup.prototype.textElement = null;\r
+\r
+// Progress bar element.\r
+NotificationPopup.prototype.progressBarElement = null;\r
+\r
+// Progress bar image element.\r
+NotificationPopup.prototype.progressBarImageElement = null;\r
+\r
+// Progress bar image URL.\r
+NotificationPopup.prototype.progressBarImageURL = null;\r
+\r
+// Has the progress bar image been loaded?\r
+NotificationPopup.prototype.progressBarImageLoaded = false;\r
+\r
+// Flag that tracks whether we're in the middle of starting to\r
+// show a notification popup.\r
+NotificationPopup.prototype.processingShowNotification = false;\r
+\r
+// Notification popup position (0 = hidden, 1 = showing).\r
+NotificationPopup.prototype.popupPosition = 0;\r
+\r
+// Interval for timer ticks (in milliseconds)\r
+NotificationPopup.prototype.ANIM_TIMER_INTERVAL = 25;\r
+\r
+// Animation timer identifier or null if no active timer.\r
+NotificationPopup.prototype.animTimerId = null;\r
+\r
+// Time in milliseconds for the popup animation to complete\r
+NotificationPopup.prototype.ANIM_TIME = 300;\r
+\r
+// Flag that determines the behavior of showNotification(). If set to true\r
+// the popup will snap open when showNotification() is called instead of\r
+// animation.\r
+NotificationPopup.prototype.SHOW_SNAPS_OPEN = true;\r
+\r
+// Animation direction (0 = no movement, -1 hiding, +1 = showing).\r
+NotificationPopup.prototype.animDir = 0;\r
+\r
+// Auto-hide timer identifier or null if no active timer.\r
+NotificationPopup.prototype.autoHideTimerId = null;\r
+\r
+// The commanded display time.\r
+NotificationPopup.prototype.displayTime = -1;\r
+\r
+// Displays a notification.\r
+NotificationPopup.prototype.showNotification = function(displayTime, type, text, progress) {\r
+    uiLogger.debug("NotificationPopup.showNotification(" + displayTime + ", " + type + ", " + text + ", " + progress + ")");\r
+    \r
+    // mark that showNotification() has been called and that we are in\r
+    // the middle of starting to show the notification popup\r
+    this.processingShowNotification = true;\r
+    \r
+    // remember the display time\r
+    this.displayTime = displayTime;\r
+    \r
+    // attach the popup to the document if not attached\r
+    if (this.containerElement.parentNode == null) {\r
+        document.body.appendChild(this.containerElement);\r
+        uiLogger.debug("Notification popup attached to document");\r
+    }\r
+    \r
+    // set popup contents and update style\r
+    this.setPopupContents(type, text, progress);\r
+    \r
+    // if the progress image is loaded then we can complete the showing\r
+    // of the notification popup immediately - otherwise the image loaded\r
+    // allback will complete the process.\r
+    if (this.progressBarImageLoaded) {\r
+        this.completeShowNotification();\r
+    }\r
+}\r
+\r
+// Completes displaying of a notification.\r
+// Note: Used internally - don't call this directly.\r
+NotificationPopup.prototype.completeShowNotification = function() {\r
+    uiLogger.debug("NotificationPopup.completeShowNotification()");\r
+    \r
+    // animation direction is +1 for showing the popup\r
+    if (this.popupPosition != 1) {\r
+        if (this.SHOW_SNAPS_OPEN) {\r
+            if (this.popupPosition == 0) {\r
+                this.popupPosition = 1;\r
+            }\r
+        }\r
+        this.animatePopup(1);\r
+    }\r
+    \r
+    // setup auto hiding if a display time is specified\r
+    if (this.displayTime > 0) {\r
+        // stop any existing timer\r
+        if (this.autoHideTimerId != null) {\r
+            clearTimeout(this.autoHideTimerId);\r
+            uiLogger.debug("Auto hide timer stopped");\r
+        }\r
+        // set timer to hide notification\r
+        var self = this;\r
+        this.autoHideTimerId = setTimeout(function() {\r
+                                              if (self.displayTime > 0) {\r
+                                                  self.hideNotification();\r
+                                              }\r
+                                          }, this.ANIM_TIME + this.displayTime);\r
+        uiLogger.debug("Auto hide timer started");\r
+    }\r
+    \r
+    // mark us as no longer processing a show notification call\r
+    this.processingShowNotification = false;\r
+}\r
+\r
+// Hides the currently displayed notification.\r
+NotificationPopup.prototype.hideNotification = function() {\r
+    uiLogger.debug("NotificationPopup.hideNotification()");\r
+    // mark us as no longer processing a show notification call\r
+    this.processingShowNotification = false;\r
+    \r
+    // animation direction is -1 for hiding the popup\r
+    if (this.popupPosition != 0) {\r
+        this.animatePopup(-1);\r
+    }\r
+    \r
+    // stop auto hide timer if one is set\r
+    if (this.autoHideTimerId != null) {\r
+        clearTimeout(this.autoHideTimerId);\r
+        this.autoHideTimerId = null;\r
+        uiLogger.debug("Auto hide timer stopped");\r
+    }\r
+}\r
+\r
+// Starts animation of the popup (1 to show, -1 to hide).\r
+NotificationPopup.prototype.animatePopup = function(direction) {\r
+    uiLogger.debug("NotificationPopup.animatePopup(" + direction + ")");\r
+    // set the direction and star the animation timer\r
+    this.animDir = direction;\r
+    if (this.animTimerId == null) {\r
+        var self = this;\r
+        this.animTimerId = setInterval(function() { self.animate(); }, this.ANIM_TIMER_INTERVAL);\r
+        uiLogger.debug("Notification popup animation started");\r
+    }\r
+}\r
+\r
+// Callback for animation timer.\r
+NotificationPopup.prototype.animate = function() {\r
+    // calculate new popup position and clamp\r
+    var animStep = (this.ANIM_TIMER_INTERVAL / this.ANIM_TIME) * this.animDir;\r
+    var newPos = this.popupPosition + animStep;\r
+    if (newPos < 0) {\r
+        newPos = 0;\r
+    } else if (newPos > 1) {\r
+        newPos = 1;\r
+    }\r
+    \r
+    // set the new position to the popup element\r
+    this.popupPosition = newPos;\r
+    this.popupElement.style.top = (100 - Math.round(this.popupPosition * 100)) + "%";\r
+    \r
+    // have we reached the end of the animation?\r
+    if (newPos == 0 || newPos == 1) {\r
+        // reset animation direction\r
+        this.animDir = 0;\r
+        \r
+        // remove the popup from the body if its hidden\r
+        if (newPos == 0) {\r
+            document.body.removeChild(this.containerElement);\r
+            uiLogger.debug("Notification popup detached from document");\r
+        }\r
+        \r
+        // stop timer\r
+        clearTimeout(this.animTimerId);\r
+        this.animTimerId = null;\r
+        uiLogger.debug("Notification popup animation stopped");\r
+    }\r
+}\r
+\r
+// Returns a URL for the progress bar image to use for the specified progress.\r
+NotificationPopup.prototype.getProgressBarImage = function(progress) {\r
+    // path for progress bar images\r
+    var progressBarImagePath = "WRTKit/Resources/";\r
+    \r
+    if (progress < 0) {\r
+        // unknown progress\r
+        return progressBarImagePath + "ProgressBarUnknown.gif";\r
+    } else {\r
+        // known progress (should be between 0 and 1)\r
+        var progPct = Math.round(progress * 10) * 10;\r
+        if (progPct < 0) {\r
+            progPct = 0;\r
+        } else if (progPct > 100) {\r
+            progPct = 100;\r
+        }\r
+        return progressBarImagePath + "ProgressBar" + progPct + ".png";\r
+    }\r
+}\r
+\r
+// Sets the contents of the popup.\r
+NotificationPopup.prototype.setPopupContents = function(type, text, progress) {\r
+    uiLogger.debug("NotificationPopup.setPopupContents(" + type + ", " + text + ", " + progress + ")");\r
+    \r
+    // figure out notification type style name\r
+    var typeName = (type == null) ? "none" : type.toLowerCase();\r
+    typeName = typeName.charAt(0).toUpperCase() + typeName.substring(1);\r
+    \r
+    // set type element class names\r
+    this.typeIndicatorElement.className = "NotificationPopupTypeIndicator NotificationPopupTypeIndicator" + typeName;\r
+    \r
+    // set notification text\r
+    this.textElement.innerHTML = (text == null) ? "" : text;\r
+    \r
+    // set progress\r
+    this.progressBarElement.style.display = (progress == null) ? "none" : "block";\r
+    if (progress != null) {\r
+        var imgURL = this.getProgressBarImage(progress);\r
+        if (imgURL != this.progressBarImageURL) {\r
+            // load new image\r
+            this.progressBarImageLoaded = false;\r
+            this.progressBarImageURL = imgURL;\r
+            this.progressBarImageElement.src = imgURL;\r
+        } else {\r
+            // the correct image is already loaded\r
+            this.progressBarImageLoaded = true;\r
+        }\r
+    } else {\r
+        // there is no progress bar so there is no need\r
+        // to load any progress bar image\r
+        this.progressBarImageLoaded = true;\r
+    }\r
+}\r
+\r
+// Callback for notifying the object that its progress bar image completed loading.\r
+NotificationPopup.prototype.progressBarImageLoadingCompleted = function() {\r
+    uiLogger.debug("NotificationPopup.progressBarImageLoadingCompleted()");\r
+    \r
+    // mark the progress bar image as loaded\r
+    this.progressBarImageLoaded = true;\r
+    \r
+    // complete the process of displaying the notification popup\r
+    // if it has been commanded but not yet completed\r
+    if (this.processingShowNotification) {\r
+        this.completeShowNotification();\r
+    }\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/Scrollbar.js b/wrt/misc/rss/WRTKit/UI/Scrollbar.js
new file mode 100644 (file)
index 0000000..54274a6
--- /dev/null
@@ -0,0 +1,173 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The Scrollbar class is an implementation of a user interface element that\r
+// indicates the current viewport position in a document.\r
+\r
+// Constructor.\r
+function Scrollbar(parentElement) {\r
+    uiLogger.debug("Scrollbar(" + parentElement + ")");\r
+    \r
+    // get the parent element\r
+    this.parentElement = parentElement;\r
+    \r
+    // create the root element\r
+    this.rootElement = document.createElement("div");\r
+    this.rootElement.className = "Scrollbar";\r
+    this.rootElement.style.visibility = "hidden";\r
+    \r
+    // create the scrollbar\r
+    // the scrollbar consists of a root element with six children\r
+    // (three track elements and three thumb elements)\r
+    \r
+    // track\r
+    this.trackTopElement = document.createElement("div");\r
+    this.trackTopElement.className = "ScrollbarTrackTop";\r
+    this.trackMiddleElement = document.createElement("div");\r
+    this.trackMiddleElement.className = "ScrollbarTrackMiddle";\r
+    this.trackBottomElement = document.createElement("div");\r
+    this.trackBottomElement.className = "ScrollbarTrackBottom";\r
+    \r
+    // thumb\r
+    this.thumbTopElement = document.createElement("div");\r
+    this.thumbTopElement.className = "ScrollbarThumbTop";\r
+    this.thumbMiddleElement = document.createElement("div");\r
+    this.thumbMiddleElement.className = "ScrollbarThumbMiddle";\r
+    this.thumbBottomElement = document.createElement("div");\r
+    this.thumbBottomElement.className = "ScrollbarThumbBottom";\r
+    \r
+    // assemble and attach the scrollbar\r
+    this.rootElement.appendChild(this.trackTopElement);\r
+    this.rootElement.appendChild(this.trackMiddleElement);\r
+    this.rootElement.appendChild(this.trackBottomElement);\r
+    this.rootElement.appendChild(this.thumbTopElement);\r
+    this.rootElement.appendChild(this.thumbMiddleElement);\r
+    this.rootElement.appendChild(this.thumbBottomElement);\r
+    this.parentElement.appendChild(this.rootElement);\r
+    \r
+    // bring the scrollbar up to date\r
+    this.update(0, 100, 100);\r
+}\r
+\r
+// Parent element for the scrollbar.\r
+Scrollbar.prototype.parentElement = null;\r
+\r
+// Root HTML element in the scrollbar.\r
+Scrollbar.prototype.rootElement = null;\r
+\r
+// Scrollbar track top element.\r
+Scrollbar.prototype.trackTopElement = null;\r
+\r
+// Scrollbar track middle element.\r
+Scrollbar.prototype.trackMiddleElement = null;\r
+\r
+// Scrollbar track bottom element.\r
+Scrollbar.prototype.trackBottomElement = null;\r
+\r
+// Scrollbar thumb top element.\r
+Scrollbar.prototype.thumbTopElement = null;\r
+\r
+// Scrollbar thumb middle element.\r
+Scrollbar.prototype.thumbMiddleElement = null;\r
+\r
+// Scrollbar thumb bottom element.\r
+Scrollbar.prototype.thumbBottomElement = null;\r
+\r
+// Is the scrollbar needed?\r
+Scrollbar.prototype.scrollbarNeeded = false;\r
+\r
+// Updates the scrollbar.\r
+Scrollbar.prototype.update = function(scrollY, viewportHeight, documentHeight) {\r
+    // figure out current heights\r
+    var scrollbarHeight = this.rootElement.clientHeight;\r
+    var trackTopHeight = this.trackTopElement.clientHeight;\r
+    var trackBottomHeight = this.trackBottomElement.clientHeight;\r
+    var thumbTopHeight = this.thumbTopElement.clientHeight;\r
+    var thumbBottomHeight = this.thumbBottomElement.clientHeight;\r
+    \r
+    // scrollable height is the larger of document and viewport heights\r
+    var scrollableHeight = documentHeight;\r
+    var scrollbarNeeded = true;\r
+    if (viewportHeight >= documentHeight) {\r
+        scrollableHeight = viewportHeight;\r
+        scrollbarNeeded = false;\r
+    }\r
+    \r
+    // show or hide scrollbar?\r
+    if (scrollbarNeeded != this.scrollbarNeeded) {\r
+        this.scrollbarNeeded = scrollbarNeeded;\r
+        this.rootElement.style.visibility = scrollbarNeeded ? "visible" : "hidden";\r
+    }\r
+    \r
+    // calculate thumb top position...\r
+    var thumbTopPct = scrollY / scrollableHeight;\r
+    var thumbTop = scrollbarHeight * thumbTopPct;\r
+    // ...and bottom position...\r
+    var thumbBottomPct = (scrollY + viewportHeight) / scrollableHeight;\r
+    var thumbBottom = scrollbarHeight * thumbBottomPct;\r
+    \r
+    // ...and thumb height\r
+    var thumbHeight = thumbBottom - thumbTop;\r
+    \r
+    // ensure that the thumb is not too small\r
+    var thumbMinHeight = thumbTopHeight + thumbBottomHeight;\r
+    if (thumbHeight < thumbMinHeight) {\r
+        var underflow = thumbMinHeight - thumbHeight;\r
+        // adjust thumb top pos assuming a shorter scrollbar track\r
+        var thumbMid = (scrollbarHeight - underflow) * ((thumbTopPct + thumbBottomPct) / 2) + (underflow / 2);\r
+        thumbTop = thumbMid - (thumbMinHeight / 2);\r
+        thumbBottom = thumbTop + thumbMinHeight;\r
+        thumbHeight = thumbBottom - thumbTop;\r
+    }\r
+    \r
+    // position and size track element (add 1 to the middle section height for rounding errors)\r
+    this.trackTopElement.style.top = "0px";\r
+    this.trackMiddleElement.style.top = Math.round(trackTopHeight) + "px";\r
+    this.trackMiddleElement.style.height = Math.round(scrollbarHeight - trackTopHeight - trackBottomHeight + 1) + "px";\r
+    this.trackBottomElement.style.top = Math.round(scrollbarHeight - trackTopHeight) + "px";\r
+    \r
+    // position and size thumb element (add 1 to the middle section height for rounding errors)\r
+    this.thumbTopElement.style.top = Math.round(thumbTop) + "px";\r
+    this.thumbMiddleElement.style.top = Math.round(thumbTop + thumbTopHeight) + "px";\r
+    this.thumbMiddleElement.style.height = Math.round(thumbHeight - thumbTopHeight - thumbBottomHeight + 1) + "px";\r
+    this.thumbBottomElement.style.top = Math.round(thumbBottom - thumbBottomHeight) + "px";\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/SelectionControl.js b/wrt/misc/rss/WRTKit/UI/SelectionControl.js
new file mode 100644 (file)
index 0000000..d5d9dce
--- /dev/null
@@ -0,0 +1,189 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The SelectionControl class is an abstract base class for controls that lets\r
+// the user select one or more options from a list of options. Don't use\r
+// SelectionControl directly.\r
+\r
+// Constructor.\r
+function SelectionControl(id, caption, options, multipleSelection, selected) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, options, multipleSelection, selected);\r
+    }\r
+}\r
+\r
+// SelectionControl inherits from Control.\r
+SelectionControl.prototype = new Control(UI_NO_INIT_ID);\r
+\r
+// List of options.\r
+SelectionControl.prototype.options = null;\r
+\r
+// The single selected option in single selection controls\r
+// or list of options in multi selection controls.\r
+SelectionControl.prototype.selected = null;\r
+\r
+// Single or multiple selection.\r
+SelectionControl.prototype.multipleSelection = false;\r
+\r
+// Initializer - called from constructor.\r
+SelectionControl.prototype.init = function(id, caption, options, multipleSelection, selected) {\r
+    uiLogger.debug("SelectionControl.init(" + id + ", " + caption + ", " + options + ", " + multipleSelection + ", " + selected + ")");\r
+    \r
+    // call superclass initializer\r
+    Control.prototype.init.call(this, id, caption);\r
+    \r
+    // set the multiple selection property\r
+    this.multipleSelection = multipleSelection;\r
+    \r
+    // init options and selected (makes copies of the original arrays)\r
+    this.options = (options != null) ? options.slice(0) : [];\r
+    if (multipleSelection) {\r
+        this.selected = (selected == null) ? [] : selected.slice(0);\r
+    } else {\r
+        this.selected = selected;\r
+    }\r
+    this.validateSelected();\r
+}\r
+\r
+// Returns true if the control is a multiple selection control; false if single.\r
+SelectionControl.prototype.isMultipleSelection = function() {\r
+    return this.multipleSelection;\r
+}\r
+\r
+// Returns true if the specified option is selected; false if not.\r
+SelectionControl.prototype.isSelected = function(option) {\r
+    if (this.multipleSelection) {\r
+        // multiple selection\r
+        // iterate through all selected options and look for the specified option\r
+        for (var i = 0; i < this.selected.length; i++) {\r
+            if (this.selected[i] == option) {\r
+                return true;\r
+            }\r
+        }\r
+        return false;\r
+    } else {\r
+        // single selection\r
+        return (this.selected == option);\r
+    }\r
+}\r
+\r
+// Returns the currently selected option in a single selection control or\r
+// an array of selected options in a multiple selection control. If there are\r
+// no selected options a single selection control returns null and a multiple\r
+// selection control returns an empty array.\r
+SelectionControl.prototype.getSelected = function() {\r
+    return this.multipleSelection ? this.selected.slice(0) : this.selected;\r
+}\r
+\r
+// Sets the currently selected options. Pass a single option in a single selection\r
+// control or an array of selected controls in a multiple selection control. To\r
+// deselect all options pass null in a single selection control and an empty array\r
+// in a multiple selection control.\r
+// Override in sublcasses to provide full implementation.\r
+SelectionControl.prototype.setSelected = function(selected) {\r
+    this.selected = this.multipleSelection ? selected.slice(0) : selected;\r
+    // make sure the selected option or options are legal\r
+    this.validateSelected();\r
+}\r
+\r
+// Ensures that the selected option or options exist among the options in this control.\r
+SelectionControl.prototype.validateSelected = function() {\r
+    if (this.multipleSelection) {\r
+        // multiple selection\r
+        // iterate through all selected options and ensure they exist among the options\r
+        for (var i = 0; i < this.selected.length; i++) {\r
+            // check that the selected option exists among the options\r
+            var found = false;\r
+            for (var j = 0; j < this.options.length; j++) {\r
+                if (this.options[j] == this.selected[i]) {\r
+                    // found - stop looking for this option\r
+                    found = true;\r
+                    break;\r
+                }\r
+            }\r
+            // not found - remove this selected element\r
+            if (!found) {\r
+                this.selected.splice(i, 1);\r
+                // since we removed an entry we must re-check this position\r
+                i--;\r
+            }\r
+        }\r
+    } else {\r
+        // single selection\r
+        if (this.selected != null) {\r
+            // check that the selected option exists among the options\r
+            for (var i = 0; i < this.options.length; i++) {\r
+                if (this.options[i] == this.selected) {\r
+                    // found - we're done\r
+                    return;\r
+                }\r
+            }\r
+            // not found - remove the selection\r
+            this.selected = null;\r
+        }\r
+    }\r
+}\r
+\r
+// Returns the options in the control as an array of option objects with\r
+// a value and text property.\r
+SelectionControl.prototype.getOptions = function() {\r
+    return this.options;\r
+}\r
+\r
+// Sets the options in the control.\r
+// Override in sublcasses to provide full implementation.\r
+SelectionControl.prototype.setOptions = function(options) {\r
+    this.options = options.slice(0);\r
+    // make sure the selected option or options are legal\r
+    this.validateSelected();\r
+}\r
+\r
+// Returns the option that has the specified value; null if none.\r
+SelectionControl.prototype.getOptionForValue = function(value) {\r
+    // iterate through all options and look for a match\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        if (this.options[i].value == value) {\r
+            return this.options[i];\r
+        }\r
+    }\r
+    return null;\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/SelectionList.js b/wrt/misc/rss/WRTKit/UI/SelectionList.js
new file mode 100644 (file)
index 0000000..36fc6e8
--- /dev/null
@@ -0,0 +1,355 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The SelectionList class implements a single or multi selection control\r
+// that lets users select one or more options from a list of options.\r
+\r
+// Constructor.\r
+function SelectionList(id, caption, options, multipleSelection, selected) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, options, multipleSelection, selected);\r
+    }\r
+}\r
+\r
+// SelectionList inherits from SelectionControl.\r
+SelectionList.prototype = new SelectionControl(UI_NO_INIT_ID);\r
+\r
+// Root element for options.\r
+SelectionList.prototype.optionListElement = null;\r
+\r
+// Array for tracking option elements.\r
+SelectionList.prototype.optionElements = null;\r
+\r
+// Tracking for currently focused option; null if none.\r
+SelectionList.prototype.focusedOption = null;\r
+\r
+// Enabled status.\r
+SelectionList.prototype.enabled = false;\r
+\r
+// Initializer - called from constructor.\r
+SelectionList.prototype.init = function(id, caption, options, multipleSelection, selected) {\r
+    uiLogger.debug("SelectionList.init(" + id + ", " + caption + ", " + options + ", " + multipleSelection + ", " + selected + ")");\r
+    \r
+    // call superclass initializer\r
+    SelectionControl.prototype.init.call(this, id, caption, options, multipleSelection, selected);\r
+    \r
+    // create option list element\r
+    this.optionListElement = document.createElement("div");\r
+    this.controlElement.appendChild(this.optionListElement);\r
+    \r
+    // the control defaults to enabled\r
+    this.enabled = true;\r
+    \r
+    // init option element arrays\r
+    this.optionElements = [];\r
+    \r
+    // update the option elements to match the options in this control\r
+    this.updateOptionElements();\r
+}\r
+\r
+// Returns the enabled state.\r
+SelectionList.prototype.isEnabled = function() {\r
+    return this.enabled;\r
+}\r
+\r
+// Sets the enabled state.\r
+SelectionList.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("SelectionList.setEnabled(" + enabled + ")");\r
+    // switch the state and update the the control\r
+    this.enabled = enabled;\r
+    this.updateOptionElements();\r
+}\r
+\r
+// Sets the focused state for the control.\r
+// Note: This may not always succeed.\r
+SelectionList.prototype.setFocused = function(focused) {\r
+    uiLogger.debug("SelectionList.setFocused(" + focused + ")");\r
+    if (this.enabled && this.optionElements.length > 0) {\r
+        if (focused) {\r
+            this.optionElements[0].link.focus();\r
+        } else {\r
+            this.optionElements[0].link.blur();\r
+        }\r
+    }\r
+}\r
+\r
+// Sets the currently selected options. Pass a single option in a single selection\r
+// control or an array of selected controls in a multiple selection control. To\r
+// deselect all options pass null in a single selection control and an empty array\r
+// in a multiple selection control.\r
+SelectionList.prototype.setSelected = function(selected) {\r
+    // call superclass setSelected()\r
+    SelectionControl.prototype.setSelected.call(this, selected);\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Sets the options in the control.\r
+SelectionList.prototype.setOptions = function(options) {\r
+    // call superclass setOptions()\r
+    SelectionControl.prototype.setOptions.call(this, options);\r
+    this.updateOptionElements();\r
+}\r
+\r
+// Updates the option elements for the control element.\r
+SelectionList.prototype.updateOptionElements = function() {\r
+    uiLogger.debug("SelectionControl.updateOptionElements()");\r
+    \r
+    // start by removing all current options from the option list element\r
+    while (this.optionListElement.firstChild != null) {\r
+        this.optionListElement.removeChild(this.optionListElement.firstChild);\r
+    }\r
+    \r
+    // iterate through the options and add (and possibly create) a\r
+    // properly configured option element for each option\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        // get the option and option element we're working on\r
+        var option = this.options[i];\r
+        \r
+        // option, link and text elements for this option\r
+        var optionElement;\r
+        var optionLinkElement;\r
+        var optionTextElement;\r
+        \r
+        // get the elements\r
+        if (i == this.optionElements.length) {\r
+            // we need to create a new option element...\r
+            optionElement = document.createElement("div");\r
+            \r
+            // ...and a new option link element...\r
+            optionLinkElement = document.createElement("a");\r
+            optionLinkElement.href = "JavaScript:void(0)";\r
+            \r
+            // ...and a new option text element\r
+            optionTextElement = document.createElement("span");\r
+            \r
+            // hook up event listeners to the element\r
+            var self = this;\r
+            optionLinkElement.addEventListener("focus", function(event) { self.optionFocusStateChanged(event, true); }, false);\r
+            optionLinkElement.addEventListener("blur", function(event) { self.optionFocusStateChanged(event, false); }, false);\r
+            optionElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);\r
+            optionElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);\r
+            optionElement.addEventListener("mousedown", function(event) {\r
+                                                               self.optionClicked(event)\r
+                                                               event.stopPropagation();\r
+                                                               event.preventDefault();\r
+                                                        }, true);\r
+            optionElement.addEventListener("keydown", function(event) {\r
+                                                            // center and enter trigger the action\r
+                                                            if (event.keyCode == 0 || event.keyCode == 13) {\r
+                                                                self.optionClicked(event)\r
+                                                                event.stopPropagation();\r
+                                                                event.preventDefault();\r
+                                                            }\r
+                                                      }, true);\r
+            \r
+            // add the elements to the option element array\r
+            this.optionElements.push({ option: optionElement, link: optionLinkElement, text: optionTextElement });\r
+        } else {\r
+            // we already have ready elements so we'll reuse them\r
+            optionElement = this.optionElements[i].option;\r
+            optionLinkElement = this.optionElements[i].link;\r
+            optionTextElement = this.optionElements[i].text;\r
+            \r
+            // remove the option link element from its current parent - if any\r
+            if (optionLinkElement.parentNode != null) {\r
+                optionLinkElement.parentNode.removeChild(optionLinkElement);\r
+            }\r
+            \r
+            // remove the option text element from its current parent - if any\r
+            if (optionTextElement.parentNode != null) {\r
+                optionTextElement.parentNode.removeChild(optionTextElement);\r
+            }\r
+        }\r
+        \r
+        // set the option text\r
+        optionTextElement.innerHTML = option.text;\r
+        \r
+        // hook up the option to the control\r
+        if (this.enabled) {\r
+            // add the option link element to the option element\r
+            optionElement.appendChild(optionLinkElement);\r
+            // add the text element to the option element\r
+            optionLinkElement.appendChild(optionTextElement);\r
+        } else {\r
+            // add the text element directly to the control element\r
+            optionElement.appendChild(optionTextElement);\r
+        }\r
+        // add the option element to the option list element\r
+        this.optionListElement.appendChild(optionElement);\r
+    }\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Callback for focus state change events.\r
+SelectionList.prototype.optionFocusStateChanged = function(event, focused) {\r
+    uiLogger.debug("SelectionControl.optionFocusStateChanged()");\r
+    \r
+    // get the event source option\r
+    var option = null;\r
+    var optionElement = null;\r
+    for (var i = 0; i < this.optionElements.length; i++) {\r
+        optionElement = this.optionElements[i];\r
+        if (optionElement.link == event.currentTarget) {\r
+            option = this.options[i];\r
+            break;\r
+        }\r
+    }\r
+    \r
+    // remember the focused option; or null if none is focused\r
+    if (focused) {\r
+        this.focusedOption = option;\r
+    } else {\r
+        this.focusedOption = null;\r
+    }\r
+    \r
+    // call the superclass focus state change handler\r
+    this.focusStateChanged(focused);\r
+}\r
+\r
+// Callback for clicks.\r
+SelectionList.prototype.optionClicked = function(event) {\r
+    uiLogger.debug("SelectionControl.optionClicked()");\r
+    \r
+    // bail out if we're not enabled\r
+    if (!this.enabled) {\r
+        return false;\r
+    }\r
+    \r
+    // get the changed option\r
+    var option = null;\r
+    var optionElement = null;\r
+    for (var i = 0; i < this.optionElements.length; i++) {\r
+        optionElement = this.optionElements[i];\r
+        if (optionElement.option == event.currentTarget) {\r
+            option = this.options[i];\r
+            break;\r
+        }\r
+    }\r
+    \r
+    // make sure the option is focused\r
+    optionElement.link.focus();\r
+    \r
+    // toggle the selection\r
+    if (this.multipleSelection) {\r
+        // iterate through the selected options and see if this\r
+        // option is selected. if not then add it to the selection.\r
+        // if it already is selected then them remove it.\r
+        var found = false;\r
+        for (var i = 0; i < this.selected.length; i++) {\r
+            if (this.selected[i] == option) {\r
+                // remove from selected set\r
+                found = true;\r
+                this.selected.splice(i, 1);\r
+                break;\r
+            }\r
+        }\r
+        if (!found) {\r
+            // add to the selected set\r
+            this.selected.push(option);\r
+        }\r
+    } else {\r
+        // update the selected option\r
+        this.selected = option;\r
+    }\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+    \r
+    // notify event listeners\r
+    this.fireEvent(this.createEvent("SelectionChanged", this.getSelected()));\r
+}\r
+\r
+// Resets the state tracking for focus and hover.\r
+// Override this in subclasses as required to implement the state reset.\r
+SelectionList.prototype.resetFocusState = function() {\r
+    uiLogger.debug("SelectionList.resetFocusState()");\r
+    this.hovering = false;\r
+    this.focused = false;\r
+    this.focusedOption = null;\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+SelectionList.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("SelectionList.updateStyleFromState()");\r
+    \r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set element class names\r
+    this.setClassName(this.rootElement, "Control");\r
+    this.setClassName(this.controlElement, "ControlElement");\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);\r
+    this.setClassName(this.captionElement, "ControlCaption ControlCaption" + stateName);\r
+    \r
+    // set option list and option class names\r
+    this.setClassName(this.optionListElement, "SelectionList SelectionList" + stateName);\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        var option = this.options[i];\r
+        \r
+        // get the option and option text elements for this option\r
+        var optionElement = this.optionElements[i].option;\r
+        var optionTextElement = this.optionElements[i].text;\r
+        \r
+        // figure out the option state\r
+        var optionStateName = this.isSelected(option) ? "Checked" : "Unchecked";\r
+        if (!this.enabled) {\r
+            optionStateName += "Disabled";\r
+        } else if (this.focusedOption == option) {\r
+            optionStateName += "Focus";\r
+        } else {\r
+            optionStateName += "Normal";\r
+        }\r
+        \r
+        // set option element class names\r
+        if (this.multipleSelection) {\r
+            this.setClassName(optionElement, "SelectionListOptionMulti SelectionListOptionMulti" + optionStateName);\r
+        } else {\r
+            this.setClassName(optionElement, "SelectionListOptionSingle SelectionListOptionSingle" + optionStateName);\r
+        }\r
+        \r
+        // set option text class names\r
+        this.setClassName(optionTextElement, "SelectionListOptionText SelectionListOptionText" + stateName);\r
+    }\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/SelectionMenu.js b/wrt/misc/rss/WRTKit/UI/SelectionMenu.js
new file mode 100644 (file)
index 0000000..791f78e
--- /dev/null
@@ -0,0 +1,204 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The SelectionMenu class implements a single or multi selection control\r
+// that lets users select one or more options from a menu.\r
+\r
+// Constructor.\r
+function SelectionMenu(id, caption, options, multipleSelection, selected) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, options, multipleSelection, selected);\r
+    }\r
+}\r
+\r
+// SelectionMenu inherits from SelectionControl.\r
+SelectionMenu.prototype = new SelectionControl(UI_NO_INIT_ID);\r
+\r
+// Reference to the peer HTML element.\r
+SelectionControl.prototype.peerElement = null;\r
+\r
+// Array for tracking option elements.\r
+SelectionMenu.prototype.optionElements = null;\r
+\r
+// Initializer - called from constructor.\r
+SelectionMenu.prototype.init = function(id, caption, options, multipleSelection, selected) {\r
+    uiLogger.debug("SelectionMenu.init(" + id + ", " + caption + ", " + options + ", " + multipleSelection + ", " + selected + ")");\r
+    \r
+    // call superclass initializer\r
+    SelectionControl.prototype.init.call(this, id, caption, options, multipleSelection, selected);\r
+    \r
+    // create the control\r
+    this.peerElement = document.createElement("select");\r
+    this.peerElement.multiple = multipleSelection;\r
+    this.controlElement.appendChild(this.peerElement);\r
+    \r
+    // init option elements array\r
+    this.optionElements = [];\r
+    \r
+    // update the option elements to match the options in this control\r
+    this.updateOptionElements();\r
+    \r
+    // bind event listeners\r
+    var self = this;\r
+    this.peerElement.addEventListener("focus", function() { self.focusStateChanged(true); }, false);\r
+    this.peerElement.addEventListener("blur", function() { self.focusStateChanged(false); }, false);\r
+    this.peerElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);\r
+    this.peerElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);\r
+    this.peerElement.addEventListener("change", function() { self.selectionChanged(); }, false);\r
+}\r
+\r
+// Returns the enabled state.\r
+SelectionMenu.prototype.isEnabled = function() {\r
+    return !this.peerElement.disabled;\r
+}\r
+\r
+// Sets the enabled state.\r
+SelectionMenu.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("SelectionMenu.setEnabled(" + enabled + ")");\r
+    this.peerElement.disabled = !enabled;\r
+}\r
+\r
+// Sets the focused state for the control.\r
+// Note: This may not always succeed.\r
+SelectionMenu.prototype.setFocused = function(focused) {\r
+    uiLogger.debug("SelectionMenu.setFocused(" + focused + ")");\r
+    if (focused) {\r
+        this.peerElement.focus();\r
+    } else {\r
+        this.peerElement.blur();\r
+    }\r
+}\r
+\r
+// Sets the currently selected options. Pass a single option in a single selection\r
+// control or an array of selected controls in a multiple selection control. To\r
+// deselect all options pass null in a single selection control and an empty array\r
+// in a multiple selection control.\r
+SelectionMenu.prototype.setSelected = function(selected) {\r
+    // call superclass setSelected()\r
+    SelectionControl.prototype.setSelected.call(this, selected);\r
+    \r
+    // iterate through the options and set the selected state\r
+    // on the corresponding option element\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        this.optionElements[i].selected = this.isSelected(this.options[i]);\r
+    }\r
+}\r
+\r
+// Sets the options in the control.\r
+SelectionMenu.prototype.setOptions = function(options) {\r
+    // call superclass setOptions()\r
+    SelectionControl.prototype.setOptions.call(this, options);\r
+    this.updateOptionElements();\r
+}\r
+\r
+// Updates the option elements for the peer select element.\r
+SelectionMenu.prototype.updateOptionElements = function() {\r
+    // start by removing all current options from the select element\r
+    while (this.peerElement.firstChild != null) {\r
+        this.peerElement.removeChild(this.peerElement.firstChild);\r
+    }\r
+    \r
+    // iterate through the options and add (and possibly create) a\r
+    // properly configured option element for each option\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        // do we need to create a new option element?\r
+        if (i == this.optionElements.length) {\r
+            this.optionElements.push(document.createElement("option"));\r
+        }\r
+        \r
+        // get the option and option element we're working on\r
+        var option = this.options[i];\r
+        var optionElement = this.optionElements[i];\r
+        \r
+        // set the state for this option element and add it to the\r
+        // peer select element\r
+        optionElement.text = option.text;\r
+        optionElement.selected = this.isSelected(option);\r
+        this.peerElement.appendChild(optionElement);\r
+    }\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();    \r
+}\r
+\r
+// Callback for selection change events.\r
+SelectionMenu.prototype.selectionChanged = function() {\r
+    uiLogger.debug("SelectionControl.selectionChanged()");\r
+    \r
+    // update the selected options array or reference\r
+    this.selected = (this.multipleSelection) ? [] : null;\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        if (this.optionElements[i].selected) {\r
+            if (this.multipleSelection) {\r
+                this.selected.push(this.options[i]);\r
+            } else {\r
+                this.selected = this.options[i];\r
+                break;\r
+            }\r
+        }\r
+    }\r
+    \r
+    // notify event listeners\r
+    this.fireEvent(this.createEvent("SelectionChanged", this.getSelected()));\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+SelectionMenu.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("SelectionMenu.updateStyleFromState()");\r
+    \r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set element class names\r
+    this.setClassName(this.rootElement, "Control");\r
+    this.setClassName(this.controlElement, "ControlElement");\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);\r
+    this.setClassName(this.captionElement, "ControlCaption ControlCaption" + stateName);\r
+    \r
+    // set select and option element class names\r
+    var peerStateName = this.isEnabled() ? stateName : "Disabled";\r
+    this.setClassName(this.peerElement, "SelectionMenu SelectionMenu" + peerStateName);\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        var option = this.optionElements[i];\r
+        this.setClassName(option, "SelectionMenuOption SelectionMenuOption" + peerStateName);\r
+    }\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/Separator.js b/wrt/misc/rss/WRTKit/UI/Separator.js
new file mode 100644 (file)
index 0000000..b320899
--- /dev/null
@@ -0,0 +1,119 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The Separator class is used to provide a visual separator in a list.\r
+\r
+// Constructor.\r
+function Separator(id) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id);\r
+    }\r
+}\r
+\r
+// Separator inherits from Control.\r
+Separator.prototype = new Control(UI_NO_INIT_ID);\r
+\r
+// Reference to the separator element.\r
+Separator.prototype.separatorElement = null;\r
+\r
+// Separator row element.\r
+Separator.prototype.tableRowElement = null;\r
+\r
+// Left cell element.\r
+Separator.prototype.tableLeftCellElement = null;\r
+\r
+// Center cell element.\r
+Separator.prototype.tableCenterCellElement = null;\r
+\r
+// Right cell element.\r
+Separator.prototype.tableRightCellElement = null;\r
+\r
+// Initializer - called from constructor.\r
+Separator.prototype.init = function(id) {\r
+    uiLogger.debug("Separator.init(" + id + ")");\r
+    \r
+    // call superclass initializer\r
+    Control.prototype.init.call(this, id, null);\r
+    \r
+    // remove caption and control elements\r
+    this.assemblyElement.removeChild(this.captionElement);\r
+    this.assemblyElement.removeChild(this.controlElement);\r
+    \r
+    // create separator\r
+    this.separatorElement = document.createElement("table");\r
+    this.tableRowElement = document.createElement("tr");\r
+    this.tableLeftCellElement = document.createElement("td");\r
+    this.tableCenterCellElement = document.createElement("td");\r
+    this.tableRightCellElement = document.createElement("td");\r
+    this.tableRowElement.appendChild(this.tableLeftCellElement);\r
+    this.tableRowElement.appendChild(this.tableCenterCellElement);\r
+    this.tableRowElement.appendChild(this.tableRightCellElement);\r
+    this.separatorElement.appendChild(this.tableRowElement);\r
+    this.assemblyElement.appendChild(this.separatorElement);\r
+    \r
+    // update style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the enabled state for the control.\r
+Separator.prototype.isEnabled = function() {\r
+    return true;\r
+}\r
+\r
+// Returns the focusable state for the control.\r
+Separator.prototype.isFocusable = function() {\r
+    return false;\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+Separator.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("Separator.updateStyleFromState()");\r
+    \r
+    // set element class names\r
+    this.setClassName(this.rootElement, "Control");\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssemblyNormal");\r
+    this.setClassName(this.separatorElement, "Separator");\r
+    this.setClassName(this.tableRowElement, "SeparatorRow");\r
+    this.setClassName(this.tableLeftCellElement, "SeparatorLeftCell");\r
+    this.setClassName(this.tableCenterCellElement, "SeparatorCenterCell");\r
+    this.setClassName(this.tableRightCellElement, "SeparatorRightCell");\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/TextArea.js b/wrt/misc/rss/WRTKit/UI/TextArea.js
new file mode 100644 (file)
index 0000000..cc73b7d
--- /dev/null
@@ -0,0 +1,96 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The TextArea class implements a multi line text entry control.\r
+\r
+// Constructor.\r
+function TextArea(id, caption, value, rows) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, value, rows);\r
+    }\r
+}\r
+\r
+// TextArea inherits from TextEntryControl.\r
+TextArea.prototype = new TextEntryControl(UI_NO_INIT_ID);\r
+\r
+// Initializer - called from constructor.\r
+TextArea.prototype.init = function(id, caption, value, rows) {\r
+    uiLogger.debug("TextArea.init(" + id + ", " + caption + ", " + value + ", " + rows + ")");\r
+    \r
+    // call superclass initializer\r
+    TextEntryControl.prototype.init.call(this, id, caption);\r
+    \r
+    // create the peer element\r
+    this.peerElement = document.createElement("textarea");\r
+    // default rowcount is 3 if not defined\r
+    // width always comes from style but is a required attribute\r
+    this.peerElement.rows = (rows != null) ? rows : 3;\r
+    this.peerElement.cols = 20;\r
+    this.controlElement.appendChild(this.peerElement);\r
+    \r
+    // set the value\r
+    this.peerElement.value = (value == null) ? "" : value;\r
+    \r
+    // bind event listeners\r
+    this.bindTextEntryControlListeners();\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+TextArea.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("TextArea.updateStyleFromState()");\r
+    \r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set element class names\r
+    this.setClassName(this.rootElement, "Control");\r
+    this.setClassName(this.controlElement, "ControlElement");\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);\r
+    this.setClassName(this.captionElement, "ControlCaption ControlCaption" + stateName);\r
+    \r
+    // set peer element class names\r
+    var peerStateName = this.isEnabled() ? stateName : "Disabled";\r
+    this.setClassName(this.peerElement, "TextArea TextArea" + stateName);\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/TextEntryControl.js b/wrt/misc/rss/WRTKit/UI/TextEntryControl.js
new file mode 100644 (file)
index 0000000..25d69bb
--- /dev/null
@@ -0,0 +1,125 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The TextEntryControl class is an abstract base class for the single and multi-\r
+// line text entry controls TextField and TextArea. Don't use TextEntryControl\r
+// directly.\r
+\r
+// Constructor.\r
+function TextEntryControl(id, caption) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption);\r
+    }\r
+}\r
+\r
+// TextEntryControl inherits from Control.\r
+TextEntryControl.prototype = new Control(UI_NO_INIT_ID);\r
+\r
+// Reference to the peer HTML element.\r
+TextEntryControl.prototype.peerElement = null;\r
+\r
+// Initializer - called from constructor.\r
+TextEntryControl.prototype.init = function(id, caption) {\r
+    uiLogger.debug("TextEntryControl.init(" + id + ", " + caption + ")");\r
+    \r
+    // call superclass initializer\r
+    Control.prototype.init.call(this, id, caption);\r
+}\r
+\r
+// Common event listeners hookup function called from subclasses.\r
+TextEntryControl.prototype.bindTextEntryControlListeners = function() {\r
+    var self = this;\r
+    this.peerElement.addEventListener("focus", function() { self.focusStateChanged(true); }, false);\r
+    this.peerElement.addEventListener("blur", function() { self.focusStateChanged(false); }, false);\r
+    this.peerElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);\r
+    this.peerElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);\r
+    this.peerElement.addEventListener("change", function() { self.valueChanged(); }, false);\r
+}\r
+\r
+// Returns the enabled state.\r
+// Override this in subclasses as required to implement the state change.\r
+TextEntryControl.prototype.isEnabled = function() {\r
+    return !this.peerElement.readOnly;\r
+}\r
+\r
+// Sets the enabled state.\r
+// Override this in subclasses as required to implement the state change.\r
+TextEntryControl.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("TextEntryControl.setEnabled(" + enabled + ")");\r
+    this.peerElement.readOnly = !enabled;\r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the control text.\r
+TextEntryControl.prototype.getText = function() {\r
+    return this.peerElement.value;\r
+}\r
+\r
+// Sets the text for the control.\r
+TextEntryControl.prototype.setText = function(text) {\r
+    this.peerElement.value = text;\r
+}\r
+\r
+// Returns the focusable state for the control.\r
+TextEntryControl.prototype.isFocusable = function() {\r
+    // text entry controls are always focusable\r
+    return true;\r
+}\r
+\r
+// Sets the focused state for the control.\r
+// Note: This may not always succeed.\r
+TextEntryControl.prototype.setFocused = function(focused) {\r
+    uiLogger.debug("TextEntryControl.setFocused(" + focused + ")");\r
+    if (focused) {\r
+        this.peerElement.focus();\r
+    } else {\r
+        this.peerElement.blur();\r
+    }\r
+}\r
+\r
+// Callback for value change events.\r
+TextEntryControl.prototype.valueChanged = function() {\r
+    uiLogger.debug("TextEntryControl.valueChanged()");\r
+    // notify event listeners\r
+    this.fireEvent(this.createEvent("ValueChanged", this.peerElement.value));\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/TextField.js b/wrt/misc/rss/WRTKit/UI/TextField.js
new file mode 100644 (file)
index 0000000..f87c02b
--- /dev/null
@@ -0,0 +1,93 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The TextField class implements a single line text entry control.\r
+\r
+// Constructor.\r
+function TextField(id, caption, value, masked) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, value, masked);\r
+    }\r
+}\r
+\r
+// TextField inherits from TextEntryControl.\r
+TextField.prototype = new TextEntryControl(UI_NO_INIT_ID);\r
+\r
+// Initializer - called from constructor.\r
+TextField.prototype.init = function(id, caption, value, masked) {\r
+    uiLogger.debug("TextField.init(" + id + ", " + caption + ", " + value + ", " + masked + ")");\r
+    \r
+    // call superclass initializer\r
+    TextEntryControl.prototype.init.call(this, id, caption);\r
+    \r
+    // create the peer element\r
+    this.peerElement = document.createElement("input");\r
+    this.peerElement.type = masked ? "password" : "text";\r
+    this.controlElement.appendChild(this.peerElement);\r
+    \r
+    // set the value\r
+    this.peerElement.value = (value == null) ? "" : value;\r
+    \r
+    // bind event listeners\r
+    this.bindTextEntryControlListeners();\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+TextField.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("TextField.updateStyleFromState()");\r
+    \r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set element class names\r
+    this.setClassName(this.rootElement, "Control");\r
+    this.setClassName(this.controlElement, "ControlElement");\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);\r
+    this.setClassName(this.captionElement, "ControlCaption ControlCaption" + stateName);\r
+    \r
+    // set peer element class names\r
+    var peerStateName = this.isEnabled() ? stateName : "Disabled";\r
+    this.setClassName(this.peerElement, "TextField TextField" + peerStateName);\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/UIElement.js b/wrt/misc/rss/WRTKit/UI/UIElement.js
new file mode 100644 (file)
index 0000000..c6d77b8
--- /dev/null
@@ -0,0 +1,114 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The UIElement class is the base class for all user interface elements.\r
+\r
+// Constructor.\r
+function UIElement(id) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id);\r
+    }\r
+}\r
+\r
+// UI element identifier.\r
+UIElement.prototype.id = null;\r
+\r
+// Root HTML element in the UI element.\r
+UIElement.prototype.rootElement = null;\r
+\r
+// Initializer for UIElement.\r
+UIElement.prototype.init = function(id) {\r
+    uiLogger.debug("UIElement.init(" + id + ")");\r
+    \r
+    // copy identifier\r
+    this.id = id;\r
+    \r
+    // init event listener array\r
+    this.eventListeners = [];\r
+    \r
+    // create the root element\r
+    this.rootElement = document.createElement("div");\r
+    if (id != null) {\r
+        this.rootElement.id = id;\r
+    }\r
+}\r
+\r
+// Returns an array containing the current event listeners.\r
+UIElement.prototype.getEventListeners = function() {\r
+    return this.eventListeners;\r
+}\r
+\r
+// Adds an event listener.\r
+UIElement.prototype.addEventListener = function(eventType, listener) {\r
+    var listenerDef = { type: eventType, listener: listener };\r
+    this.eventListeners.push(listenerDef);\r
+}\r
+\r
+// Removes an event listener.\r
+UIElement.prototype.removeEventListener = function(eventType, listener) {\r
+    // iterate through current listeners and remove the specified\r
+    // listener when its found\r
+    for (var i = 0; i < this.eventListeners.length; i++) {\r
+        var listenerDef = this.eventListeners[i];\r
+        if ((listenerDef.type == eventType) &&\r
+                (listenerDef.listener == listener)) {\r
+            this.eventListeners.splice(i, 1);\r
+            return;\r
+        }\r
+    }\r
+}\r
+\r
+// Factory method for an event object where this object is the source object.\r
+UIElement.prototype.createEvent = function(type, value) {\r
+    return { source: this, type: type, value: value };\r
+}\r
+\r
+// Fires an event to all listeners.\r
+UIElement.prototype.fireEvent = function(event) {\r
+    // iterate through all event listeners and notify them of the event\r
+    for (var i = 0; i < this.eventListeners.length; i++) {\r
+        var listenerDef = this.eventListeners[i];\r
+        if (listenerDef.type == null || listenerDef.type == event.type) {\r
+            listenerDef.listener.call(this, event);\r
+        }\r
+    }\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/UIInit.js b/wrt/misc/rss/WRTKit/UI/UIInit.js
new file mode 100644 (file)
index 0000000..02766f3
--- /dev/null
@@ -0,0 +1,49 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The UIInit script is included before the rest of the UI scripts to setup\r
+// any resources needed by the UI toolkit.\r
+\r
+// Create UI logger.\r
+var uiLogger = new Logger();\r
+uiLogger.level = uiLogger.LOG_LEVEL_OFF;\r
+uiLogger.filter = ["QECR"];\r
diff --git a/wrt/misc/rss/WRTKit/UI/UIManager.js b/wrt/misc/rss/WRTKit/UI/UIManager.js
new file mode 100644 (file)
index 0000000..c6c6cb9
--- /dev/null
@@ -0,0 +1,240 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (ÒNokiaÓ) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under NokiaÕs copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The UI manager manages a set of views and other user interface elements.\r
+\r
+// Constructor.\r
+function UIManager(viewParentElement, scrollbarParentElement, enableScrollBar, delayInit) {    \r
+    uiLogger.debug("UIManager(" + viewParentElement + ", " + scrollbarParentElement + ")");\r
+    if (delayInit == null) {\r
+        this.init(viewParentElement, enableScrollBar, scrollbarParentElement);\r
+    }\r
+}\r
+\r
+// Parent element for views.\r
+UIManager.prototype.viewParentElement = null;\r
+\r
+// Parent element for scrollbar.\r
+UIManager.prototype.scrollbarParentElement = null;\r
+\r
+// The currently displayed view.\r
+UIManager.prototype.currentView = null;\r
+\r
+// Reference to the scrollbar.\r
+UIManager.prototype.scrollbar = null;\r
+\r
+// Current scroll Y position.\r
+UIManager.prototype.scrollY = -1;\r
+\r
+// Current viewport height.\r
+UIManager.prototype.viewportHeight = -1;\r
+\r
+// Current document height.\r
+UIManager.prototype.documentHeight = -1;\r
+\r
+// Timer identifier or null if no active timer.\r
+UIManager.prototype.timerId = null;\r
+\r
+// Interval for timer ticks for the UI manager timer (in milliseconds)\r
+UIManager.prototype.TIMER_INTERVAL = 250;\r
+\r
+// Reference to the notification popup used to displays notifications.\r
+UIManager.prototype.notificationPopup = null;\r
+\r
+// is scrollbar enabled\r
+UIManager.prototype.enableScrollBar = null;\r
+\r
+// init function\r
+UIManager.prototype.init = function(viewParentElement, enableScrollBar, scrollbarParentElement) {\r
+    this.enableScrollBar = enableScrollBar;\r
+    \r
+    // parent element for views\r
+    if (viewParentElement == null) {\r
+        // create a parent for views\r
+        this.viewParentElement = document.createElement("div");\r
+        this.viewParentElement.className = "ViewContainer";\r
+        document.body.appendChild(this.viewParentElement);\r
+    }\r
+    else {\r
+        this.viewParentElement = viewParentElement;\r
+    }\r
+    \r
+    // parent element for scrollbar\r
+    if (enableScrollBar) {\r
+        if (scrollbarParentElement == null) {\r
+            // create a parent for the scrollbar\r
+            this.scrollbarParentElement = document.createElement("div");\r
+            this.scrollbarParentElement.className = "DocumentScrollbarContainer";\r
+            document.body.appendChild(this.scrollbarParentElement);\r
+        }\r
+        else {\r
+            this.scrollbarParentElement = scrollbarParentElement;\r
+        }\r
+    }\r
+    \r
+    // currently selected view\r
+    this.currentView = null;\r
+    \r
+    // create the notification popup\r
+    // the notification popup adds itself as a child element to the document body\r
+    this.notificationPopup = new NotificationPopup();\r
+    \r
+    // create scrollbar\r
+    if (enableScrollBar) {\r
+        this.scrollbar = new Scrollbar(this.scrollbarParentElement);\r
+    }\r
+    \r
+    // setup scrollbar tracking\r
+    var self = this;\r
+    this.startTimer();\r
+    if (enableScrollBar) {\r
+        window.addEventListener("resize", function(){\r
+            self.updateScrollbar();\r
+        }, false);\r
+        window.addEventListener("scroll", function(){\r
+            self.updateScrollbar();\r
+        }, false);\r
+    }\r
+}\r
+\r
+// Returns the current view.\r
+UIManager.prototype.getView = function() {\r
+    return this.currentView;\r
+}\r
+\r
+// Switches to the specified view.\r
+UIManager.prototype.setView = function(view) {\r
+    uiLogger.debug("View set to " + view.id);\r
+    \r
+    // remove the current view from the parent element\r
+    if (this.currentView != null) {\r
+        this.viewParentElement.removeChild(this.currentView.rootElement);\r
+    }\r
+    \r
+    // reset scroll\r
+    window.scrollTo(0, 0);\r
+    \r
+    // add the new view to the parent element\r
+    if (view != null) {\r
+        this.currentView = view;\r
+        this.currentView.resetControlFocusStates();\r
+        this.viewParentElement.appendChild(this.currentView.rootElement);\r
+    }\r
+    \r
+    // update scrollbar\r
+    if (this.enableScrollBar) {\r
+        this.updateScrollbar();\r
+    }\r
+    \r
+    // focus the first focusable control\r
+    // a timer is used to prevent unwanted focus shift\r
+    setTimeout(function() { view.focusFirstControl(); }, 1);\r
+}\r
+\r
+// Updates the scrollbar.\r
+UIManager.prototype.updateScrollbar = function() {\r
+    if (this.enableScrollBar) {\r
+        // get current viewport and document position and dimensions\r
+        var scrollY = window.scrollY;\r
+        var viewportHeight = window.innerHeight;\r
+        var documentHeight = Math.max(document.documentElement.scrollHeight, document.height);\r
+        \r
+        // check if the scroll position or view has changed\r
+        if (this.scrollY != scrollY ||\r
+                this.viewportHeight != viewportHeight ||\r
+                this.documentHeight != documentHeight) {\r
+            // scroll position or view has changed\r
+            this.scrollY = scrollY;\r
+            this.viewportHeight = viewportHeight;\r
+            this.documentHeight = documentHeight;\r
+            \r
+            // update the scrollbar\r
+            this.scrollbar.update(scrollY, viewportHeight, documentHeight);\r
+            uiLogger.debug("Scrollbar updated");\r
+        }\r
+    }\r
+}\r
+\r
+// Starts the view manager timer.\r
+UIManager.prototype.startTimer = function() {\r
+    if (this.timerId == null) {\r
+        uiLogger.debug("UIManager timer started");\r
+        var self = this;\r
+        // setup the timer\r
+        this.timerId = setInterval(function() { self.onTimer(); }, this.TIMER_INTERVAL);\r
+    } else {\r
+        uiLogger.warn("UIManager timer already running");\r
+    }\r
+}\r
+\r
+// Stops the view manager timer.\r
+UIManager.prototype.stopTimer = function() {\r
+    if (this.timerId != null) {\r
+        // stop the timer\r
+        clearTimeout(this.timerId);\r
+        this.timerId = null;\r
+    } else {\r
+        uiLogger.warn("UIManager timer already stopped");\r
+    }\r
+}\r
+\r
+// Timer callback function.\r
+UIManager.prototype.onTimer = function() {\r
+    if (this.enableScrollBar) {\r
+        // make sure the scrollbar is up to date\r
+        this.updateScrollbar();\r
+    }\r
+}\r
+\r
+// Displays a notification.\r
+UIManager.prototype.showNotification = function(displayTime, type, text, progress) {\r
+    uiLogger.debug("UIManager.showNotification(" + displayTime + ", " + type + ", " + text + ", " + progress + ")");\r
+    // use the notification popup to show the notification\r
+    this.notificationPopup.showNotification(displayTime, type, text, progress);\r
+}\r
+\r
+// Hides the currently displayed notification.\r
+UIManager.prototype.hideNotification = function() {\r
+    uiLogger.debug("UIManager.hideNotification()");\r
+    // hide the notification popup\r
+    this.notificationPopup.hideNotification();\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/UI/View.js b/wrt/misc/rss/WRTKit/UI/View.js
new file mode 100644 (file)
index 0000000..9ce4edc
--- /dev/null
@@ -0,0 +1,90 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (“Nokia”) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia’s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The View class is an abstract base class for views in the UI toolkit.\r
+// Don't use the View directly - instead use a concrete subclass like ListView.\r
+\r
+// Constructor.\r
+function View(id) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id);\r
+    }\r
+}\r
+\r
+// View inherits from UIElement.\r
+View.prototype = new UIElement(UI_NO_INIT_ID);\r
+\r
+// Currently focused control.\r
+View.prototype.focusedControl = null;\r
+\r
+// Initializer - called from constructor.\r
+View.prototype.init = function(id) {\r
+    uiLogger.debug("View.init(" + id + ")");\r
+    \r
+    // call superclass initializer\r
+    UIElement.prototype.init.call(this, id);\r
+}\r
+\r
+// Returns the currently focused control; null if none.\r
+View.prototype.getFocusedControl = function() {\r
+    return this.focusedControl;\r
+}\r
+\r
+// Used to notify the view that the focused control has changed.\r
+View.prototype.focusedControlChanged = function(control) {\r
+    uiLogger.debug("View.focusedControlChanged(" + control + ")");\r
+    this.focusedControl = control;\r
+    // notify event listeners\r
+    this.fireEvent(this.createEvent("FocusedControlChanged", this.focusedControl));\r
+}\r
+\r
+// Attempts to focus the first focusable control.\r
+// Override in subclasses as required.\r
+View.prototype.focusFirstControl = function() {\r
+    uiLogger.debug("View.focusFirstControl()");\r
+}\r
+\r
+// Attempts to reset all control focus states.\r
+// Override in subclasses as required.\r
+View.prototype.resetControlFocusStates = function() {\r
+    uiLogger.debug("View.resetControlFocusStates()");\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/Utils/Logger.js b/wrt/misc/rss/WRTKit/Utils/Logger.js
new file mode 100644 (file)
index 0000000..7ff6aa5
--- /dev/null
@@ -0,0 +1,117 @@
+/*\r
+© Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (ÒNokiaÓ) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under NokiaÕs copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// Logger utility class that uses the Firebug console class.\r
+\r
+// Constructor (everything is static so this is empty).\r
+function Logger() {\r
+    // Set default logger level.\r
+    this.level = this.LOG_LEVEL_OFF;\r
+}\r
+\r
+// Logger levels.\r
+Logger.prototype.LOG_LEVEL_DEBUG = 0;\r
+Logger.prototype.LOG_LEVEL_INFO = 1;\r
+Logger.prototype.LOG_LEVEL_WARN = 2;\r
+Logger.prototype.LOG_LEVEL_ERROR = 3;\r
+Logger.prototype.LOG_LEVEL_OFF = 4;\r
+\r
+Logger.prototype.level = null;\r
+Logger.prototype.filter = null;\r
+\r
+// Disable logging on other browsers except Firefox.\r
+Logger.prototype.enabled = (navigator.userAgent.indexOf("Firefox") != -1);\r
+\r
+// Dumps an objects properties and methods to the console.\r
+Logger.prototype.dump = function(obj) {\r
+    if (this.enabled) {\r
+        console.dir(obj);\r
+    }\r
+}\r
+\r
+// Dumps a stracktrace to the console.\r
+Logger.prototype.trace = function() {\r
+    if (this.enabled) {\r
+        console.trace();\r
+    }\r
+}\r
+\r
+// Prints a debug message to the console.\r
+Logger.prototype.debug = function(str) {\r
+    if (this.enabled && this.level <= this.LOG_LEVEL_DEBUG) {\r
+        if (this.filter == null) {\r
+            console.debug(str);\r
+        } else {\r
+            var show = false;\r
+            for (i in this.filter) {\r
+                if (str.indexOf(this.filter[i]) >= 0) {\r
+                    show = true;\r
+                    break;\r
+                }\r
+            }\r
+            if (show) {\r
+                console.debug(str);\r
+            }\r
+        }\r
+    }\r
+}\r
+\r
+// Prints an info message to the console.\r
+Logger.prototype.info = function(str) {\r
+    if (this.enabled && this.level <= this.LOG_LEVEL_INFO) {\r
+        console.info(str);\r
+    }\r
+}\r
+\r
+// Prints a warning message to the console.\r
+Logger.prototype.warn = function(str) {\r
+    if (this.enabled && this.level <= this.LOG_LEVEL_WARN) {\r
+        console.warn(str);\r
+    }\r
+}\r
+\r
+// Prints an error message to the console.\r
+Logger.prototype.error = function(str) {\r
+    if (this.enabled && this.level <= this.LOG_LEVEL_ERROR) {\r
+        console.error(str);\r
+    }\r
+}\r
diff --git a/wrt/misc/rss/WRTKit/WRTKit.js b/wrt/misc/rss/WRTKit/WRTKit.js
new file mode 100644 (file)
index 0000000..de1ff6b
--- /dev/null
@@ -0,0 +1,90 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// This script includes the WRTKit for use in a widget.\r
+\r
+// WRTKit version (major.minor.revision, e.g. 1.0.0).\r
+var WRTKIT_VERSION_MAJOR = 1;\r
+var WRTKIT_VERSION_MINOR = 0;\r
+var WRTKIT_VERSION_REVISION = 0;\r
+var WRTKIT_RESOURCE_DIRECTORY = "WRTKit/Resources/";\r
+\r
+// Include util script files.\r
+includeScript("WRTKit/Utils/Logger.js");\r
+\r
+// Include UI visual definition.\r
+includeStyleSheet("WRTKit/Resources/UI.css");\r
+\r
+// Include all UI toolkit script files.\r
+var UI_NO_INIT_ID = "UI_NO_INIT_ID";\r
+\r
+includeScript("WRTKit/UI/UIInit.js");\r
+includeScript("WRTKit/UI/UIElement.js");\r
+includeScript("WRTKit/UI/Scrollbar.js");\r
+includeScript("WRTKit/UI/NotificationPopup.js");\r
+includeScript("WRTKit/UI/UIManager.js");\r
+includeScript("WRTKit/UI/View.js");\r
+includeScript("WRTKit/UI/ListView.js");\r
+includeScript("WRTKit/UI/Control.js");\r
+includeScript("WRTKit/UI/Separator.js");\r
+includeScript("WRTKit/UI/Label.js");\r
+includeScript("WRTKit/UI/ContentPanel.js");\r
+includeScript("WRTKit/UI/TextEntryControl.js");\r
+includeScript("WRTKit/UI/TextField.js");\r
+includeScript("WRTKit/UI/TextArea.js");\r
+includeScript("WRTKit/UI/SelectionControl.js");\r
+includeScript("WRTKit/UI/SelectionMenu.js");\r
+includeScript("WRTKit/UI/SelectionList.js");\r
+includeScript("WRTKit/UI/ActionControl.js");\r
+includeScript("WRTKit/UI/FormButton.js");\r
+includeScript("WRTKit/UI/NavigationButton.js");\r
+includeScript("WRTKit/UI/Ajax.js");\r
+\r
+// Includes a script file by writing a script tag.\r
+function includeScript(src) {\r
+    document.write("<script type=\"text/javascript\" src=\"" + src + "\"></script>");\r
+}\r
+\r
+// Includes a style sheet by writing a style tag.\r
+function includeStyleSheet(src) {\r
+    document.write("<style type=\"text/css\"> @import url(\"" +  src + "\"); </style>");\r
+}\r
diff --git a/wrt/misc/rss/feed.xml b/wrt/misc/rss/feed.xml
new file mode 100644 (file)
index 0000000..b03c579
--- /dev/null
@@ -0,0 +1,815 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rss version="2.0"
+       xmlns:content="http://purl.org/rss/1.0/modules/content/"
+       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+       xmlns:dc="http://purl.org/dc/elements/1.1/"
+       xmlns:atom="http://www.w3.org/2005/Atom"
+       >
+
+<channel>
+       <title>S60 Blogs</title>
+       <atom:link href="http://blogs.s60.com/feed" rel="self" type="application/rss+xml" />
+       <link>http://blogs.s60.com</link>
+       <description></description>
+       <pubDate>Thu, 02 Jul 2009 10:12:32 +0000</pubDate>
+       <generator>http://wordpress.org/?v=2.6.2</generator>
+       <language>en</language>
+                       <item>
+               <title>Final words and thanks from Jukka</title>
+               <link>http://blogs.s60.com/2009/06/final-words</link>
+               <comments>http://blogs.s60.com/2009/06/final-words#comments</comments>
+               <pubDate>Tue, 30 Jun 2009 07:53:47 +0000</pubDate>
+               <dc:creator>Jukka Eklund</dc:creator>
+               
+               <category><![CDATA[S60 applications]]></category>
+
+               <category><![CDATA[S60 devices]]></category>
+
+               <category><![CDATA[maemo]]></category>
+
+               <category><![CDATA[Mobile Web Server]]></category>
+
+               <category><![CDATA[Nseries]]></category>
+
+               <guid isPermaLink="false">http://blogs.s60.com/?p=3329</guid>
+               <description><![CDATA[Heh, looks like I still made it through even though it's already July :)\r
+\r
+It's been a while since I blogged here. If you remember I started way back in S60 Multimedia blog (which seems to be gone from the server, hope that's a mistake), that was a lot of fun. Then we had the <a href="http://mymobilesite.net">Mobile Web Server</a> activity and a new blog. Since the start of this year I haven't been part of that activity anymore, but following closely. [...]]]></description>
+                       <content:encoded><![CDATA[<p>Heh, looks like I still made it through even though it&#8217;s already July <img src='http://blogs.s60.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
+<p>It&#8217;s been a while since I blogged here. If you remember I started way back in S60 Multimedia blog (which seems to be gone from the server, hope that&#8217;s a mistake), that was a lot of fun. Then we had the <a href="http://mymobilesite.net">Mobile Web Server</a> activity and a new blog. Since the start of this year I haven&#8217;t been part of that activity anymore, but following closely. Things might seem a bit silent now, but you never know what&#8217;s bubbling under (well I know, but can&#8217;t tell yet). Speaking of MWS please take a look on the <a href="http://mymobilesite.net/news/28/" target="_self">latest news post</a> and take action, it will be much appreciated!</p>
+<p>My current activities are with Nseries where I manage some of the key experiences for future devices. Hope to tell you more about those later. Keep an eye on the <a href="http://blogs.nokia.com/nseries/">Nseries blog</a> and <a href="http://maemo.org/">Maemo</a>, and of course all of the other <a href="http://blogs.nokia.com/">Nokia blogs</a> as well. You can find me on Facebook, Twitter etc. when you want to be in touch.</p>
+<p>Now it&#8217;s time to rest for a while and enjoy the summer! Can&#8217;t think of anything more original than: Thanks <img src='http://blogs.s60.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
+<p>-Jukka</p>
+]]></content:encoded>
+                       <wfw:commentRss>http://blogs.s60.com/2009/06/final-words/feed</wfw:commentRss>
+               </item>
+               <item>
+               <title>Thank you!</title>
+               <link>http://blogs.s60.com/2009/06/thank-you</link>
+               <comments>http://blogs.s60.com/2009/06/thank-you#comments</comments>
+               <pubDate>Mon, 29 Jun 2009 15:24:55 +0000</pubDate>
+               <dc:creator>Saara Bergström</dc:creator>
+               
+               <category><![CDATA[S60 news]]></category>
+
+               <guid isPermaLink="false">http://blogs.s60.com/?p=3331</guid>
+               <description><![CDATA[<a href=http://blogs.s60.com/2009/06/thank-you><img src=http://blogs.s60.com/wp-content/uploads/2009/06/thankyou.jpg class=imgtfe hspace=5 align=left width=100  border=0></a><a href="http://blogs.s60.com/wp-content/uploads/2009/06/thankyou.jpg"></a>It's time to thank each and every one of you who have found our site useful, contributed to the S60 community, and taken part in discussions on the S60 blogs over the years on behalf of the whole S60 team. It's been a great experience for all of us! S60.com will be closed in the next couple of days. S60 Blogs content will remain available on this site, but new posts will not be published anymore.\r
+\r
+Closing of S60.com and [...]]]></description>
+                       <content:encoded><![CDATA[<p><a href="http://blogs.s60.com/wp-content/uploads/2009/06/thankyou.jpg"><img class="alignright size-full wp-image-3332" title="Thank you!" src="http://blogs.s60.com/wp-content/uploads/2009/06/thankyou.jpg" alt="" width="120" height="160" /></a>It&#8217;s time to thank each and every one of you who have found our site useful, contributed to the S60 community, and taken part in discussions on the S60 blogs over the years on behalf of the whole S60 team. It&#8217;s been a great experience for all of us! S60.com will be closed in the next couple of days. S60 Blogs content will remain available on this site, but new posts will not be published anymore.</p>
+<p>Closing of S60.com and S60 Blogs is a result of Symbian OS and S60 software assets becoming together as the Symbian Foundation. Please visit <a href="http://www.symbian.org/">symbian.org</a> and <a href="http://www.nokia.com/">nokia.com</a> for more information. Other sources of information you might find useful or interesting include <a href="http://blogs.nokia.com">Nokia Blogs</a>, <a href="http://blog.symbian.org/">Symbian Blog</a>, <a href="http://betalabs.nokia.com/">Nokia beta Labs</a> and <a href="http://www.nokia.com/developers/success-stories/nokia-pilots">Nokia Pilots</a>.</p>
+<p>I am continuing to work with Nokia on some projects that I&#8217;m very happy to be part of including managing <a href="http://blogs.nokia.com">http://blogs.nokia.com</a>. Once again, thank you all for this wonderful journey and hopefully see you soon!</p>
+]]></content:encoded>
+                       <wfw:commentRss>http://blogs.s60.com/2009/06/thank-you/feed</wfw:commentRss>
+               </item>
+               <item>
+               <title>More details on future S60 Java UI plans</title>
+               <link>http://blogs.s60.com/2009/06/more-details-on-future-s60-java-ui-plans</link>
+               <comments>http://blogs.s60.com/2009/06/more-details-on-future-s60-java-ui-plans#comments</comments>
+               <pubDate>Sun, 07 Jun 2009 20:05:17 +0000</pubDate>
+               <dc:creator>Aleksi Uotila</dc:creator>
+               
+               <category><![CDATA[Java]]></category>
+
+               <guid isPermaLink="false">http://blogs.s60.com/?p=3320</guid>
+               <description><![CDATA[Görkem has <a href="http://www.gorkem-ercan.com/2009/06/reflections-of-symbian-foundation-and.html">written more details on our future user interface plans at Java Runtime for S60</a>. The upcoming changes in <a href="http://blog.symbian.org/2009/04/30/reviewing-the-release-plan/">Symbian Foundation for UIs</a> require long lead time development which has already been started in our team. We currently have Java UIs running on Qt framework on desktop and we are now focusing on ensuring that things work OK in S60 environment on Qt as well as implementing mobile specific integration and then advanced features like bridging of [...]]]></description>
+                       <content:encoded><![CDATA[<p>Görkem has <a href="http://www.gorkem-ercan.com/2009/06/reflections-of-symbian-foundation-and.html">written more details on our future user interface plans at Java Runtime for S60</a>. The upcoming changes in <a href="http://blog.symbian.org/2009/04/30/reviewing-the-release-plan/">Symbian Foundation for UIs</a> require long lead time development which has already been started in our team. We currently have Java UIs running on Qt framework on desktop and we are now focusing on ensuring that things work OK in S60 environment on Qt as well as implementing mobile specific integration and then advanced features like bridging of MIDP LCDUI and eSWT as well as those other features. One additional theme in our UI development that is good to mention is graphics hardware acceleration and enablement of what Symbian OS marketing calls as <a href="http://developer.symbian.com/wiki/display/KBSDN/Where+can+I+find+information+on+Screenplay">Screenplay</a> for all of our graphics and media APIs: LCDUI 2D graphics, M2G, M3G and MMAPI.</p>
+]]></content:encoded>
+                       <wfw:commentRss>http://blogs.s60.com/2009/06/more-details-on-future-s60-java-ui-plans/feed</wfw:commentRss>
+               </item>
+               <item>
+               <title>It&#8217;s time to say: kiitos &#38; näkemiin</title>
+               <link>http://blogs.s60.com/2009/06/its-time-to-say-goodbye</link>
+               <comments>http://blogs.s60.com/2009/06/its-time-to-say-goodbye#comments</comments>
+               <pubDate>Fri, 05 Jun 2009 18:17:42 +0000</pubDate>
+               <dc:creator>Raj Unny</dc:creator>
+               
+               <category><![CDATA[S60 Ambassadors]]></category>
+
+               <category><![CDATA[S60 Living]]></category>
+
+               <category><![CDATA[symbian foundation]]></category>
+
+               <guid isPermaLink="false">http://blogs.s60.com/?p=3301</guid>
+               <description><![CDATA[<a href=http://blogs.s60.com/2009/06/its-time-to-say-goodbye><img src=http://blogs.s60.com/wp-content/uploads/2009/06/ambyplane-300x107.jpg class=imgtfe hspace=5 align=left width=100  border=0></a><a href="http://blogs.s60.com/wp-content/uploads/2009/06/ambyplane.jpg"></a>Mike &#38; I have been busy making sure the last of the rewards have been shipped out. And they have!\r
+\r
+Now it's time for that very last post. As most of you know, the S60 Ambassador program and site are <a href="http://blogs.s60.com/2009/04/s60-ambassador-program-is-ending" target="_blank">closing</a> end of the month along with the <a href="http://blogs.s60.com/2009/04/s60-and-symbian-foundation-looking-forward" target="_blank">rest of S60.com</a>.\r
+\r
+This has been a fascinating journey that all of us here at S60 have both enjoyed and cherished. The Ambassador program alone had more than 21 [...]]]></description>
+                       <content:encoded><![CDATA[<p><a href="http://blogs.s60.com/wp-content/uploads/2009/06/ambyplane.jpg"><img class="alignleft size-medium wp-image-3306" src="http://blogs.s60.com/wp-content/uploads/2009/06/ambyplane-300x107.jpg" alt="" width="275" height="125" /></a>Mike &amp; I have been busy making sure the last of the rewards have been shipped out. And they have!</p>
+<p>Now it&#8217;s time for that very last post. As most of you know, the S60 Ambassador program and site are <a href="http://blogs.s60.com/2009/04/s60-ambassador-program-is-ending" target="_blank">closing</a> end of the month along with the <a href="http://blogs.s60.com/2009/04/s60-and-symbian-foundation-looking-forward" target="_blank">rest of S60.com</a>.</p>
+<p>This has been a fascinating journey that all of us here at S60 have both enjoyed and cherished. The Ambassador program alone had more than 21 thousand fans who signed up - submitting nearly 6 thousand reports in little less than a year and 9 fun campaigns. We can all be proud of what we&#8217;ve achieved together.</p>
+<p>Before we say goodbye, we&#8217;d like to tip our hats to the following Ambassadors who&#8217;ve made it to the all-time, all-star list:</p>
+<p><!--[if gte mso 9]&gt; Normal   0               false   false   false      EN-US   X-NONE   X-NONE                                                     MicrosoftInternetExplorer4 &lt;![endif]--><!--[if gte mso 9]&gt; &lt;![endif]--><!--  --><!--[if gte mso 10]&gt; &lt;!   /* Style Definitions */  table.MsoNormalTable       {mso-style-name:"Table Normal";         mso-tstyle-rowband-size:0;      mso-tstyle-colband-size:0;      mso-style-noshow:yes;   mso-style-priority:99;  mso-style-qformat:yes;  mso-style-parent:"";    mso-padding-alt:0cm 5.4pt 0cm 5.4pt;    mso-para-margin-top:6.0pt;      mso-para-margin-right:0cm;      mso-para-margin-bottom:6.0pt;   mso-para-margin-left:2.0cm;     text-indent:-2.0cm;     mso-pagination:widow-orphan;    font-size:11.0pt;       font-family:"Nokia Standard Light","sans-serif";        mso-ascii-font-family:"Nokia Standard Light";   mso-ascii-theme-font:minor-latin;       mso-fareast-font-family:SimSun;         mso-fareast-theme-font:minor-fareast;   mso-hansi-font-family:"Nokia Standard Light";   mso-hansi-theme-font:minor-latin;} table.MsoTableLightListAccent3       {mso-style-name:"Light List - Accent 3";        mso-tstyle-rowband-size:1;      mso-tstyle-colband-size:1;      mso-style-priority:61;  mso-style-unhide:no;    border:solid #9BBB59 1.0pt;     mso-border-themecolor:accent3;  mso-padding-alt:0cm 5.4pt 0cm 5.4pt;    mso-para-margin:0cm;    mso-para-margin-bottom:.0001pt;         mso-pagination:widow-orphan;    font-size:11.0pt;       font-family:"Nokia Standard Light","sans-serif";        mso-ascii-font-family:"Nokia Standard Light";   mso-ascii-theme-font:minor-latin;       mso-fareast-font-family:SimSun;         mso-fareast-theme-font:minor-fareast;   mso-hansi-font-family:"Nokia Standard Light";   mso-hansi-theme-font:minor-latin;       mso-bidi-language:EN-US;} table.MsoTableLightListAccent3FirstRow        {mso-style-name:"Light List - Accent 3";        mso-table-condition:first-row;  mso-style-priority:61;  mso-style-unhide:no;    mso-tstyle-shading:#9BBB59;     mso-tstyle-shading-themecolor:accent3;  mso-para-margin-top:0cm;        mso-para-margin-bottom:0cm;     mso-para-margin-bottom:.0001pt;         line-height:normal;     color:white;    mso-themecolor:background1;     mso-ansi-font-weight:bold;      mso-bidi-font-weight:bold;} table.MsoTableLightListAccent3LastRow       {mso-style-name:"Light List - Accent 3";        mso-table-condition:last-row;   mso-style-priority:61;  mso-style-unhide:no;    mso-tstyle-border-top:2.25pt double #9BBB59;    mso-tstyle-border-top-themecolor:accent3;       mso-tstyle-border-left:1.0pt solid #9BBB59;     mso-tstyle-border-left-themecolor:accent3;      mso-tstyle-border-bottom:1.0pt solid #9BBB59;   mso-tstyle-border-bottom-themecolor:accent3;    mso-tstyle-border-right:1.0pt solid #9BBB59;    mso-tstyle-border-right-themecolor:accent3;     mso-para-margin-top:0cm;        mso-para-margin-bottom:0cm;     mso-para-margin-bottom:.0001pt;         line-height:normal;     mso-ansi-font-weight:bold;      mso-bidi-font-weight:bold;} table.MsoTableLightListAccent3FirstCol      {mso-style-name:"Light List - Accent 3";        mso-table-condition:first-column;       mso-style-priority:61;  mso-style-unhide:no;    mso-ansi-font-weight:bold;      mso-bidi-font-weight:bold;} table.MsoTableLightListAccent3LastCol       {mso-style-name:"Light List - Accent 3";        mso-table-condition:last-column;        mso-style-priority:61;  mso-style-unhide:no;    mso-ansi-font-weight:bold;      mso-bidi-font-weight:bold;} table.MsoTableLightListAccent3OddColumn     {mso-style-name:"Light List - Accent 3";        mso-table-condition:odd-column;         mso-style-priority:61;  mso-style-unhide:no;    mso-tstyle-border-top:1.0pt solid #9BBB59;      mso-tstyle-border-top-themecolor:accent3;       mso-tstyle-border-left:1.0pt solid #9BBB59;     mso-tstyle-border-left-themecolor:accent3;      mso-tstyle-border-bottom:1.0pt solid #9BBB59;   mso-tstyle-border-bottom-themecolor:accent3;    mso-tstyle-border-right:1.0pt solid #9BBB59;    mso-tstyle-border-right-themecolor:accent3;} table.MsoTableLightListAccent3OddRow       {mso-style-name:"Light List - Accent 3";        mso-table-condition:odd-row;    mso-style-priority:61;  mso-style-unhide:no;    mso-tstyle-border-top:1.0pt solid #9BBB59;      mso-tstyle-border-top-themecolor:accent3;       mso-tstyle-border-left:1.0pt solid #9BBB59;     mso-tstyle-border-left-themecolor:accent3;      mso-tstyle-border-bottom:1.0pt solid #9BBB59;   mso-tstyle-border-bottom-themecolor:accent3;    mso-tstyle-border-right:1.0pt solid #9BBB59;    mso-tstyle-border-right-themecolor:accent3;} --> <!--[endif]--></p>
+<table border="1" cellspacing="0" cellpadding="0">
+<tbody>
+<tr>
+<td style="center;" colspan="6" width="426" valign="top">
+<h2><strong> S60   Ambassador: All-Time Rankings</strong></h2>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4><strong>1</strong></h4>
+</td>
+<td valign="bottom">
+<h4><strong><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=7276">fakhre </a></span></strong></h4>
+</td>
+<td valign="top">
+<h4>21</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=9166">irfanil </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>41</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=17823">MarcusC </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4><strong>2</strong></h4>
+</td>
+<td valign="bottom">
+<h4><strong><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=11718">spenlunc </a></span></strong></h4>
+</td>
+<td valign="top">
+<h4>22</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=1436">Furie </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>42</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=1718">rnbrulz </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4><strong>3</strong></h4>
+</td>
+<td valign="bottom">
+<h4><strong><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=5830">hritikbhimani </a></span></strong></h4>
+</td>
+<td valign="top">
+<h4>23</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=4570">ILikeMyNok </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>43</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=14581">maptor </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4><strong>4</strong></h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=5176">JCRomo </a></span></h4>
+</td>
+<td valign="top">
+<h4>24</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=15383">RallyChamp </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>44</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=6963">farhan89 </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4><strong>5</strong></h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=17463">Avanzato1811 </a></span></h4>
+</td>
+<td valign="top">
+<h4>25</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=17430">omer86 </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>45</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=548">MattWPBS </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4><strong>6</strong></h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=1830">anwar79 </a></span></h4>
+</td>
+<td valign="top">
+<h4>26</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=11108">ganster </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>46</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=47">maksim </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4><strong>7</strong></h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=15388">shaonmra </a></span></h4>
+</td>
+<td valign="top">
+<h4>27</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=10375">Coisy </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>47</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=17571">shoebbb </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4><strong>8</strong></h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=1033">kukalubo </a></span></h4>
+</td>
+<td valign="top">
+<h4>28</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=13059">grimsight </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>48</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=17962">szukoman </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4><strong>9</strong></h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=12182">haritas </a></span></h4>
+</td>
+<td valign="top">
+<h4>29</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=64">mcpezza </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>49</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=13554">vishusaba </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4><strong>10</strong></h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=5221">oscarburd </a></span></h4>
+</td>
+<td valign="top">
+<h4>30</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=9659">alexismil </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>50</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=22783">Ardianwardhana </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4>11</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=11029">ankss </a></span></h4>
+</td>
+<td valign="top">
+<h4>31</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=17904">cleochris08 </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>51</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=7270">vedant2810 </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4>12</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=43">LENNYBONS </a></span></h4>
+</td>
+<td valign="top">
+<h4>32</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=16650">highdiver </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>52</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=11757">prazmessi </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4>13</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=2254">VISHESH </a></span></h4>
+</td>
+<td valign="top">
+<h4>33</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=17778">kishok </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>53</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=580">jobber99 </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4>14</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=3792">Rachaelsmom </a></span></h4>
+</td>
+<td valign="top">
+<h4>34</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=1851">Malaika </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>54</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=11184">gamemaster28 </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4>15</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=11831">traghuveer </a></span></h4>
+</td>
+<td valign="top">
+<h4>35</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=11004">irfun4ever </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>55</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=7431">anotheran </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4>16</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=2746">ritesh </a></span></h4>
+</td>
+<td valign="top">
+<h4>36</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=8718">tonymohd </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>56</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=820">nikhilchawla </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4>17</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=2958">leenoormohamed </a></span></h4>
+</td>
+<td valign="top">
+<h4>37</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=11393">klackerz </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>57</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=18574">Verccety </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4>18</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=693">crazysehaj </a></span></h4>
+</td>
+<td valign="top">
+<h4>38</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=11034">BodyZ </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>58</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=15550">orcthesorc </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4>19</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=851">gomcoite </a></span></h4>
+</td>
+<td valign="top">
+<h4>39</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=18093">ibzter </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>59</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=17309">bryanlyt </a></span></h4>
+</td>
+</tr>
+<tr>
+<td valign="top">
+<h4>20</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=14331">suyog </a></span></h4>
+</td>
+<td valign="top">
+<h4>40</h4>
+</td>
+<td valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=11086">Hellblazer </a></span></h4>
+</td>
+<td width="35" valign="top">
+<h4>60</h4>
+</td>
+<td width="126" valign="bottom">
+<h4><span style="underline;"><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=7385">ming387 </a></span></h4>
+</td>
+</tr>
+</tbody>
+</table>
+<p>And hats off to each and every one of you for your passion, enthusiasm, and zest for all things S60. A resounding  <strong>T-H-A-N-K  Y-O-U</strong> for joining us on this journey. The many feedback and comments you&#8217;ve sent our way will continue to hold us in good stead as Symbian and S60 make their transition towards Symbian Foundation.</p>
+<p>So long. Farewell. <em>Kiitos</em> &amp; <em>näkemiin</em> (thanks &amp; goodbye) as we say over here in Finland. Take care.</p>
+<p>- Team S60 -</p>
+]]></content:encoded>
+                       <wfw:commentRss>http://blogs.s60.com/2009/06/its-time-to-say-goodbye/feed</wfw:commentRss>
+               </item>
+               <item>
+               <title>Java Sensor API demo</title>
+               <link>http://blogs.s60.com/2009/06/java-sensor-api-demo</link>
+               <comments>http://blogs.s60.com/2009/06/java-sensor-api-demo#comments</comments>
+               <pubDate>Mon, 01 Jun 2009 12:23:36 +0000</pubDate>
+               <dc:creator>Aleksi Uotila</dc:creator>
+               
+               <category><![CDATA[Development]]></category>
+
+               <category><![CDATA[General]]></category>
+
+               <category><![CDATA[Java]]></category>
+
+               <guid isPermaLink="false">http://blogs.s60.com/?p=3281</guid>
+               <description><![CDATA[S60 Java Runtime guys shot some video material on our Nokia Developer Summit demo. It's showcasing Java Sensor API &#38; Java Bluetooth API usage with BT controlled Tamiya RC Mini Cooper S 2006 car.\r
+\r
+The demo uses many Java APIs and device features. Java Sensor API &#38; accelerometer sensor of the <a href="http://www.forum.nokia.com/devices/N97">Nokia N97 device</a> is used for implementing the car control. Users just tilt the device in order to accelerate and turn  wheels of the car. The Java Sensor API [...]]]></description>
+                       <content:encoded><![CDATA[<p>S60 Java Runtime guys shot some video material on our Nokia Developer Summit demo. It&#8217;s showcasing Java Sensor API &amp; Java Bluetooth API usage with BT controlled Tamiya RC Mini Cooper S 2006 car.</p>
+<p>The demo uses many Java APIs and device features. Java Sensor API &amp; accelerometer sensor of the <a href="http://www.forum.nokia.com/devices/N97">Nokia N97 device</a> is used for implementing the car control. Users just tilt the device in order to accelerate and turn  wheels of the car. The Java Sensor API gives demo Java app the orientation of the device. Application then turns the accelerometer signals to control signals for the car itself. These signals are transmitted to the car using Java Bluetooth API. The car itself has an additional Bluetooth module installed. Then of course in the device side there&#8217;s some UI also done with Java MIDP APIs that show the control level to the user. Touch UI is used to provide some additional control means.</p>
+<p>Additionally we also did a special variant of the Java application for <a href="http://www.forum.nokia.com/devices/6260_slide">Nokia 6260 slide (Series 40) device</a> that has an analogue joystick input device and the Java Runtime therein is bundled with a <a href="http://library.forum.nokia.com/index.jsp?topic=/Java_Developers_Library/GUID-237420DE-CCBE-4A74-A129-572E0708D428/com/nokia/mid/ui/JoystickEventListener.html">Joystick event listener</a> (part of Nokia UI API).  So instead of tilting the device for controlling the car device&#8217;s joystick is used.</p>
+<p>The <a href="http://events.nokia.com/developersummit/assets/pdf/Java_demo_slides.pdf">summit slides</a> have some more details of the MIDlet implementation on both devices.</p>
+<p>If you are interested in developing using Java Sensor API please see also both our <a href="http://library.forum.nokia.com/index.jsp?topic=/Java_Developers_Library/GUID-660EC670-B7DB-4005-BF2D-411E5C0B3867_overview-d0e41497.html">Sensor API Developer&#8217;s Guide</a> and  <a href="http://library.forum.nokia.com/index.jsp?topic=/Java_Developers_Library/GUID-660EC670-B7DB-4005-BF2D-411E5C0B3867_overview-d0e94435.html">Sensor API implementation notes</a>. Java Sensor API is part of <a href="http://wiki.forum.nokia.com/index.php/Java_Runtime_1.4_for_S60_Release_notes">Java Runtime 1.4 for S60</a>.</p>
+<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/pnxgThSd7zk&amp;hl=en&amp;fs=1" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/pnxgThSd7zk&amp;hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
+]]></content:encoded>
+                       <wfw:commentRss>http://blogs.s60.com/2009/06/java-sensor-api-demo/feed</wfw:commentRss>
+               </item>
+               <item>
+               <title>Ovi Store NOT requiring Java Verified</title>
+               <link>http://blogs.s60.com/2009/05/ovi-store-not-requiring-java-verified</link>
+               <comments>http://blogs.s60.com/2009/05/ovi-store-not-requiring-java-verified#comments</comments>
+               <pubDate>Wed, 27 May 2009 12:57:29 +0000</pubDate>
+               <dc:creator>Aleksi Uotila</dc:creator>
+               
+               <category><![CDATA[Development]]></category>
+
+               <category><![CDATA[Java]]></category>
+
+               <category><![CDATA[Support]]></category>
+
+               <category><![CDATA[Java Verified]]></category>
+
+               <category><![CDATA[JavaVerified]]></category>
+
+               <category><![CDATA[JV]]></category>
+
+               <category><![CDATA[OVI Store]]></category>
+
+               <guid isPermaLink="false">http://blogs.s60.com/?p=3277</guid>
+               <description><![CDATA[<a href=http://blogs.s60.com/2009/05/ovi-store-not-requiring-java-verified><img src=http://nds3.nokia.com/pressphotos/public/global/experiences/ovi_store/Ovi-Store_N97_portrait_5_mystuff_lowres.jpg class=imgtfe hspace=5 align=left width=100  border=0></a><a href="http://store.ovi.com"></a>I've just got confirmation from an Ovi Store guys that Java applications DO NOT require to go through Java Verified testing when being published to Ovi Store.\r
+\r
+It has been a huge source of complaints throughout the Internet and Ovi related discussion boards that Java application developers are forced to do testing via Java Verified. To use Java Verified before submitting the application to Ovi Store is only a recommendation for developers. If developers have other means to ensure the [...]]]></description>
+                       <content:encoded><![CDATA[<p><a href="http://store.ovi.com"><img class="alignright" src="http://nds3.nokia.com/pressphotos/public/global/experiences/ovi_store/Ovi-Store_N97_portrait_5_mystuff_lowres.jpg" alt="" width="165" height="329" /></a>I&#8217;ve just got confirmation from an Ovi Store guys that Java applications DO NOT require to go through Java Verified testing when being published to Ovi Store.</p>
+<p>It has been a huge source of complaints throughout the Internet and Ovi related discussion boards that Java application developers are <em>forced </em>to do testing via Java Verified. To use Java Verified before submitting the application to Ovi Store is only a recommendation for developers. If developers have other means to ensure the quality on different Nokia handsets then it&#8217;s totally acceptable to not to use it. Developers are however required to sign their content using content signing (Verisign or Thawte).</p>
+]]></content:encoded>
+                       <wfw:commentRss>http://blogs.s60.com/2009/05/ovi-store-not-requiring-java-verified/feed</wfw:commentRss>
+               </item>
+               <item>
+               <title>S60 Always</title>
+               <link>http://blogs.s60.com/2009/05/s60-always</link>
+               <comments>http://blogs.s60.com/2009/05/s60-always#comments</comments>
+               <pubDate>Fri, 22 May 2009 13:45:16 +0000</pubDate>
+               <dc:creator>Raj Unny</dc:creator>
+               
+               <category><![CDATA[S60 Ambassadors]]></category>
+
+               <category><![CDATA[S60 Living]]></category>
+
+               <guid isPermaLink="false">http://blogs.s60.com/?p=3269</guid>
+               <description><![CDATA[<a href=http://blogs.s60.com/2009/05/s60-always><img src=http://blogs.s60.com/wp-content/uploads/2009/05/alwayss60.jpg class=imgtfe hspace=5 align=left width=100  border=0></a><a href="http://blogs.s60.com/wp-content/uploads/2009/05/alwayss60.jpg"></a>\r
+\r
+The 'Always S60' campaign finally ended this past weekend. After nearly a year of being the only campaign that was always open and always on, there's a certain air of inevitability to this closure. It's been a pleasant surprise to us here in the S60 Ambassador team that, despite not having much by way of rewards or tourneys, participation in the Always S60 campaign was steady and brisk. It ended proudly too - as the campaign with the highest [...]]]></description>
+                       <content:encoded><![CDATA[<p><a href="http://blogs.s60.com/wp-content/uploads/2009/05/alwayss60.jpg"><img class="aligncenter size-full wp-image-3270" src="http://blogs.s60.com/wp-content/uploads/2009/05/alwayss60.jpg" alt="" width="500" height="128" /></a></p>
+<p>The &#8216;Always S60&#8242; campaign finally ended this past weekend. After nearly a year of being the only campaign that was always open and always on, there&#8217;s a certain air of inevitability to this closure. It&#8217;s been a pleasant surprise to us here in the S60 Ambassador team that, despite not having much by way of rewards or tourneys, participation in the Always S60 campaign was steady and brisk. It ended proudly too - as the campaign with the highest participation and highest number of reports ever. We believe this proves nicely that the S60 Ambassador program has always been about passion, dedication, and genuine desire to spread the word to friends, family, and even strangers - with rewards just making the campaigns more fun.</p>
+<p>We&#8217;d like to tip our hats to the thousands of Ambassadors that participated in making the &#8216;Always S60&#8242; campaign a success.</p>
+<p>Special kudos and recognition are due to those who made it to the Top-20 &#8216;Always S60&#8242; Ambassadors rankings:</p>
+<ol>
+<li><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=7276" target="_blank"><strong></strong></a><strong><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=7276" target="_blank">fakhre</a> </strong></li>
+<li><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=1830" target="_blank">anwar79</a></li>
+<li><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=5830" target="_blank">hritikbhimani</a></li>
+<li><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=5176" target="_blank">JCRomo</a></li>
+<li><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=5221" target="_blank">oscarburd</a></li>
+<li>kukalubo</li>
+<li>Coisy</li>
+<li>Furie</li>
+<li>ILikeMyNok</li>
+<li>ritesh</li>
+<li>mcpezza</li>
+<li>spenlunc</li>
+<li>traghuveer</li>
+<li>Rachaelsmom</li>
+<li>LENNYBONS</li>
+<li>farhan89</li>
+<li>vishusaba</li>
+<li>maptor</li>
+<li>Ardianwardhana</li>
+<li>highdiver</li>
+</ol>
+<p>And report-of-the-week kudos goes to MobiReader fan and S60 Ambassador <a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=1851">Malaika</a> for this report: <a href="http://www.s60.com/report/6128" target="_blank">http://www.s60.com/report/6128</a></p>
+<p>As most of you know, the S60 Ambassador program is <a href="http://blogs.s60.com/2009/04/s60-ambassador-program-is-ending" target="_blank">on its final leg</a>. Next week I&#8217;ll be posting top-rankings for ALL campaigns combined. That will likely be our last post. Until then, take care out there.</p>
+]]></content:encoded>
+                       <wfw:commentRss>http://blogs.s60.com/2009/05/s60-always/feed</wfw:commentRss>
+               </item>
+               <item>
+               <title>eSWT support as part of Eclipse MTJ</title>
+               <link>http://blogs.s60.com/2009/05/eswt-support-as-part-of-eclipse-mtj</link>
+               <comments>http://blogs.s60.com/2009/05/eswt-support-as-part-of-eclipse-mtj#comments</comments>
+               <pubDate>Tue, 19 May 2009 18:42:45 +0000</pubDate>
+               <dc:creator>Aleksi Uotila</dc:creator>
+               
+               <category><![CDATA[Development]]></category>
+
+               <category><![CDATA[Java]]></category>
+
+               <category><![CDATA[eclipse]]></category>
+
+               <category><![CDATA[eSWT]]></category>
+
+               <category><![CDATA[MTJ]]></category>
+
+               <guid isPermaLink="false">http://blogs.s60.com/?p=3266</guid>
+               <description><![CDATA[My colleague <a href="http://www.gorkem-ercan.com/2009/05/eswt-features-on-eclipse-mtj-rc1.html">Görkem just got some eSWT support features accepted as part of the Mobile Tools for Java</a>. For those who don't know MTJ is a set of tools for Eclipse IDE for Mobile Java development. \r
+\r
+There's now code wizard and code assist features for eSWT development. It's good to see also tools support to appear for this advanced mobile Java UI toolkit!\r
+]]></description>
+                       <content:encoded><![CDATA[<p>My colleague <a href="http://www.gorkem-ercan.com/2009/05/eswt-features-on-eclipse-mtj-rc1.html">Görkem just got some eSWT support features accepted as part of the Mobile Tools for Java</a>. For those who don&#8217;t know MTJ is a set of tools for Eclipse IDE for Mobile Java development. </p>
+<p>There&#8217;s now code wizard and code assist features for eSWT development. It&#8217;s good to see also tools support to appear for this advanced mobile Java UI toolkit!</p>
+]]></content:encoded>
+                       <wfw:commentRss>http://blogs.s60.com/2009/05/eswt-support-as-part-of-eclipse-mtj/feed</wfw:commentRss>
+               </item>
+               <item>
+               <title>We have winners - 101 of them</title>
+               <link>http://blogs.s60.com/2009/05/we-have-winners-101-of-them</link>
+               <comments>http://blogs.s60.com/2009/05/we-have-winners-101-of-them#comments</comments>
+               <pubDate>Fri, 15 May 2009 16:09:51 +0000</pubDate>
+               <dc:creator>Raj Unny</dc:creator>
+               
+               <category><![CDATA[S60 Ambassadors]]></category>
+
+               <category><![CDATA[S60 Living]]></category>
+
+               <category><![CDATA[N-Gage]]></category>
+
+               <guid isPermaLink="false">http://blogs.s60.com/?p=3235</guid>
+               <description><![CDATA[<a href=http://blogs.s60.com/2009/05/we-have-winners-101-of-them><img src=http://blogs.s60.com/wp-content/uploads/2009/05/monstertrianer-300x300.png class=imgtfe hspace=5 align=left width=100  border=0></a><a href="http://blogs.s60.com/wp-content/uploads/2009/05/monstertrianer.png"></a>This week we have winners, winners and more winners.\r
+\r
+The N-Gage: Level 2 campaign closed over the weekend and we had a ton of reports come in. It was the most competition we've ever had in a campaign. Guess <a href="http://blogs.s60.com/2009/02/n-gage-level-2-rewards-details" target="_blank">the prizes</a> were too good to let go without a battle. The last of the reports were read, rated and approved by 06.30 hrs GMT on May 12. And we tallied up the final-rankings right after.\r
+\r
+But hold your horses [...]]]></description>
+                       <content:encoded><![CDATA[<p><a href="http://blogs.s60.com/wp-content/uploads/2009/05/monstertrianer.png"><img class="size-medium wp-image-3237 alignright" src="http://blogs.s60.com/wp-content/uploads/2009/05/monstertrianer-300x300.png" alt="" width="300" height="334" /></a>This week we have winners, winners and more winners.</p>
+<p>The <em>N-Gage: Level 2</em> campaign closed over the weekend and we had a ton of reports come in. It was the most competition we&#8217;ve ever had in a campaign. Guess <a href="http://blogs.s60.com/2009/02/n-gage-level-2-rewards-details" target="_blank">the prizes</a> were too good to let go without a battle. The last of the reports were read, rated and approved by 06.30 hrs GMT on May 12. And we tallied up the final-rankings right after.</p>
+<p>But hold your horses a minute. We&#8217;ve got our final N-Gage report-of-the-week winner to announce first. That honor goes to Ambassador <a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=9166" target="_blank">irfanil</a> and for this report on gaming, wifi, food and maybe a new mobile gaming community: <a href="http://www.s60.com/report/6081" target="_blank">http://www.s60.com/report/6081</a></p>
+<p>Congrats, irfanil!</p>
+<p>Ok, ok.. the very <strong>final, Top-100 ranked Ambassadors for the N-Gage campaign</strong> are:</p>
+<blockquote>
+<ol>
+<li><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=11718" target="_blank"><strong>spenlunc</strong></a></li>
+<li><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=7276" target="_blank">fakhre</a></li>
+<li><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=17463" target="_blank">avanzato1811</a></li>
+<li><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=12182" target="_blank">haritas</a></li>
+<li><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=15388" target="_blank">shaonmra</a></li>
+<li> <a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=11029" target="_blank">ankss</a></li>
+<li> <a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=5830" target="_blank">hritikbhimani</a></li>
+<li> <a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=17430" target="_blank">omer86</a></li>
+<li> <a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=15383" target="_blank">RallyChamp</a></li>
+<li> <a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=17904" target="_blank">cleochris08</a></li>
+<li> JCRomo</li>
+<li> kishok</li>
+<li> ibzter</li>
+<li> Hellblazer</li>
+<li> MarcusC</li>
+<li> irfanil</li>
+<li> BodyZ</li>
+<li> szukoman</li>
+<li> vedant2810</li>
+<li> VISHESH</li>
+<li> Rachaelsmom</li>
+<li> Malaika</li>
+<li> shoebbb</li>
+<li> leenoormohamed</li>
+<li> Verccety</li>
+<li> rdevilliers</li>
+<li> ShaneL</li>
+<li> apurvgupta1</li>
+<li> asad001</li>
+<li> rustymatters</li>
+<li> principino</li>
+<li> ganster</li>
+<li> sanjpt8a</li>
+<li> anayalater</li>
+<li> mirnes1987</li>
+<li> gamemaster28</li>
+<li> peter300</li>
+<li> alexismil</li>
+<li> noryanncomia24</li>
+<li> dork3214</li>
+<li> suyog</li>
+<li> grimsight</li>
+<li> orcthesorc</li>
+<li> klackerz</li>
+<li> VariousFor</li>
+<li> bryanlyt</li>
+<li> highdiver</li>
+<li> drex504</li>
+<li> hnoeprieto</li>
+<li> mrgreen</li>
+<li> jpambrose</li>
+<li> prazmessi</li>
+<li> exmaster</li>
+<li> eli71724</li>
+<li> jdude</li>
+<li> omedina</li>
+<li> irfun4ever</li>
+<li> Azam256</li>
+<li> junaidjdp</li>
+<li> ced961</li>
+<li> tecladista</li>
+<li> GenSoft</li>
+<li> hi2amol</li>
+<li> gqkevyn</li>
+<li> sandymc</li>
+<li> mavilacivert</li>
+<li> Bipul</li>
+<li> j4jony</li>
+<li> stone</li>
+<li> Shani</li>
+<li> davidlian</li>
+<li> ShadoW2009</li>
+<li> Alsiladka</li>
+<li> adityasinghvi</li>
+<li> adreealover</li>
+<li> tonymohd</li>
+<li> poison777</li>
+<li> chensq</li>
+<li> raycau</li>
+<li> mihaialexe</li>
+<li> epouriya</li>
+<li> osornios</li>
+<li> loveckt</li>
+<li> madi84</li>
+<li> maptor</li>
+<li> MoShef</li>
+<li> dim21</li>
+<li> CHAPLINbyCARLOS</li>
+<li> tcarstensen</li>
+<li> sekar</li>
+<li> rnbrulz</li>
+<li> meljet</li>
+<li> carbon14</li>
+<li> H31180Y</li>
+<li> raytfer</li>
+<li> chronorec</li>
+<li> wilstreak</li>
+<li> Chrisosupreme</li>
+<li> maclondon</li>
+<li> drewhy</li>
+</ol>
+</blockquote>
+<ol>
+<li><a href="http://www.s60.com/life/mys60/ambassador/report/displayAmbassadorReports.do?ambassadorId=11718" target="_blank"><strong></strong></a></li>
+</ol>
+<p>A big round of applause to all the winners for a job well done!</p>
+<p>In addition to the initial <a href="http://www.s60.com/life/navi?pbId=763" target="_blank">list of games</a>, we are happy to announce that your new activation-codes are going to be good for:</p>
+<ul>
+<li><a href="http://www.n-gage.com/ngi/ngage/web/g0/en/showroom/gamedetail.424.GameDetail.html" target="_blank">Age Of Empires lll</a></li>
+<li><a href="http://www.n-gage.com/ngi/ngage/web/g0/en/showroom/gamedetail.344.GameDetail.html" target="_blank">Cafe Hold Em Poker</a></li>
+<li><a href="http://www.n-gage.com/ngi/ngage/web/g0/en/showroom/gamedetail.588.GameDetail.html" target="_blank">Monopoly Here &amp; Now: The World Edition</a></li>
+<li><a href="http://www.n-gage.com/ngi/ngage/web/g0/en/showroom/gamedetail.587.GameDetail.html" target="_blank">Need For Speed Undercover</a></li>
+<li><a href="http://www.n-gage.com/ngi/ngage/web/g0/en/showroom/gamedetail.794.GameDetail.html" target="_blank">Pandemonium</a></li>
+<li><a href="http://www.n-gage.com/ngi/ngage/web/g0/en/showroom/gamedetail.626.GameDetail.html" target="_blank">Prince Of Persia</a></li>
+<li><a href="http://www.n-gage.com/ngi/ngage/web/g0/en/showroom/gamedetail.383.GameDetail.html" target="_blank">Real Football 2009</a></li>
+<li><a href="http://www.n-gage.com/ngi/ngage/web/g0/en/showroom/gamedetail.285.GameDetail.html" target="_blank">Worms World Party</a></li>
+</ul>
+<p>We hope that&#8217;s a nice surprise for ya.</p>
+<p>Before I sign off, a reminder - our very last campaign, &#8216;Always S60&#8242;, will be closing on Sunday, May 17, night. So get all those pending reports in before it ends - for this will be your very last chance EVER to submit an S60 Ambassador report. We&#8217;ll post top-rankings for &#8216;Always S60&#8242; next week.</p>
+<p>Have a good weekend, y&#8217;all.</p>
+]]></content:encoded>
+                       <wfw:commentRss>http://blogs.s60.com/2009/05/we-have-winners-101-of-them/feed</wfw:commentRss>
+               </item>
+               <item>
+               <title>Java Runtime for S60 Roadmap</title>
+               <link>http://blogs.s60.com/2009/05/java-runtime-for-s60-roadmap</link>
+               <comments>http://blogs.s60.com/2009/05/java-runtime-for-s60-roadmap#comments</comments>
+               <pubDate>Wed, 13 May 2009 06:21:50 +0000</pubDate>
+               <dc:creator>Aleksi Uotila</dc:creator>
+               
+               <category><![CDATA[Development]]></category>
+
+               <category><![CDATA[Java]]></category>
+
+               <guid isPermaLink="false">http://blogs.s60.com/?p=3229</guid>
+               <description><![CDATA[The Nokia Developer Summit was arranged two weeks ago and there was a <a href="http://events.nokia.com/developersummit/assets/pdf/Java_demo_slides.pdf">presentation of the Java Runtime of S60</a>, about the current state and it's future. The roadmap provides a glimpse to the 2010 release contents of JRT.]]></description>
+                       <content:encoded><![CDATA[<p>The Nokia Developer Summit was arranged two weeks ago and there was a <a href="http://events.nokia.com/developersummit/assets/pdf/Java_demo_slides.pdf">presentation of the Java Runtime of S60</a>, about the current state and it&#8217;s future. The roadmap provides a glimpse to the 2010 release contents of JRT.</p>
+]]></content:encoded>
+                       <wfw:commentRss>http://blogs.s60.com/2009/05/java-runtime-for-s60-roadmap/feed</wfw:commentRss>
+               </item>
+       </channel>
+</rss>
diff --git a/wrt/misc/rss/index.html b/wrt/misc/rss/index.html
new file mode 100644 (file)
index 0000000..b29bac5
--- /dev/null
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+    <head>\r
+        <title></title>\r
+               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+        <script type="text/javascript" src="WRTKit/WRTKit.js"></script>\r
+        <script type="text/javascript" src="FeedUpdateBroker.js"></script>\r
+        <script type="text/javascript" src="RSSReader.js"></script>\r
+        <link rel="stylesheet" href="basic.css" type="text/css">\r
+        <META NAME="Generator" CONTENT="Nokia WRT plug-in for Aptana Studio 2.0.0" />\r
+    </head>\r
+    <body onload="init()">\r
+    </body>\r
+</html>
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/css/style.css b/wrt/misc/rss/preview/css/style.css
new file mode 100644 (file)
index 0000000..2f87e68
--- /dev/null
@@ -0,0 +1,633 @@
+@charset "utf-8";\r
+body {\r
+       background-image: url(../images/Gradient0Background.png);\r
+       background-repeat: repeat-x;\r
+       margin: 0px;\r
+       font-family: "Nokia Sans", "Nokia Sans SemiBold", "Arial Narrow";\r
+       padding: 0px;\r
+       overflow: hidden;\r
+}\r
+.hide{\r
+       display:none;\r
+}\r
+.show{\r
+       display:block;\r
+}\r
+\r
+code{\r
+       background-color: #ffffa6;\r
+       color: #000000;\r
+       padding: 3px;\r
+       display: block;\r
+       font-size: 110%;\r
+       margin: 3px 0px;\r
+}\r
+\r
+#DisplaySFKWrapper{\r
+       overflow: hidden;\r
+}\r
+#DisplayArea {\r
+       margin-right: auto;\r
+       margin-left: auto;\r
+       overflow: hidden;\r
+\r
+}\r
+\r
+#WidgetArea{\r
+       position: relative;\r
+       z-index: 99;\r
+}\r
+#WidgetArea iframe{\r
+       width: 100%;\r
+       height: 100%;\r
+       border: 0px;\r
+       margin-left: auto;\r
+       margin-top: auto;\r
+}\r
+\r
+#WidgetArea.hs_portrait{\r
+       background-image: url(../images/device/360x640/hs-portrait.png);\r
+       background-repeat: no-repeat;\r
+}\r
+\r
+#WidgetArea.hs_landscape{\r
+       background-image: url(../images/device/360x640/hs-landscape.png);\r
+       background-repeat: no-repeat;\r
+}\r
+#WidgetArea.hs_portrait iframe{\r
+       width: 306px;\r
+       height: 76px;\r
+       margin-left: 26px;\r
+       margin-top: 321px;\r
+       overflow: hidden !important;\r
+}\r
+\r
+#WidgetArea.hs_landscape iframe{\r
+       width: 306px;\r
+       height: 76px;\r
+       margin-left: 322px !important;\r
+       margin-top: 151px !important;\r
+       overflow: hidden !important;\r
+}\r
+\r
+#iframeMask\r
+{\r
+       width: 328px;\r
+       height: 100px;\r
+       position: absolute;\r
+       z-index: 900;\r
+       background-image: url(../images/hs-iframeMask.png);\r
+       background-repeat: no-repeat;\r
+       background-position: top left;\r
+}\r
+\r
+#iframeMask:hover\r
+{\r
+       background-repeat: no-repeat;\r
+       background-position: bottom left;\r
+}\r
+\r
+\r
+#WidgetArea.hs_portrait #iframeMask{\r
+       margin-left: 16px !important;\r
+       margin-top: 310px !important;\r
+}\r
+#WidgetArea.hs_landscape #iframeMask{\r
+       margin-left: 312px !important;\r
+       margin-top: 140px !important;\r
+}\r
+\r
+\r
+#SoftKeys{\r
+       height: 50px;\r
+       width: 240px;\r
+       margin-right: auto;\r
+       margin-left: auto;\r
+       margin-top: 10px;\r
+}\r
+\r
+div.clear{\r
+       clear: both;\r
+}\r
+#DeviceDisplayLayout {\r
+       background-repeat: no-repeat;\r
+       background-position: center center;\r
+       margin-right: auto;\r
+       margin-left: auto;\r
+       margin-top: 0px;\r
+       overflow: hidden;\r
+}\r
+\r
+#DeviceDisplayLayout.portrait_240x320 {\r
+       background-image: url(../images/device/240x320/Portrait.png);\r
+       width: 600px;\r
+       height: 536px;\r
+}\r
+\r
+#DeviceDisplayLayout.landscape_240x320 {\r
+       background-image: url(../images/device/240x320/Landscape.png);\r
+       width: 848px;\r
+       height: 408px;\r
+}\r
+\r
+#SoftKeysArea{\r
+       z-index: 101;\r
+       position: relative;\r
+/*     background-image: url(../images/device/menuKeys-bg.png);\r
+       background-repeat: no-repeat;\r
+       background-position: center top;\r
+*/\r
+       background-color: #666666;\r
+}\r
+\r
+#SoftKeysArea ul{\r
+       list-style: none;\r
+       margin: 0px;\r
+       padding: 0px;\r
+       \r
+}\r
+\r
+#SoftKeysArea ul li{\r
+       margin: 0px;\r
+       font-weight: bold;\r
+       font-size: 15px;\r
+       float: left;\r
+       padding: 5px;\r
+}\r
+\r
+\r
+#SoftKeysArea ul li a{\r
+       color: #FFFFFF;\r
+       text-decoration: none;\r
+       display: block;\r
+}\r
+\r
+li#RskLabel{\r
+       text-align: right;\r
+}\r
+\r
+#MenuItemsArea{\r
+       z-index: 100;\r
+       display: none;\r
+}      \r
+\r
+#MenuItemsArea ul{\r
+       margin: 0px;\r
+       padding: 5px;\r
+       list-style-position: inside;\r
+       list-style-image: none;\r
+       list-style-type: none;\r
+       background-color: #CCCCCC;\r
+}\r
+\r
+#MenuItemsArea ul li{\r
+       font-size: 13px;\r
+       font-weight: bold;\r
+}\r
+\r
+#MenuItemsArea li.active{\r
+       background-color: #75ea00;\r
+}\r
+\r
+#MenuItemsArea a{\r
+       color: #000;\r
+       text-decoration: none;\r
+       display: block;\r
+       padding: 5px;\r
+       height: 14px;\r
+}\r
+#MenuItemsArea a:hover{\r
+       background-color: #75ea00;\r
+}\r
+\r
+#MenuItemsArea a.subMenuItem{\r
+       background-image: url(../images/sub-menu-arrow.png);\r
+       background-repeat: no-repeat;\r
+       background-position: right 0px;\r
+}\r
+\r
+#MenuItemsArea a.subMenuItem:hover{\r
+       background-position: right -20px;\r
+}\r
+#MenuItemsArea a.subMenuItem:active{\r
+       background-position: right -40px;\r
+}\r
+\r
+#MenuItemsArea li.active a.subMenuItem{\r
+       background-position: right -20px;\r
+}\r
+div#IconArea{\r
+       display: none;\r
+       font-size: 0.9em;\r
+       font-weight: bold;\r
+       background-repeat: no-repeat;\r
+}\r
+\r
+div#IconArea.portrait240x320{\r
+       background-image: url(../images/statusBar_240x320.png);\r
+}\r
+div#IconArea.landscape240x320{\r
+       background-image: url(../images/statusBar_320x240.png);\r
+}\r
+\r
+div#IconArea.portrait320x240{\r
+       background-image: url(../images/statusBar_320x240.png);\r
+}\r
+div#IconArea.landscape320x240{\r
+       background-image: url(../images/statusBar_240x320.png);\r
+}\r
+\r
+div#IconArea.portrait360x640{\r
+       background-image: url(../images/statusBar_360x640.png);\r
+}\r
+div#IconArea.landscape360x640{\r
+       background-image: url(../images/statusBar_640x360.png);\r
+}\r
+\r
+div#IconArea.landscape800x352{\r
+       background-image: url(../images/statusBar_800x352.png);\r
+}\r
+\r
+\r
+div.IconFile{\r
+       margin-left: auto;\r
+       margin-right: auto;\r
+       text-align: center;\r
+       padding: 20px;\r
+}\r
+\r
+div.IconFile:hover{\r
+       background-image: url(../images/IconArea-hover.png);\r
+       background-position: center center;\r
+       background-repeat: no-repeat;\r
+}\r
+\r
+div.IconFile p{\r
+       margin: 0px;\r
+}\r
+\r
+\r
+\r
+p.highlight span{\r
+       background-color: #fbf7a2;\r
+       font-weight: normal;\r
+       font-size: 0.8em;\r
+       padding: 3px;\r
+}\r
+\r
+/*\r
+       preferences CSS\r
+*/\r
+\r
+div#PreferencesBtn{\r
+       width: 75px;\r
+       height: 85px;\r
+       background-image: url(../images/settings-icon.png);\r
+       position: absolute;\r
+       top: 10px;\r
+       left: 10px;\r
+       background-position: left bottom;\r
+       z-index: 200;\r
+}\r
+\r
+div#PreferencesBtn:hover{\r
+       background-position: left top;\r
+}\r
+\r
+div#loaderDiv{\r
+       padding: 10px;\r
+       font-size: 1.1em;\r
+       position: absolute;\r
+       top: 0px;\r
+       right: 0px;\r
+       display: none;\r
+       z-index: 202;\r
+}\r
+\r
+div#loaderDiv.green{\r
+       background-color: #5abd2b;\r
+       color: #FFFFFF;\r
+}\r
+\r
+div#loaderDiv.yellow{\r
+       background-color: #ffff00;\r
+       color: #000000;\r
+}\r
+\r
+div#orientationIcon{\r
+       background-image: url(../images/normal-orientation-icon.png);\r
+       background-repeat: no-repeat;\r
+       width: 191px;\r
+       height: 72px;\r
+       float: left;\r
+       position: absolute;\r
+       left: 10px;\r
+       top: 0px;\r
+       display: none;\r
+}\r
+div#orientationIcon:hover{\r
+       background-image: url(../images/active-orientation-icon.png);\r
+}\r
+\r
+table{\r
+       border-top: 1px solid #808080;\r
+       border-left: 1px solid #808080;\r
+}\r
+\r
+table a.link{\r
+       background-color: #20c41c;\r
+       color: #ffffff;\r
+       font-weight: bold;\r
+       border: 1px solid #4e872c;\r
+       padding: 3px 2px;\r
+       text-decoration: none;\r
+       font-size: 80%;\r
+}\r
+\r
+table th, table td{\r
+       padding: 6px 5px;\r
+       border-bottom: 1px solid #808080;\r
+       border-right: 1px solid #808080;\r
+       font-size: 0.9em;\r
+}\r
+table th{\r
+       width: 150px;\r
+       text-align: left;\r
+       background-image: url(../images/th-bg-gradient.png);\r
+       background-repeat: repeat-x;\r
+       background-position: left bottom;\r
+}\r
+\r
+#NotificationDiv p{\r
+       color: #ffffff;\r
+       font-size: 95%;\r
+       padding: 5px;\r
+}\r
+\r
+strong{\r
+       color: #eee46c;\r
+}\r
+\r
+#BrowserNotificationBar{\r
+       z-index: 2000;\r
+       background-color: #f2eb8e;\r
+       border-bottom: 2px solid #f0d25e;\r
+       display: none;\r
+       position: absolute;\r
+       left: 0;\r
+       top: 0;\r
+       width: 100%;\r
+       font-size: 80%;\r
+       font-weight: bolder;\r
+       text-align: right;\r
+       margin: 0px;\r
+       opacity: 0.9;\r
+}\r
+#BrowserNotificationBar a{\r
+       height: 10px;\r
+       width: 10px;\r
+       float: right;\r
+       background-image: url(../images/BrowserNotificationBar-Toogle.gif);\r
+       background-position: 0px -10px;\r
+       margin : 4px 15px 0px 10px;\r
+       cursor: hand;\r
+       overflow: hidden;\r
+}\r
+/*\r
+       Event Triggering CSS\r
+*/\r
+\r
+h2{\r
+       font-size: 120%;\r
+       margin: 3px 0px;\r
+       padding: 0px;\r
+}\r
+\r
+#tabs-1, #tabs-2{\r
+       height: 223px;\r
+       overflow: auto;\r
+}\r
+\r
+#connect-charger-icon, #dis-connect-charger-icon{\r
+       background-repeat: no-repeat;\r
+       background-position: left top;\r
+       width: 165px;\r
+       height: 36px;\r
+       margin: 5px auto;\r
+}\r
+\r
+#connect-charger-icon{\r
+       background-image: url(../images/connect-charger-icon.png);\r
+}\r
+\r
+#dis-connect-charger-icon{\r
+       background-image: url(../images/dis-connect-charger-icon.png);\r
+}\r
+\r
+#connect-charger-icon:hover, #dis-connect-charger-icon:hover{\r
+       background-position: left bottom;\r
+}\r
+\r
+div#event-battery, div#event-messaging, div#event-memory{\r
+       float: left;\r
+       width: 150px;\r
+       height: 50px;\r
+       background-position: left top;\r
+       margin: 10px;\r
+       background-repeat: no-repeat;\r
+       border: 1px solid #6f6f6f;\r
+}\r
+\r
+div#event-battery.active:hover, div#event-messaging.active:hover, div#event-memory.active:hover{\r
+       background-position: 0px -50px;\r
+       border: 1px solid #75ea4f;\r
+}\r
+\r
+div#event-messaging.inactive, div#event-memory.inactive{\r
+       background-position: 0px -100px;\r
+       border: 1px solid #676767;\r
+}\r
+\r
+\r
+div#event-battery{\r
+       background-image: url(../images/battery-icon.png);\r
+}\r
+\r
+div#event-messaging{\r
+       background-image: url(../images/messaging-icon.png);\r
+}\r
+\r
+div#event-memory{\r
+       background-image: url(../images/memory-icon.png);\r
+}\r
+\r
+div.ui-panel{\r
+       height:30px;    \r
+}\r
+\r
+a.ui-button, a.ui-button-fixed {\r
+       background:#555555 url(../script/jquery-ui/css/ui-darkness/images/555555_40x100_textures_02_glass_20.png) repeat-x scroll 0 50%;\r
+       border:1px solid #666666;\r
+       color:#EEEEEE;\r
+       cursor:pointer;\r
+       font-size:0.9em;\r
+       font-weight:bolder;\r
+       line-height:1.4em;\r
+       margin:0.5em 8px 0.5em 0;\r
+       padding:0.2em 0.6em 0.3em;\r
+       text-decoration: none;\r
+}\r
+a.ui-button:hover, a.ui-button-fixed:hover {\r
+       background:#0078A3 url(../script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png) repeat-x scroll 0 50%;\r
+       border:1px solid #4bd94b;\r
+       color:#FFFFFF;\r
+}\r
+\r
+a.ui-button-fixed{\r
+       float: left;\r
+       padding: 0.4em 0.6em 0.8em;\r
+       text-align: center;\r
+       width: 145px !important;\r
+}\r
+\r
+div#slider-value-panel{\r
+       text-align: center;\r
+       margin-top: 10px;\r
+}\r
+\r
+div#slider-value-panel span{\r
+       padding: 3px;\r
+       background:#0078A3 url(../script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png) repeat-x scroll 0 50%;\r
+       border:1px solid #4bd94b;\r
+       color:#FFFFFF;\r
+       font-weight: bolder;\r
+}\r
+\r
+\r
+/*\r
+       Console UI\r
+*/\r
+#preview-ui-top{\r
+       overflow:auto;\r
+}\r
+\r
+#preview-ui-bottom{\r
+       overflow:hidden;\r
+       display: none;\r
+}\r
+#preview-ui-bottom-header{\r
+       background-color: #aeaeae;\r
+       background-image: url(../images/console-icon.gif);\r
+       background-repeat: repeat-x;\r
+       background-position: 0px -28px;\r
+}\r
+span#Console-Toggle-Button{\r
+       height: 9px;\r
+       width: 15px;\r
+       float: right;\r
+       background-repeat: no-repeat;\r
+       margin : 12px 8px 0px 0px;\r
+       cursor: hand;\r
+}\r
+\r
+span#Console-Toggle-Button.open{\r
+       background-position: 0px 0px;\r
+       background-image: url(../images/console-close-icon.png);\r
+}\r
+\r
+span#Console-Toggle-Button.open:hover{\r
+       background-position: 0px -9px;\r
+}\r
+\r
+span#Console-Toggle-Button.open:active{\r
+       background-position: 0px -18px;\r
+}\r
+\r
+\r
+span#Console-Toggle-Button.close{\r
+       background-position: 0px 0px;\r
+       background-image: url(../images/console-open-icon.png);\r
+}\r
+\r
+span#Console-Toggle-Button.close:hover{\r
+       background-position: 0px -9px;\r
+}\r
+\r
+span#Console-Toggle-Button.close:active{\r
+       background-position: 0px -18px;\r
+}\r
+\r
+\r
+span#Console-Clear-Button{\r
+       height: 16px;\r
+       width: 39px;\r
+       float: right;\r
+       background-image: url(../images/console-clear-button.png);\r
+       background-repeat: no-repeat;\r
+       margin : 10px 10px 0px 0px;\r
+       cursor: hand;\r
+}\r
+span#Console-Clear-Button:hover{\r
+       background-position: -0px -16px;\r
+}\r
+\r
+#preview-ui-bottom-body{\r
+       overflow:auto;\r
+       background-color: #ffffff;\r
+       display: none;\r
+}\r
+\r
+#preview-ui-bottom-body p{\r
+       font-family: "Courier New", Courier, monospace;\r
+       font-size: 11px;\r
+       padding: 2px 5px;\r
+       border-bottom: 1px solid silver;\r
+       margin: 0px;\r
+}\r
+\r
+#preview-ui-bottom-body p.log{\r
+\r
+}\r
+\r
+#preview-ui-bottom-body p.info{\r
+       background-image: url(../images/infoIcon.png);\r
+       background-repeat: no-repeat;\r
+       background-position: 5px center;\r
+       padding-left: 26px;\r
+}\r
+#preview-ui-bottom-body p.warn{\r
+       background: #00ffff url(../images/warningIcon.png);\r
+       background-repeat: no-repeat;\r
+       background-position: 5px center;\r
+       padding-left: 26px;\r
+}\r
+#preview-ui-bottom-body p.error{\r
+       background: #ffffe0 url(../images/errorIcon.png);\r
+       background-repeat: no-repeat;\r
+       background-position: 5px center;\r
+       padding-left: 26px;\r
+       color: #ff0000;\r
+}\r
+\r
+\r
+#preview-ui-bottom-header div{\r
+       float: left;\r
+       margin: 9px;\r
+       color: #ffffff;\r
+       font-size: 11px;\r
+       font-weight: bolder;\r
+       font-family: "Arial";\r
+}\r
+\r
+\r
+span#wrt-help{\r
+       height: 28px;\r
+       width: 28px;\r
+       float: right;\r
+       background-repeat: no-repeat;\r
+       background-image: url(../images/wrt-help-icon.png);\r
+}\r
+\r
+span#wrt-help:hover{\r
+       background-position: -28px 0px;\r
+}
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/data/appManager_data.js b/wrt/misc/rss/preview/data/appManager_data.js
new file mode 100644 (file)
index 0000000..560c549
--- /dev/null
@@ -0,0 +1,99 @@
+/**
+ * SAPI Sample Data - AppManager
+ */
+
+
+(function(){  
+       
+    var data_apps = [
+    {
+        "Path": "C:\\private\\10282822\\com.nokia.forum.widget.accuwidget\\AccuWidget\\accuwidget.xhtml",
+        "Uid": "0x2000dad2",
+        "Caption": "AccuWidget",
+        "ShortCaption": "AccuWidget"
+    }, {
+        "Path": "C:\\private\\10282822\\com.nokia.wrt.tools.sapi.CreatorWidget\\CreatorWidget\\index.html",
+        "Uid": "0x2000dadb",
+        "Caption": "Creator Widget",
+        "ShortCaption": "Creator Widget"
+       },{\r
+        "Path": "Z:\\sys\\bin\\lcapp.exe",\r
+        "Uid": "0x10283139",\r
+        "Caption": "Location",\r
+        "ShortCaption": "Location"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\javadrmmanager.exe",\r
+        "Uid": "0x1028246e",\r
+        "Caption": "javadrmmanager",\r
+        "ShortCaption": "javadrmmanager"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\iaupdater.exe",\r
+        "Uid": "0x2000f85d",\r
+        "Caption": "iaupdater",\r
+        "ShortCaption": "iaupdater"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\iaupdate.exe",\r
+        "Uid": "0x2000f85a",\r
+        "Caption": "App. update",\r
+        "ShortCaption": "App. update"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\SAFlash.exe",\r
+        "Uid": "0x101fd693",\r
+        "Caption": "Flash Lite",\r
+        "ShortCaption": "Flash Lite"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\eswt.exe",\r
+        "Uid": "0x101f9516",\r
+        "Caption": "eswt",\r
+        "ShortCaption": "eswt"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\DRMRightsManager.exe",\r
+        "Uid": "0x101f85c7",\r
+        "Caption": "Licences",\r
+        "ShortCaption": "Licences"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\RoapApp.exe",\r
+        "Uid": "0x10008d64",\r
+        "Caption": "Licence download",\r
+        "ShortCaption": "Licence download"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\DdViewer.exe",\r
+        "Uid": "0x10008d3f",\r
+        "Caption": "Download",\r
+        "ShortCaption": "Download"\r
+       }, {
+               "Path": "Z:\\sys\\bin\\MediaGallery2.exe",
+               "Uid": "0x101f8599",
+               "Caption": "Gallery",
+               "ShortCaption": "Gallery"
+    }, {\r
+        "Path": "Z:\\sys\\bin\\CodViewer.exe",\r
+        "Uid": "0x10008d4a",\r
+        "Caption": "Download",\r
+        "ShortCaption": "Download"\r
+    }];\r
+               
+               
+               
+    var data_packages = [{\r
+        "PackageName": "Mobiola Screen Capture",\r
+        "Uid": "0x2000be16",\r
+        "Version": "3:0",\r
+        "Vendor": "Warelex LLC",\r
+        "Drive": "E"\r
+    }, {\r
+        "PackageName": "Facebook",\r
+        "Uid": "0x20011184",\r
+        "Version": "1:0",\r
+        "Vendor": "Nokia Corporation",\r
+        "Drive": "C"\r
+    }];\r
+       
+       
+       /**
+        * register data!
+        */
+       device.implementation.loadData('Service.AppManager', 'Application', data_apps);
+       device.implementation.loadData('Service.AppManager', 'UserInstalledPackage', data_packages);
+
+})()
diff --git a/wrt/misc/rss/preview/data/calendar_data.js b/wrt/misc/rss/preview/data/calendar_data.js
new file mode 100644 (file)
index 0000000..4235238
--- /dev/null
@@ -0,0 +1,136 @@
+/**
+ * SAPI Sample Data - Calendar
+ */
+
+
+(function(){  
+
+
+    var data_entries = [{\r
+        "Type": "ToDo",\r
+        "Summary": "Face head on my problems",\r
+        "Description": "Face head on my problems",\r
+        "EndTime": "Wednesday, 15 April, 2009 12:00:00 am",\r
+        "id": "ihiwykmkjzcowqEnnEbeDnJpzWhPWrgNpNgudjdwgPfisvvQscuibwwSmgkdhdiBzIfyqvfIBmiYavfklygBssoKmWpJuxftbkdLsfmuwudczlJikohlFbQecaMlbaPnwyddzqXcjrhldXignjYtWyfqfzbpcxlH",\r
+        "LocalId": "34",\r
+        "Priority": 1,\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "ToDo",\r
+        "Summary": "Believe myself first",\r
+        "Description": "Believe myself first",\r
+        "EndTime": "Sunday, 22 March, 2009 12:00:00 am",\r
+        "AlarmTime": "Saturday, 21 March, 2009 11:30:00 pm",\r
+        "id": "rjutskelXlDdoaebCyPzjopwgxMxluuLesqqsrykvIxrFLbxvuhBImBbhqwlSRfFtvWktkrvqpjfvxCoBxpsDlbgugvqjudregvyoebgtihRiSarcnryZovfwyHTcmXqZdjdrVPvSGnqroYgXdtpafqxTzrnkMKpzLihcxfaxwmdrkuGifsgbglhyfwqmtiPyzpeuxvKFfnrmhaqnrUarustDySMgKakjpFpkhtbonmTyBvhlzv",\r
+        "LocalId": "35",\r
+        "Priority": 1,\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "Meeting",\r
+        "Summary": "Meeting with the professor",\r
+        "Description": "Meeting with the professor",\r
+        "StartTime": "Monday, 23 March, 2009 11:56:00 am",\r
+        "EndTime": "Monday, 23 March, 2009 2:31:00 pm",\r
+        "AlarmTime": "Monday, 23 March, 2009 11:01:00 am",\r
+        "InstanceStartTime": "Monday, 23 March, 2009 11:56:00 am",\r
+        "InstanceEndTime": "Monday, 23 March, 2009 2:31:00 pm",\r
+        "id": "hifXqeBiUOlelbioirmeoniClarsiybNhNxdlQbqBzcngmhxtzlRoebdeYxupjaxnapugxrKnmhGjzdwtChVydzwOdwrHPokjqjvyaPwbqCjdtpukjcoyjdkjkkrndZzwjCYQPxgvereyuktnOtIndpoyimtjzPzEnkxCfzhxaDTvUgclfpsfbtgtvwk",\r
+        "LocalId": "31",\r
+        "Priority": 0,\r
+        "Organizer": {\r
+            "CommonName": "Frideswide Farprington",\r
+            "Address": "Christian.Wilbar@Melleva.com"\r
+        },\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "Meeting",\r
+        "Summary": "Work issues",\r
+        "Description": "Work issues",\r
+        "StartTime": "Saturday, 28 March, 2009 1:22:00 am",\r
+        "EndTime": "Saturday, 28 March, 2009 7:56:00 am",\r
+        "AlarmTime": "Saturday, 28 March, 2009 12:49:00 am",\r
+        "InstanceStartTime": "Saturday, 28 March, 2009 1:22:00 am",\r
+        "InstanceEndTime": "Saturday, 28 March, 2009 7:56:00 am",\r
+        "id": "symstNdkqdznkcettruqqyefdjkzikeBXmcamanzrygnusjyFYheprwaxksxzrqsdbnkTqemtsqqZbqnbbircyqtohmymWvqEc",\r
+        "LocalId": "30",\r
+        "Priority": 0,\r
+        "Organizer": {\r
+            "CommonName": "Margery Worthley",\r
+            "Address": "Grace.Wilbar@Peger.com"\r
+        },\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "Reminder",\r
+        "Summary": "Remeber to harvest corn field",\r
+        "Description": "Remeber to harvest corn field",\r
+        "StartTime": "Thursday, 02 April, 2009 12:00:00 am",\r
+        "AlarmTime": "Wednesday, 01 April, 2009 11:52:00 pm",\r
+        "id": "uwtxgvTsowwGbnsgboEprwxvmihUkkDczxeohsnsXpUzUaHgjBJmjhpfOjaoyvRrjwIkgafrcszvbCSooutemfhejtyfonHviomgouimvPtexgdWmzDgGP",\r
+        "LocalId": "36",\r
+        "Priority": 0,\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "Reminder",\r
+        "Summary": "Remeber to wax cross country skiis",\r
+        "Description": "Remeber to wax cross country skiis",\r
+        "StartTime": "Monday, 06 April, 2009 12:00:00 am",\r
+        "AlarmTime": "Sunday, 05 April, 2009 11:44:00 pm",\r
+        "id": "ivunsxcjmrsdaKkdtbqpskSIGIFOftMLwTuvCbiHmrkJnxdZgsapbqhoxNrhsbheyztgyOfvdqGrIlawVrvEwnYjnzoSlyimcxlKcSqetcruzf",\r
+        "LocalId": "37",\r
+        "Priority": 0,\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "DayEvent",\r
+        "Summary": "Go the bank",\r
+        "Description": "Go the bank",\r
+        "StartTime": "Monday, 06 April, 2009 6:16:00 pm",\r
+        "EndTime": "Monday, 06 April, 2009 7:19:00 pm",\r
+        "AlarmTime": "Monday, 06 April, 2009 6:07:00 pm",\r
+        "id": "QvcvlpXpflemwqjtniukLPsjkSengqBEfajerjclkrwysdy",\r
+        "LocalId": "33",\r
+        "Priority": 0,\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "DayEvent",\r
+        "Summary": "School day",\r
+        "Description": "School day",\r
+        "StartTime": "Thursday, 16 April, 2009 5:27:00 pm",\r
+        "EndTime": "Thursday, 16 April, 2009 9:39:00 pm",\r
+        "AlarmTime": "Thursday, 16 April, 2009 4:35:00 pm",\r
+        "id": "zmHupjqghnkEepdfghSCcsmFnrrducaqEyqyetauTcmxscSptpchgimxeEnOzxdiyEldyrikjmxvgzibauvjQfdbzgoumlVyAjqfhqlgpTtbiffqdzgpzWrquiyAdidvccvffzZxmpgjjbjUCqyeuBiikiedtclqabbsdazAbb",\r
+        "LocalId": "32",\r
+        "Priority": 0,\r
+        "Replication": "Open"\r
+    }];\r
+       
+       
+
+       name = "C:MyCalendar";
+       id = 200;
+       localId = 20;
+               
+/** start data block **/       
+var data2 = [];
+       
+       for (var i = 1; i <= 10; i++) {
+               data2.push({
+                       Type            : 'Meeting',
+                       id                      : id++,
+                       LocalId         : localId++,
+                       CalendarName: name,
+                       StartTime       : new Date('3/'+i+'/2009'),
+                       Endtime         : new Date('3/'+(1+i)+'/2009'),
+                       Description     : 'sample meeting ' + i
+               });
+       }
+/** end data block **/ 
+
+
+
+       /**
+        * register data!
+        */
+       device.implementation.loadData('Service.Calendar', 'C:Calendar', data_entries);
+       device.implementation.loadData('Service.Calendar', 'C:MyCalendar', data2);
+
+})()
diff --git a/wrt/misc/rss/preview/data/contact_data.js b/wrt/misc/rss/preview/data/contact_data.js
new file mode 100644 (file)
index 0000000..8db8bcf
--- /dev/null
@@ -0,0 +1,158 @@
+/**
+ * SAPI Sample Data - Contacts
+ */
+
+(function(){
+
+
+       var data_contacts = [{\r
+           "id": "",\r
+           "FirstName": {\r
+               "Label": "First name",\r
+               "Value": "Alice"\r
+           },\r
+           "LastName": {\r
+               "Label": "Last name",\r
+               "Value": "Moller"\r
+           },\r
+           "LandPhoneGen": {\r
+               "Label": "Telephone",\r
+               "Value": "0230328732"\r
+           },\r
+           "SyncClass": {\r
+               "Label": "Synchronisation",\r
+               "Value": "private"\r
+           }\r
+       }, {\r
+           "id": "",\r
+           "FirstName": {\r
+               "Label": "First name",\r
+               "Value": "Amy"\r
+           },\r
+           "LastName": {\r
+               "Label": "Last name",\r
+               "Value": "Kammer"\r
+           },\r
+           "LandPhoneGen": {\r
+               "Label": "Telephone",\r
+               "Value": "0492303652"\r
+           },\r
+           "SyncClass": {\r
+               "Label": "Synchronisation",\r
+               "Value": "private"\r
+           }\r
+       }, {\r
+           "id": "",\r
+           "SyncClass": {\r
+               "Label": "Synchronisation",\r
+               "Value": "private"\r
+           },\r
+           "LastName": {\r
+               "Label": "Last name",\r
+               "Value": "Bierman"\r
+           },\r
+           "FirstName": {\r
+               "Label": "First name",\r
+               "Value": "Michael"\r
+           },\r
+           "MobilePhoneGen": {\r
+               "Label": "Mobile",\r
+               "Value": "4084256071"\r
+           }\r
+       }, {\r
+           "id": "",\r
+           "FirstName": {\r
+               "Label": "First name",\r
+               "Value": "Ralph"\r
+           },\r
+           "LastName": {\r
+               "Label": "Last name",\r
+               "Value": "Jacmor"\r
+           },\r
+           "LandPhoneGen": {\r
+               "Label": "Telephone",\r
+               "Value": "0432443343"\r
+           },\r
+           "SyncClass": {\r
+               "Label": "Synchronisation",\r
+               "Value": "private"\r
+           }\r
+       }, {\r
+           "id": "",\r
+           "FirstName": {\r
+               "Label": "First name",\r
+               "Value": "Robert"\r
+           },\r
+           "LastName": {\r
+               "Label": "Last name",\r
+               "Value": "Richards"\r
+           },\r
+           "LandPhoneGen": {\r
+               "Label": "Telephone",\r
+               "Value": "+4443433434"\r
+           },\r
+           "SyncClass": {\r
+               "Label": "Synchronisation",\r
+               "Value": "private"\r
+           }\r
+       }, {\r
+           "id": "",\r
+           "FirstName": {\r
+               "Label": "First name",\r
+               "Value": "Ursula"\r
+           },\r
+           "LastName": {\r
+               "Label": "Last name",\r
+               "Value": "West"\r
+           },\r
+           "LandPhoneGen": {\r
+               "Label": "Telephone",\r
+               "Value": "0213443434"\r
+           },\r
+           "SyncClass": {\r
+               "Label": "Synchronisation",\r
+               "Value": "private"\r
+           }\r
+       }];  
+       
+
+    var data_groups = [{\r
+        "id": "",\r
+        "GroupLabel": "TestGroupName"\r
+    }, {\r
+        "id": "",\r
+        "GroupLabel": "Silver club #5488",\r
+        "Contents": ["", "", "", "", "", ""]\r
+    }, {\r
+        "id": "",\r
+        "GroupLabel": "The buddies #9926"\r
+    }, {\r
+        "id": "",\r
+        "GroupLabel": "Football team #5940",\r
+        "Contents": ["", ""]\r
+    }, {\r
+        "id": "",\r
+        "GroupLabel": "Science group #2742",\r
+        "Contents": ["", "", "", "", "", ""]\r
+    }, {\r
+        "id": "",\r
+        "GroupLabel": "Rockers #3062",\r
+        "Contents": ["", "", "", "", "", ""]\r
+    }];\r
+               
+               
+    var data_database = [{\r
+        "DBUri": "cntdb://c:contacts.cdb"\r
+    },{
+        "DBUri": "sim://global_adn"
+       }];
+    
+    
+    /**
+     * register data!
+     */
+    device.implementation.loadData('Service.Contact', 'Contact', data_contacts);
+    device.implementation.loadData('Service.Contact', 'Group', data_groups);
+    device.implementation.loadData('Service.Contact', 'Database', data_database);
+    
+})()
diff --git a/wrt/misc/rss/preview/data/landmarks_data.js b/wrt/misc/rss/preview/data/landmarks_data.js
new file mode 100644 (file)
index 0000000..efa8bb2
--- /dev/null
@@ -0,0 +1,339 @@
+/**\r
+ * SAPI Sample Data - Landmark\r
+ */\r
+\r
+(function(){\r
+\r
+       var data_landmark =     [{\r
+               "id":"47",\r
+               "LandmarkName":"Best food ever!",\r
+               "LandmarkPosition":{\r
+                       "Latitude":-17.5423,\r
+                       "Longitude":-54.8163,\r
+                       "Altitude":82,\r
+                       "HAccuracy":2,\r
+                       "VAccuracy":4\r
+               },\r
+               "CategoryInfo":["1"],\r
+               "LandmarkDesc":"Place looks really nice.",\r
+               "LandmarkFields":{\r
+                       "Country":"Finland",\r
+                       "City":"Tokyo",\r
+                       "AreaCode":"FI-70100",\r
+                       "Street":"Plains Road",\r
+                       "Telephone":"+4443433434"\r
+               }\r
+       },{\r
+               "id":"44",\r
+               "LandmarkName":"Food store",\r
+               "LandmarkPosition":{\r
+                       "Latitude":65.4233,\r
+                       "Longitude":-93.4225,\r
+                       "Altitude":54,\r
+                       "HAccuracy":1,\r
+                       "VAccuracy":1\r
+               },\r
+               "CategoryInfo":["10"],\r
+               "LandmarkDesc":"Words are not enough to describe this landmark",\r
+               "LandmarkFields":{\r
+                       "Country":"Finland",\r
+                       "City":"St. Michel",\r
+                       "AreaCode":"11233",\r
+                       "Street":"McKenzie Avenue",\r
+                       "Telephone":"0432443343"\r
+               }\r
+       },{\r
+               "id":"40",\r
+               "LandmarkName":"Hospital",\r
+               "LandmarkPosition":{\r
+                       "Latitude":-2.4616,\r
+                       "Longitude":51.4958,\r
+                       "Altitude":43,\r
+                       "HAccuracy":3,\r
+                       "VAccuracy":3\r
+               },\r
+               "CategoryInfo":["13"],\r
+               "LandmarkDesc":"Place looks really nice.",\r
+               "LandmarkFields":{\r
+                       "Country":"United States of America",\r
+                       "City":"London",\r
+                       "AreaCode":"11233",\r
+                       "Street":"Pukershire Avenue",\r
+                       "Telephone":"0565645455"\r
+               }\r
+       },{\r
+               "id":"45",\r
+               "LandmarkName":"John’s home",\r
+               "LandmarkPosition":{\r
+                       "Latitude":36.9077,\r
+                       "Longitude":134.4066,\r
+                       "Altitude":42,\r
+                       "HAccuracy":3,\r
+                       "VAccuracy":5\r
+               },\r
+               "CategoryInfo":["14"],\r
+               "LandmarkDesc":"This is my favorite place",\r
+               "LandmarkFields":{\r
+                       "City":"Los Angeles",\r
+                       "AreaCode":"00310",\r
+                       "Street":"McKenzie Lane",\r
+                       "Telephone":"+35854553456",\r
+                       "Country":"Japan"\r
+               }\r
+       },{\r
+               "id":"48",\r
+               "LandmarkName":"John’s home",\r
+               "LandmarkPosition":{\r
+                       "Latitude":17.1817,\r
+                       "Longitude":113.4183,\r
+                       "Altitude":29,\r
+                       "HAccuracy":3,\r
+                       "VAccuracy":2\r
+               },\r
+               "CategoryInfo":["3"],\r
+               "LandmarkDesc":"Words are not enough to describe this landmark",\r
+               "LandmarkFields":{\r
+                       "Country":"Norway",\r
+                       "City":"St. Petersburg",\r
+                       "AreaCode":"FI-70100",\r
+                       "Street":"Windsor Road",\r
+                       "Telephone":"+4465665456"\r
+               }\r
+       },{\r
+               "id":"49",\r
+               "LandmarkName":"Nice beach",\r
+               "LandmarkPosition":{\r
+                       "Latitude":-22.0327,\r
+                       "Longitude":-33.0193,\r
+                       "Altitude":57,\r
+                       "HAccuracy":1,\r
+                       "VAccuracy":0\r
+               },\r
+               "CategoryInfo":["7"],\r
+               "LandmarkDesc":"This is my favorite place",\r
+               "LandmarkFields":{\r
+                       "Telephone":"+35854553456",\r
+                       "Country":"Finland",\r
+                       "City":"Bangkok",\r
+                       "AreaCode":"00310",\r
+                       "Street":"Highland Avenue Extension"\r
+               }\r
+       },{\r
+               "id":"42",\r
+               "LandmarkName":"Nice view",\r
+               "LandmarkPosition":{\r
+                       "Latitude":-1.5979999999999999,\r
+                       "Longitude":177.5871,\r
+                       "Altitude":23,\r
+                       "HAccuracy":1,\r
+                       "VAccuracy":4\r
+               },\r
+               "CategoryInfo":["5"],\r
+               "LandmarkDesc":"Words are not enough to describe this landmark",\r
+               "LandmarkFields":{\r
+                       "Country":"Thailand",\r
+                       "City":"St. Petersburg",\r
+                       "AreaCode":"00310",\r
+                       "Street":"Pukershire Avenue",\r
+                       "Telephone":"0435445454"\r
+               }\r
+       },{\r
+               "id":"41",\r
+               "LandmarkName":"Summer cottage",\r
+               "LandmarkPosition":{\r
+                       "Latitude":-80.6438,\r
+                       "Longitude":78.5627,\r
+                       "Altitude":60,\r
+                       "HAccuracy":1,\r
+                       "VAccuracy":4\r
+               },\r
+               "CategoryInfo":["11"],\r
+               "LandmarkDesc":"Place looks really nice.",\r
+               "LandmarkFields":{\r
+                       "Country":"Thailand",\r
+                       "City":"Havana",\r
+                       "AreaCode":"99002",\r
+                       "Street":"Eastman Street",\r
+                       "Telephone":"+4465665456"\r
+               }\r
+       },{\r
+               "id":"43",\r
+               "LandmarkName":"Summer cottage",\r
+               "LandmarkPosition":{\r
+                       "Latitude":23.6319,\r
+                       "Longitude":-141.5323,\r
+                       "Altitude":60,\r
+                       "HAccuracy":2,\r
+                       "VAccuracy":2\r
+               },\r
+               "CategoryInfo":["1"],\r
+               "LandmarkDesc":"This is my favorite place",\r
+               "LandmarkFields":{\r
+                       "Country":"Norway",\r
+                       "City":"Nairobi",\r
+                       "AreaCode":"FI-70100",\r
+                       "Street":"Windsor Avenue",\r
+                       "Telephone":"0785434444"\r
+               }\r
+       },{\r
+               "id":"46",\r
+               "LandmarkName":"Work place",\r
+               "LandmarkPosition":{\r
+                       "Latitude":1.7755,\r
+                       "Longitude":66.132,\r
+                       "Altitude":36,\r
+                       "HAccuracy":5,\r
+                       "VAccuracy":5\r
+               },\r
+               "CategoryInfo":["3"],\r
+               "LandmarkDesc":"Delicious strawberries sold here. Must visit again sometime!",\r
+               "LandmarkFields":{\r
+                       "Country":"Kenya",\r
+                       "City":"Havana",\r
+                       "AreaCode":"99002",\r
+                       "Street":"Barnes Street",\r
+                       "Telephone":"0342303777"\r
+               }\r
+       }];\r
+       \r
+       \r
+       var data_category =     [{\r
+               "id":"1",\r
+               "CategoryName":"Accommodation",\r
+               "GlobalId":"3000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16384,\r
+               "IconMaskIndex":16385\r
+       },{\r
+\r
+               "id":"2",\r
+               "CategoryName":"Businesses",\r
+               "GlobalId":"6000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16386,\r
+               "IconMaskIndex":16387\r
+       },{\r
+               "id":"3",\r
+               "CategoryName":"Telecommunications",\r
+               "GlobalId":"9000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16388,\r
+               "IconMaskIndex":16389\r
+       },{\r
+               "id":"4",\r
+               "CategoryName":"Education",\r
+               "GlobalId":"12000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16390,\r
+               "IconMaskIndex":16391\r
+       },{\r
+               "id":"5",\r
+               "CategoryName":"Entertainment",\r
+               "GlobalId":"15000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16392,\r
+               "IconMaskIndex":16393\r
+       },{\r
+               "id":"6",\r
+               "CategoryName":"Food and drink",\r
+               "GlobalId":"18000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16394,\r
+               "IconMaskIndex":16395\r
+       },{\r
+               "id":"7",\r
+               "CategoryName":"Geographical locations",\r
+               "GlobalId":"21000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16396,\r
+               "IconMaskIndex":16397\r
+       },{\r
+               "id":"8",\r
+               "CategoryName":"Outdoor activities",\r
+               "GlobalId":"24000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16398,\r
+               "IconMaskIndex":16399\r
+       },{\r
+               "id":"9",\r
+               "CategoryName":"People",\r
+               "GlobalId":"27000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16400,\r
+               "IconMaskIndex":16401\r
+       },{\r
+               "id":"10",\r
+               "CategoryName":"Public services",\r
+               "GlobalId":"30000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16402,\r
+               "IconMaskIndex":16403\r
+       },{\r
+               "id":"11",\r
+               "CategoryName":"Places of worship",\r
+               "GlobalId":"33000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16404,\r
+               "IconMaskIndex":16405\r
+       },{\r
+               "id":"12",\r
+               "CategoryName":"Shopping",\r
+               "GlobalId":"36000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16406,\r
+               "IconMaskIndex":16407\r
+       },{\r
+               "id":"13",\r
+               "CategoryName":"Sightseeing",\r
+               "GlobalId":"39000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16408,\r
+               "IconMaskIndex":16409\r
+       },{\r
+               "id":"14",\r
+               "CategoryName":"Sports",\r
+               "GlobalId":"42000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16410,\r
+               "IconMaskIndex":16411\r
+       },{\r
+               "id":"15",\r
+               "CategoryName":"Transport",\r
+               "GlobalId":"45000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16412,\r
+               "IconMaskIndex":16413\r
+       },{\r
+               "id":"24",\r
+               "CategoryName":"All places",\r
+               "IconFile":"Z:\resource\apps\smart2go.mif",\r
+               "IconIndex":16384,\r
+               "IconMaskIndex":16385\r
+       },{\r
+               "id":"25",\r
+               "CategoryName":"Nokia maps",\r
+               "IconFile":"Z:\resource\apps\LmkUi.mif",\r
+               "IconIndex":16402,\r
+               "IconMaskIndex":16403\r
+       }];\r
+       \r
+       var data_database =     [{\r
+               "DatabaseURI":"file://C:eposlm.ldb",\r
+               "DatabaseName":"",\r
+               "DbProtocol":"file",\r
+               "DbActive":false,\r
+               "DbSize":226,\r
+               "DbDrive":"C",\r
+               "DbMedia":9\r
+       }]; \r
+\r
+\r
+    /**\r
+     * register data!\r
+     */\r
+    device.implementation.loadData('Service.Landmarks', 'Landmark', data_landmark);\r
+    device.implementation.loadData('Service.Landmarks', 'Category', data_category);\r
+    device.implementation.loadData('Service.Landmarks', 'Database', data_database);\r
+\r
+})()\r
+       
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/data/location_data.js b/wrt/misc/rss/preview/data/location_data.js
new file mode 100644 (file)
index 0000000..7543bc9
--- /dev/null
@@ -0,0 +1,39 @@
+/**\r
+ * SAPI Sample Data - Location\r
+ */\r
+\r
+(function(){\r
+\r
+               \r
+var data_basicLocationInformation = {\r
+                       "Longitude":77.694589331833,\r
+                       "Latitude":12.942209068513,\r
+                       "Altitude":836.5\r
+               }\r
+               \r
+var data_genericLocationInfo = {\r
+                       "Longitude":77.694546416505,\r
+                       "Latitude":12.942233711299,\r
+                       "Altitude":836,\r
+                       "HorizontalSpeed":0.05999999865889549,\r
+                       "HorizontalSpeedError":1.0199999809265137,\r
+                       "SatelliteNumView":11,\r
+                       "SatelliteNumViewUsed":7,\r
+                       "Heading":203.89999389648438,\r
+                       "HeadingError":2.89898989898232,\r
+                       "MagneticCourse":205.89999389600000,\r
+                       "MagneticCourseError":1.09090389600000,\r
+                       "TrueCourse":203.89999389648438,\r
+                       "TrueCourseError":2.89898989898232,\r
+                       "MagneticHeading":205.89999389600000,\r
+                       "MagneticHeadingError":1.09090389600000\r
+               }; \r
+\r
+    /**\r
+     * register data!\r
+     */\r
+    device.implementation.loadData('Service.Location', 'BasicLocationInformation', data_basicLocationInformation);\r
+    device.implementation.loadData('Service.Location', 'GenericLocationInfo', data_genericLocationInfo);\r
+\r
+})()\r
+       
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/data/logging_data.js b/wrt/misc/rss/preview/data/logging_data.js
new file mode 100644 (file)
index 0000000..b2de1eb
--- /dev/null
@@ -0,0 +1,377 @@
+/**\r
+ * SAPI Sample Data - Logging\r
+ */\r
+\r
+(function(){\r
+\r
+\r
+       var logging_data = [{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":5518,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:42 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"5270443",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"30",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":472,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:42 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"1247463",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"29",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":1914,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:42 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"8759891",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"28",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":3130,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:32 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"3200343",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"27",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":4128,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:32 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"2101692",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"26",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":2012,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:32 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"8813355",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"25",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:24 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"8092875",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"24",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:24 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"3702771",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"23",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:24 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"2680939",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"22",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:11 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"1075503",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"21",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:11 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"9781533",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"20",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:11 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"4185107",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"19",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":4,\r
+               "RemoteParty":"Mobile Office",\r
+               "EventDuration":90,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:18:37 am",\r
+               "Subject":"",\r
+               "PhoneNumber":"",\r
+               "Description":"Packet Data",\r
+               "Link":0,\r
+               "id":"18",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":4,\r
+               "RemoteParty":"Mobile Office",\r
+               "EventDuration":80,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:15:30 am",\r
+               "Subject":"",\r
+               "PhoneNumber":"",\r
+               "Description":"Packet Data",\r
+               "Link":0,\r
+               "id":"18",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":4,\r
+               "RemoteParty":"Mobile Office",\r
+               "EventDuration":16,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:12:33 am",\r
+               "Subject":"",\r
+               "PhoneNumber":"",\r
+               "Description":"Packet Data",\r
+               "Link":0,\r
+               "id":"17",\r
+               "Direction":1,\r
+               "EventData":"8303,17570"\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":2998,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:20 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"1716582",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"16",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":681,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:20 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"9888150",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"15",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":2294,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:20 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"8378283",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"14",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":4232,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:19 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"6818380",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"13",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":599,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:19 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"5933409",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"12",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":6376,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:12 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"5487982",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"11",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":6325,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:12 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"2859596",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"10",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":6571,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:12 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"2820138",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"9",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":4929,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:12 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"6356454",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"8",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":2620,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:12 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"4461166",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"7",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:02 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"8811808",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"6",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:02 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"2985843",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"5",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:02 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"9714278",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"4",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:02 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"5044910",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"3",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:02 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"6519793",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"2",\r
+               "Direction":5,\r
+               "EventData":""\r
+       }];\r
+\r
+\r
+    /**\r
+     * register data!\r
+     */\r
+    device.implementation.loadData('Service.Logging', 'Log', logging_data);\r
+\r
+})()\r
+       
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/data/mediaManagement_data.js b/wrt/misc/rss/preview/data/mediaManagement_data.js
new file mode 100644 (file)
index 0000000..e6abcf9
--- /dev/null
@@ -0,0 +1,233 @@
+/**\r
+ * SAPI Sample Data - MediaManagement\r
+ */\r
+\r
+(function(){\r
+\r
+       var music_data = [{\r
+               "FileNameAndPath":"E:\\Sounds\\Digital\\Album1\\Breathless.mp3",\r
+               "Type":"Media",\r
+               "FileName":"Breathless",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":4552794,\r
+               "Artist":"ABC",\r
+               "SongName":"Breathless",\r
+               "TrackNumber":"1",\r
+               "Album":"Album1",\r
+               "Genre":"Pop",\r
+               "Composer":"XYZ"\r
+       },{\r
+               "FileNameAndPath":"E:\\Sounds\\Digital\\Album1\\New song.mp3",\r
+               "Type":"Media",\r
+               "FileName":"New song",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":1232794,\r
+               "Artist":"ABC",\r
+               "SongName":"New song",\r
+               "TrackNumber":"2",\r
+               "Album":"Album1",\r
+               "Genre":"Pop",\r
+               "Composer":"XYZ"\r
+       },{             \r
+               "FileNameAndPath":"E:\\Sounds\\Digital\\Album1\\Classic song.mp3",\r
+               "Type":"Media",\r
+               "FileName":"Classic song",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":3212794,\r
+               "Artist":"ABC",\r
+               "SongName":"Classic song",\r
+               "TrackNumber":"3",\r
+               "Album":"Album1",\r
+               "Genre":"Pop",\r
+               "Composer":"XYZ"\r
+       },{             \r
+               "FileNameAndPath":"E:\\Sounds\\Digital\\Album1\\Folk sonk.mp3",\r
+               "Type":"Media",\r
+               "FileName":"Folk sonk",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":3412794,\r
+               "Artist":"ABC",\r
+               "SongName":"Folk sonk",\r
+               "TrackNumber":"4",\r
+               "Album":"Album1",\r
+               "Genre":"Pop",\r
+               "Composer":"XYZ"\r
+       },{             \r
+               "FileNameAndPath":"E:\\Sounds\\Digital\\Album1\\National anthem.mp3",\r
+               "Type":"Media",\r
+               "FileName":"National anthem",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":4512794,\r
+               "Artist":"ABC",\r
+               "SongName":"National anthem",\r
+               "TrackNumber":"5",\r
+               "Album":"Album1",\r
+               "Genre":"Pop",\r
+               "Composer":"XYZ"\r
+       },{\r
+               "FileNameAndPath":"E:\\Sounds\\Digital\\Album1\\Dance sequence.mp3",\r
+               "Type":"Media",\r
+               "FileName":"Dance sequence",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":9110000,\r
+               "Artist":"ABC",\r
+               "SongName":"Dance sequence",\r
+               "TrackNumber":"6",\r
+               "Album":"Album1",\r
+               "Genre":"Pop",\r
+               "Composer":"XYZ"\r
+       }];\r
+       \r
+       var sound_data = [{\r
+               "FileNameAndPath":"E:\\Sounds\\Simple\\Dance sequence-old.mp3",\r
+               "Type":"Media",\r
+               "FileName":"Dance sequence-old",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":1002794,\r
+       },{\r
+               "FileNameAndPath": "E:\\Sounds\\Simple\\Rooster.mp3",\r
+               "Type": "Media",\r
+               "FileName": "Rooster",\r
+               "FileExtension": ".mp3",\r
+               "Drive": "E:",\r
+               "MimeType": "audio/mpeg",\r
+               "MediaType": 1,\r
+               "FileDate": "Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize": 911000,\r
+       \r
+       }];\r
+       var image_data = [{\r
+               "FileNameAndPath":"E:\\IMAGES\\Water.JPG",\r
+               "Type":"Media",\r
+               "FileName":"Water",\r
+               "FileExtension":".JPG",\r
+               "Drive":"E:",\r
+               "MimeType":"image/jpeg",\r
+               "MediaType":3,\r
+               "FileDate":"Monday, 04 August, 2008 8:31:46 pm",\r
+               "FileSize":25275\r
+       },{\r
+               "FileNameAndPath":"E:\\IMAGES\\Beach.JPG",\r
+               "Type":"Media",\r
+               "FileName":"Beach",\r
+               "FileExtension":".JPG",\r
+               "Drive":"E:",\r
+               "MimeType":"image/jpeg",\r
+               "MediaType":3,\r
+               "FileDate":"Wednesday, 28 May, 2008 8:52:16 am",\r
+               "FileSize":35151\r
+       },{\r
+               "FileNameAndPath":"E:\\IMAGES\\CountrySide.jpg",\r
+               "Type":"Media",\r
+               "FileName":"CountrySide",\r
+               "FileExtension":".jpg",\r
+               "Drive":"E:",\r
+               "MimeType":"image/jpeg",\r
+               "MediaType":3,\r
+               "FileDate":"Monday, 24 March, 2008 12:27:32 am",\r
+               "FileSize":44318\r
+       },{\r
+               "FileNameAndPath":"E:\\IMAGES\\CoolBlue.JPG",\r
+               "Type":"Media",\r
+               "FileName":"CoolBlue",\r
+               "FileExtension":".JPG",\r
+               "Drive":"E:",\r
+               "MimeType":"image/jpeg",\r
+               "MediaType":3,\r
+               "FileDate":"Monday, 04 August, 2008 8:31:46 pm",\r
+               "FileSize":25275\r
+       },{\r
+               "FileNameAndPath":"E:\\IMAGES\\Swimming.JPG",\r
+               "Type":"Media",\r
+               "FileName":"Swimming",\r
+               "FileExtension":".JPG",\r
+               "Drive":"E:",\r
+               "MimeType":"image/jpeg",\r
+               "MediaType":3,\r
+               "FileDate":"Wednesday, 28 May, 2008 8:52:16 am",\r
+               "FileSize":35151\r
+       },{\r
+               "FileNameAndPath":"E:\\IMAGES\\Sky.jpg",\r
+               "Type":"Media",\r
+               "FileName":"Sky",\r
+               "FileExtension":".jpg",\r
+               "Drive":"E:",\r
+               "MimeType":"image/jpeg",\r
+               "MediaType":3,\r
+               "FileDate":"Monday, 24 March, 2008 12:27:32 am",\r
+               "FileSize":44318\r
+       }];\r
+\r
+       var video_data = [{\r
+               "FileNameAndPath":"C:\\Data\\Videos\\Inside water.3gp",\r
+               "Type":"Media",\r
+               "FileName":"Inside water",\r
+               "FileExtension":".3gp",\r
+               "Drive":"C:",\r
+               "MimeType":"video/3gpp",\r
+               "MediaType":4,\r
+               "FileDate":"Wednesday, 08 April, 2009 5:04:18 pm",\r
+               "FileSize":1103067\r
+       },{\r
+               "FileNameAndPath":"C:\\Data\\Videos\\Daring.mp4",\r
+               "Type":"Media",\r
+               "FileName":"Daring",\r
+               "FileExtension":".mp4",\r
+               "Drive":"C:",\r
+               "MimeType":"video/mp4",\r
+               "MediaType":4,\r
+               "FileDate":"Wednesday, 08 April, 2009 5:04:18 pm",\r
+               "FileSize":1020200\r
+       },{\r
+               "FileNameAndPath":"C:\\Data\\Videos\\On the train.mp4",\r
+               "Type":"Media",\r
+               "FileName":"On the train",\r
+               "FileExtension":".mp4",\r
+               "Drive":"C:",\r
+               "MimeType":"video/mp4",\r
+               "MediaType":4,\r
+               "FileDate":"Wednesday, 08 April, 2009 5:04:18 pm",\r
+               "FileSize":9090900\r
+       }];\r
+       \r
+       var streaming_data = [{}];      \r
+               \r
+    /**\r
+     * register data!\r
+     */\r
+    device.implementation.loadData('Service.MediaManagement', 'Music', music_data);\r
+    device.implementation.loadData('Service.MediaManagement', 'Sound', sound_data);\r
+    device.implementation.loadData('Service.MediaManagement', 'Image', image_data);\r
+    device.implementation.loadData('Service.MediaManagement', 'Video', video_data);\r
+    device.implementation.loadData('Service.MediaManagement', 'StreamingURL', streaming_data);\r
+\r
+})()\r
+       
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/data/messaging_data.js b/wrt/misc/rss/preview/data/messaging_data.js
new file mode 100644 (file)
index 0000000..8598203
--- /dev/null
@@ -0,0 +1,193 @@
+/**\r
+ * SAPI Sample Data - Messaging\r
+ */\r
+\r
+(function(){\r
+\r
+\r
+var data_messaging = [{\r
+               "MessageType": "SMS",\r
+               "Sender": "0435445454",\r
+               "Subject": "Reproduction, transfer, distribu",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:32 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1048980,\r
+               "BodyText": "Reproduction, transfer, distribution or storage of"\r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "+35854553456",\r
+               "Subject": "If you place an order for a prod",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:32 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1048981,\r
+               "BodyText": "If you place an order for a product, request a ser"\r
+       },{\r
+               "MessageType": "SMS",\r
+               "Sender": "+4465655656",\r
+               "Subject": "You also agree that we have no c",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:33 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1048982,\r
+               "BodyText": "You also agree that we have no control over the co"\r
+       \r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "+4443433434",\r
+               "Subject": "We may use this information to r",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:33 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1048983,\r
+               "BodyText": "We may use this information to respond to your req"\r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "0565645455",\r
+               "Subject": "In order to respond to your ques",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:33 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1048984,\r
+               "BodyText": "In order to respond to your questions or manage in"\r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "0231343243",\r
+               "Subject": "We consents to you browsing the ",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:59 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": true,\r
+               "MessageId": 1048985,\r
+               "BodyText": "We consents to you browsing the pages on your computer or printing copies of extracts from these pag"\r
+       },{\r
+               "MessageType": "SMS",\r
+               "Sender": "0545545454",\r
+               "Subject": "If you place an order for a prod",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:59 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": true,\r
+               "MessageId": 1048986,\r
+               "BodyText": "If you place an order for a product, request a service or submit content to this site, we may need t"\r
+       },{\r
+               "MessageType": "unknown",\r
+               "Sender": "Edith",\r
+               "Subject": "You will win the battle, GUARANT",\r
+               "Time": "Wednesday, 01 April, 2009 6:12:22 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": true,\r
+               "MessageId": 1048987\r
+       },{\r
+               "MessageType": "unknown",\r
+               "Sender": "Edith",\r
+               "Subject": "You will win the battle, GUARANT",\r
+               "Time": "Wednesday, 01 April, 2009 6:12:23 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": true,\r
+               "MessageId": 1048989\r
+       },{\r
+               "MessageType": "unknown",\r
+               "Sender": "+4443433434",\r
+               "Subject": "Join us at the OSGi 2003 World C",\r
+               "Time": "Wednesday, 01 April, 2009 6:14:10 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": true,\r
+               "MessageId": 1049013\r
+       },{\r
+               "MessageType": "unknown",\r
+               "Sender": "0231343243",\r
+               "Subject": "Put your subject line here",\r
+               "Time": "Wednesday, 01 April, 2009 6:14:10 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": true,\r
+               "MessageId": 1049014\r
+       },{\r
+               "MessageType": "MMS",\r
+               "Sender": "0455454454",\r
+               "Subject": "A very funny game",\r
+               "Time": "Wednesday, 01 April, 2009 6:16:01 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": true,\r
+               "Unread": true,\r
+               "MessageId": 1049043,\r
+               "BodyText": ""\r
+       },{\r
+               "MessageType": "MMS",\r
+               "Sender": "0542303286",\r
+               "Subject": "Weedmon say: call, we be open 7 ",\r
+               "Time": "Wednesday, 01 April, 2009 6:16:03 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": true,\r
+               "Unread": true,\r
+               "MessageId": 1049044,\r
+               "BodyText": ""\r
+       },{\r
+               "MessageType": "SMS",\r
+               "Sender": "+4465656565",\r
+               "Subject": "In addition, a link to a such si",\r
+               "Time": "Wednesday, 01 April, 2009 6:16:59 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1049045,\r
+               "BodyText": "In addition, a link to a such site does not imply that we endorses the site or the products or servi"\r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "0433032865",\r
+               "Subject": "The contents of these pages are ",\r
+               "Time": "Wednesday, 01 April, 2009 6:16:59 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1049046,\r
+               "BodyText": "The contents of these pages are copyrighted. Any rights not expressly granted herein are reserved. T"\r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "+4465655656",\r
+               "Subject": "We may use this information to r",\r
+               "Time": "Wednesday, 01 April, 2009 6:16:59 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1049047,\r
+               "BodyText": "We may use this information to respond to your requests, or to contact you via mail, e-mail or phone"\r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "+35876653456",\r
+               "Subject": "The use of press releases and ot",\r
+               "Time": "Wednesday, 01 April, 2009 6:16:59 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1049048,\r
+               "BodyText": "The use of press releases and other documents classified as public is permitted in public communicat"\r
+       },{\r
+               "MessageType": "SMS",\r
+               "Sender": "0530328732",\r
+               "Subject": "The use of press releases and ot",\r
+               "Time": "Wednesday, 01 April, 2009 6:17:00 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1049054,\r
+               "BodyText": "The use of press releases and other documents classified as public is permitted in public communicat"\r
+       }];\r
+\r
+    /**\r
+     * register data!\r
+     */\r
+    device.implementation.loadData('Service.Messaging', 'Inbox', data_messaging);\r
+\r
+})()\r
+       
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/data/sensor_data.js b/wrt/misc/rss/preview/data/sensor_data.js
new file mode 100644 (file)
index 0000000..7d53b5c
--- /dev/null
@@ -0,0 +1,469 @@
+/**\r
+ * SAPI Sample Data - Sensor\r
+ */\r
+\r
+(function(){\r
+\r
+var property = {\r
+       "AccelerometerAxis":{\r
+               "Availability":{\r
+                       "PropertyId":"Availability",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":1\r
+                       },\r
+               "ChannelAccuracy":{\r
+                       "PropertyId":"ChannelAccuracy",\r
+                       "PropertyDataType":1,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":10\r
+                       },\r
+               "ChannelDataFormat":\r
+               {\r
+                       "PropertyId":"ChannelDataFormat",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":2\r
+               },\r
+               "ChannelScale":\r
+               {\r
+                       "PropertyId":"ChannelScale",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "ChannelUnit":\r
+               {\r
+                       "PropertyId":"ChannelUnit",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":10\r
+               },\r
+               "ConnectionType":\r
+               {\r
+                       "PropertyId":"ConnectionType",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":1\r
+               },\r
+               "DataRate":\r
+               {\r
+                       "PropertyId":"DataRate",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "Description":\r
+               {\r
+                       "PropertyId":"Description",\r
+                       "PropertyDataType":2,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":"Accelerometer"\r
+               },\r
+               "MeasureRange":\r
+               {\r
+                       "PropertyId":"MeasureRange",\r
+                       "PropertyDataType":1,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "ScaledRange":\r
+               {\r
+                       "PropertyId":"ScaledRange",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":8\r
+               }\r
+       },\r
+       "AccelerometerDoubleTapping":\r
+       {\r
+               "Availability":\r
+               {\r
+                       "PropertyId":"Availability",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":1\r
+               },\r
+               "ChannelAccuracy":\r
+               {\r
+                       "PropertyId":"ChannelAccuracy",\r
+                       "PropertyDataType":1,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":10\r
+               },\r
+               "ChannelDataFormat":\r
+               {\r
+                       "PropertyId":"ChannelDataFormat",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":2\r
+               },\r
+               "ChannelScale":\r
+               {\r
+                       "PropertyId":"ChannelScale",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "ChannelUnit":\r
+               {\r
+                       "PropertyId":"ChannelUnit",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":10\r
+               },\r
+               "ConnectionType":\r
+               {\r
+                       "PropertyId":"ConnectionType",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":1\r
+               },\r
+               "Description":\r
+               {\r
+                       "PropertyId":"Description",\r
+                       "PropertyDataType":2,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":"Accelerometer"\r
+               },\r
+               "MeasureRange":\r
+               {\r
+                       "PropertyId":"MeasureRange",\r
+                       "PropertyDataType":1,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "ScaledRange":\r
+               {\r
+                       "PropertyId":"ScaledRange",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":8\r
+               }\r
+       },\r
+       "Orientation":\r
+       {\r
+               "Availability":\r
+               {\r
+                       "PropertyId":"Availability",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":1\r
+               },\r
+               "DataRate":\r
+               {\r
+                       "PropertyId":"DataRate",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "MeasureRange":\r
+               {\r
+                       "PropertyId":"MeasureRange",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               }\r
+       },\r
+       "Rotation":\r
+       {\r
+               "Availability":\r
+               {\r
+                       "PropertyId":"Availability",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":1\r
+               },\r
+               "ChannelAccuracy":\r
+               {\r
+                       "PropertyId":"ChannelAccuracy",\r
+                       "PropertyDataType":1,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0.041666666666666664\r
+               },\r
+               "DataRate":\r
+               {\r
+                       "PropertyId":"DataRate",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "MeasureRange":\r
+               {\r
+                       "PropertyId":"MeasureRange",\r
+                       "PropertyDataType":1,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":359\r
+               }\r
+       }\r
+};\r
+var data_all =[{\r
+               "ChannelId":7,\r
+               "ContextType":2,\r
+               "Quantity":10,\r
+               "ChannelType":270553214,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":24,\r
+               "ChannelDataTypeId":270553214\r
+               },\r
+               {\r
+               "ChannelId":8,\r
+               "ContextType":2,\r
+               "Quantity":11,\r
+               "ChannelType":270553217,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":16,\r
+               "ChannelDataTypeId":270553215\r
+               },\r
+               {\r
+               "ChannelId":10,\r
+               "ContextType":3,\r
+               "Quantity":12,\r
+               "ChannelType":270553224,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":16,\r
+               "ChannelDataTypeId":270553224\r
+               },\r
+               {\r
+               "ChannelId":11,\r
+               "ContextType":3,\r
+               "Quantity":13,\r
+               "ChannelType":270553225,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":24,\r
+               "ChannelDataTypeId":270553225\r
+               }];\r
+               \r
+var data_accelerometerAxis = [{\r
+               "ChannelId":7,\r
+               "ContextType":2,\r
+               "Quantity":10,\r
+               "ChannelType":270553214,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":24,\r
+               "ChannelDataTypeId":270553214\r
+               }];\r
+               \r
+var data_accelerometerDoubleTapping = [{\r
+               "ChannelId":8,\r
+               "ContextType":2,\r
+               "Quantity":11,\r
+               "ChannelType":270553217,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":16,\r
+               "ChannelDataTypeId":270553215\r
+               }];\r
+               \r
+var data_orientation = [{\r
+               "ChannelId":10,\r
+               "ContextType":3,\r
+               "Quantity":12,\r
+               "ChannelType":270553224,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":16,\r
+               "ChannelDataTypeId":270553224\r
+               }];\r
+               \r
+var data_rotation = [{\r
+               "ChannelId":11,\r
+               "ContextType":3,\r
+               "Quantity":13,\r
+               "ChannelType":270553225,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":24,\r
+               "ChannelDataTypeId":270553225\r
+               }];\r
+\r
+\r
+var dataRet_accelerometerAxis = [{\r
+               "DataType":"AxisData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XAxisData":30,\r
+               "YAxisData":30,\r
+               "ZAxisData":30\r
+               },{\r
+               "DataType":"AxisData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XAxisData":35,\r
+               "YAxisData":30,\r
+               "ZAxisData":30\r
+               },{\r
+               "DataType":"AxisData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XAxisData":30,\r
+               "YAxisData":35,\r
+               "ZAxisData":30\r
+               },{\r
+               "DataType":"AxisData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XAxisData":30,\r
+               "YAxisData":30,\r
+               "ZAxisData":35\r
+               },{\r
+               "DataType":"AxisData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XAxisData":40,\r
+               "YAxisData":30,\r
+               "ZAxisData":30\r
+               },{\r
+               "DataType":"AxisData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XAxisData":30,\r
+               "YAxisData":40,\r
+               "ZAxisData":30\r
+               }];\r
+               \r
+var dataRet_accelerometerDoubleTapping = [{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":30\r
+               },{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":40\r
+               },{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":50\r
+               },{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":60\r
+               },{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":70\r
+               },{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":80\r
+               },{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":90\r
+               }];\r
+               \r
+var dataRet_orientation = [{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"DisplayUp"         \r
+               },{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"DisplayDown"               \r
+               },{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"DisplayLeftUp"             \r
+               },{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"DisplayRightUp"            \r
+               },{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"DisplayUpwards"            \r
+               },{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"DisplayDownwards"          \r
+               },{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"Undefined"         \r
+               }];\r
+               \r
+var dataRet_rotation = [{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":30,\r
+               "YRotation":35,\r
+               "ZRotation":30\r
+               },{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":35,\r
+               "YRotation":30,\r
+               "ZRotation":30\r
+               },{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":30,\r
+               "YRotation":30,\r
+               "ZRotation":35\r
+               },{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":40,\r
+               "YRotation":30,\r
+               "ZRotation":30\r
+               },{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":30,\r
+               "YRotation":40,\r
+               "ZRotation":30\r
+               },{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":30,\r
+               "YRotation":30,\r
+               "ZRotation":40\r
+               },{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":50,\r
+               "YRotation":50,\r
+               "ZRotation":50\r
+               }];\r
+\r
+    /**\r
+     * register data!\r
+     */\r
+       device.implementation.loadData('Service.Sensor','SensorProperty',property);\r
+    device.implementation.loadData('Service.Sensor', 'All', data_all);\r
+    device.implementation.loadData('Service.Sensor', 'AccelerometerAxis', data_accelerometerAxis);\r
+    device.implementation.loadData('Service.Sensor', 'AccelerometerDoubleTapping', data_accelerometerDoubleTapping);\r
+    device.implementation.loadData('Service.Sensor', 'Orientation', data_orientation);\r
+    device.implementation.loadData('Service.Sensor', 'Rotation', data_rotation);\r
+/*    device.implementation.loadData('Service.Sensor', 'AccelerometerAxisRet', dataRet_accelerometerAxis);\r
+    device.implementation.loadData('Service.Sensor', 'AccelerometerDoubleTappingRet', dataRet_accelerometerDoubleTapping);\r
+    device.implementation.loadData('Service.Sensor', 'OrientationRet', dataRet_orientation);\r
+    device.implementation.loadData('Service.Sensor', 'RotationRet', dataRet_rotation);*/\r
+\r
+})()\r
+       
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/data/sysInfo_data.js b/wrt/misc/rss/preview/data/sysInfo_data.js
new file mode 100644 (file)
index 0000000..2d15da8
--- /dev/null
@@ -0,0 +1,345 @@
+/**
+ * SAPI Sample Data - SysInfo
+ */
+
+
+(function(){  
+
+var data_5800 = {
+                       "battery":{
+                               "batterystrength":{
+                                       "Status":85,
+                                       "Entity":"Battery",
+                                       "Key":"BatteryStrength"
+                                       },
+                               "chargingstatus":{
+                                       "Status":0,\r
+                                       "Entity":"Battery",\r
+                                       "Key":"ChargingStatus"
+                                       }
+                       },\r
+                       "connectivity":{
+                               "bluetooth":{
+                                       "Status":1,\r
+                                       "Entity":"Connectivity",\r
+                                       "Key":"BlueTooth"
+                                       },\r
+                               "infrared":{
+                                       "Status":-1,\r
+                                       "Entity":"Connectivity",\r
+                                       "Key":"InfraRed"
+                                       },
+                               "activeconnections":{
+                                       "ConnectionList":[{
+                                                               "IAPID":5,
+                                                               "IAPName":"Browser",
+                                                               "IAPConnectionName":"",
+                                                               "NetworkName":"Browser",
+                                                               "ConnectionType":7,
+                                                               "ConnectionStatus":1
+                                                               },{
+                                                               "IAPID":1,
+                                                               "IAPName":"airtelgprs.com",
+                                                               "IAPConnectionName":"Mobile Office",
+                                                               "NetworkName":"GPRS",
+                                                               "ConnectionType":6,
+                                                               "ConnectionStatus":1
+                                                               }],
+                                       "Entity":"Connectivity",
+                                       "Key":"ActiveConnections"
+                               },                                      \r
+                               "wlanmacaddress":{
+                                       "StringData":"00:21:fe:97:c5:27",\r
+                                       "Entity":"Connectivity",\r
+                                       "Key":"WLanMacAddress"
+                                       }
+                       },\r
+                       "device":{
+                               "firmwareversion":{
+                                       "StringData":"V 20.0.012 RnD\n04-03-09\nRM-356\n(c)NMP",\r
+                                       "Entity":"Device",\r
+                                       "Key":"FirmwareVersion"},\r
+                               "platformversion":{
+                                       "MajorVersion":"5",\r
+                                       "MinorVersion":"0",\r
+                                       "Entity":"Device",\r
+                                       "Key":"PlatformVersion"
+                                       },\r
+                               "producttype":{
+                                       "StringData":"RM-356",\r
+                                       "Entity":"Device",\r
+                                       "Key":"ProductType"
+                                       },\r
+                               "manufacturer":{
+                                       "StringData":"Nokia",\r
+                                       "Entity":"Device",\r
+                                       "Key":"Manufacturer"
+                                       },\r
+                               "machineid":{
+                                       "Status":536926806,\r
+                                       "Entity":"Device",\r
+                                       "Key":"MachineId"
+                                       },\r
+                               "phonemodel":{
+                                       "StringData":"5800 XpressMusic",\r
+                                       "Entity":"Device",\r
+                                       "Key":"PhoneModel"
+                                       },\r
+                               "imei":{
+                                       "StringData":"004401102480155",\r
+                                       "Entity":"Device",\r
+                                       "Key":"IMEI"
+                                       }
+                       },\r
+                       "display":{
+                               "brightness":{
+                                       "Status":50,\r
+                                       "Entity":"Display",\r
+                                       "Key":"Brightness"
+                                       },\r
+                               "screensavertimeout":{
+                                       "Status":15,\r
+                                       "Entity":"Display",\r
+                                       "Key":"ScreenSaverTimeout"
+                                       },\r
+                               "keyguardtime":{
+                                       "Status":60,\r
+                                       "Entity":"Display",\r
+                                       "Key":"KeyGuardTime"
+                                       },
+                               "keyguardtime":{
+                                       "Status":60,
+                                       "Entity":"Display",
+                                       "Key":"KeyGuardTime"
+                                       },
+                               "autolocktime":{
+                                       "Status":0,\r
+                                       "Entity":"Display",\r
+                                       "Key":"AutoLockTime"
+                                       },\r
+                               "autolockstatus":{
+                                       "Status":0,\r
+                                       "Entity":"Display",\r
+                                       "Key":"AutoLockStatus"
+                                       },\r
+                               "lighttimeout":{
+                                       "Status":45,\r
+                                       "Entity":"Display",\r
+                                       "Key":"LightTimeout"
+                                       },\r
+                               "displayresolution":{
+                                       "XPixels":640,\r
+                                       "YPixels":360,\r
+                                       "Entity":"Display",\r
+                                       "Key":"DisplayResolution"
+                                       },\r
+                               "displayorientation":{
+                                       "Status":3,\r
+                                       "Entity":"Display",\r
+                                       "Key":"DisplayOrientation"
+                                       },
+                               "wallpaper":{
+                                       "StringData":"C://Data//Others//wallpaper.jpeg",
+                                       "Entity":"Display",
+                                       "Key":"Wallpaper"
+                                       }
+                               
+                       },\r
+                       "features":{
+                               "bluetooth":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"BlueTooth"
+                                       },\r
+                               "infrared":{
+                                       "Status":0,\r
+                                       "Entity":"Features",\r
+                                       "Key":"InfraRed"
+                                       },\r
+                               "camera":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"CAMERA"
+                                       },\r
+                               "memorycard":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"MemoryCard"
+                                       },\r
+                               "fmradio":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"FMRADIO"
+                                       },\r
+                               "qwerty":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"QWERTY"
+                                       },\r
+                               "wlan":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"WLAN"
+                                       },\r
+                               "usb":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"USB"
+                                       },\r
+                               "pen":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"Pen"
+                                       },\r
+                               "led":{
+                                       "Status":0,\r
+                                       "Entity":"Features",\r
+                                       "Key":"LED"
+                                       },\r
+                               "coverui":{
+                                       "Status":0,\r
+                                       "Entity":"Features",\r
+                                       "Key":"CoverUI"
+                                       },\r
+                               "sidevolumekeys":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"SideVolumeKeys"
+                                       },\r
+                               "vibra":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"Vibra"
+                                       }
+                       },\r
+                       "general":{
+                               "connectedaccessories":{
+                                       "AccessoryList":[{"AccessoryType":0,"AccessoryState":1}],\r
+                                       "Entity":"General",\r
+                                       "Key":"ConnectedAccessories"
+                                       },
+                               "accessorystatus":{
+                                       "AccessoryInfo":{"AccessoryType":0,"AccessoryState":0},
+                                       "Entity":"General",
+                                       "Key":"AccessoryStatus"
+                                       },
+                               "inputlanguage":{
+                                       "Status":1,\r
+                                       "Entity":"General",\r
+                                       "Key":"InputLanguage"
+                                       },\r
+                               "supportedlanguages":{
+                                       "LanguageList":[1,2,3,5,13,4],\r
+                                       "Entity":"General",\r
+                                       "Key":"SupportedLanguages"
+                                       },\r
+                               "predictivetext":{
+                                       "Status":0,\r
+                                       "Entity":"General",\r
+                                       "Key":"PredictiveText"
+                                       },\r
+                               "vibraactive":{
+                                       "Status":1,\r
+                                       "Entity":"General",\r
+                                       "Key":"VibraActive"
+                                       },\r
+                               "availableusbmodes":{
+                                       "StringList":["PC Suite","Mass storage","Image transfer","Media transfer"],\r
+                                       "Entity":"General",\r
+                                       "Key":"AvailableUSBModes"
+                                       },\r
+                               "activeusbmode":{
+                                       "StringData":"Mass storage",\r
+                                       "Entity":"General",\r
+                                       "Key":"ActiveUSBMode"
+                                       },\r
+                               "flipstatus":{
+                                       "Status":-1,\r
+                                       "Entity":"General",\r
+                                       "Key":"FlipStatus"
+                                       },\r
+                               "gripstatus":{
+                                       "Status":1,\r
+                                       "Entity":"General",\r
+                                       "Key":"GripStatus"
+                                       }
+                       },\r
+                       "memory":{
+                               "listdrives":{
+                                       "DriveList":["C:\\","D:\\","E:\\","Z:\\"],\r
+                                       "Entity":"Memory",\r
+                                       "Key":"ListDrives"
+                                       },\r
+                               "memorycard":{
+                                       "Status":1,\r
+                                       "Entity":"Memory",\r
+                                       "Key":"MemoryCard"
+                                       },
+                               "driveinfo":{
+                                       "Drive": {
+                                                       "C:\\": {
+                                                               "Drive": "C:\\",
+                                                               "CriticalSpace": 131072,
+                                                               "MediaType": 9,
+                                                               "TotalSpace": 90210304,
+                                                               "FreeSpace": 79319040,
+                                                               "DriveName": "",
+                                                               "BatterState": 0
+                                                               },
+                                                       "D:\\": {
+                                                               "Drive": "D:\\",
+                                                               "CriticalSpace": 2700000,
+                                                               "MediaType": 5,
+                                                               "TotalSpace": 52469760,
+                                                               "FreeSpace": 52457472,
+                                                               "DriveName": "",
+                                                               "BatterState": 0
+                                                               },
+                                                       "Z:\\": {
+                                                               "Drive": "Z:\\",
+                                                               "CriticalSpace": 131072,
+                                                               "MediaType": 7,
+                                                               "TotalSpace": 0,
+                                                               "FreeSpace": 0,
+                                                               "DriveName": "RomDrive",
+                                                               "BatterState": 0
+                                                               }
+                                                       },
+                                       "Entity":"Memory",
+                                       "Key":"DriveInfo"
+                                       }
+                       },\r
+                       "network":{
+                               "registrationstatus":{
+                                       "Status":4,\r
+                                       "Entity":"Network",\r
+                                       "Key":"RegistrationStatus"
+                                       },\r
+                               "networkmode":{
+                                       "Status":0,\r
+                                       "Entity":"Network",\r
+                                       "Key":"NetworkMode"
+                                       },
+                               "signalstrength":{
+                                       "Status":61,
+                                       "Entity":"Network",
+                                       "Key":"SignalStrength"
+                                       },
+                               "currentnetwork":{
+                                       "NetworkName":"Airtel",
+                                       "NetworkStatus":1,
+                                       "NetworkMode":1,
+                                       "CountryCode":"404",
+                                       "NetworkCode":"45",
+                                       "LocationStatus":false,
+                                       "Entity":"Network",
+                                       "Key":"CurrentNetwork"
+                                       }
+                       }
+       }; 
+       /**
+        * register data!
+        */
+       device.implementation.loadData('Service.SysInfo', '', data_5800);
+
+})()
diff --git a/wrt/misc/rss/preview/images/BrowserNotificationBar-Toogle.gif b/wrt/misc/rss/preview/images/BrowserNotificationBar-Toogle.gif
new file mode 100644 (file)
index 0000000..ebe7f61
Binary files /dev/null and b/wrt/misc/rss/preview/images/BrowserNotificationBar-Toogle.gif differ
diff --git a/wrt/misc/rss/preview/images/Gradient0Background.png b/wrt/misc/rss/preview/images/Gradient0Background.png
new file mode 100644 (file)
index 0000000..4faaeeb
Binary files /dev/null and b/wrt/misc/rss/preview/images/Gradient0Background.png differ
diff --git a/wrt/misc/rss/preview/images/IconArea-hover.png b/wrt/misc/rss/preview/images/IconArea-hover.png
new file mode 100644 (file)
index 0000000..44feae1
Binary files /dev/null and b/wrt/misc/rss/preview/images/IconArea-hover.png differ
diff --git a/wrt/misc/rss/preview/images/TransperantImage.png b/wrt/misc/rss/preview/images/TransperantImage.png
new file mode 100644 (file)
index 0000000..d5cdd1f
Binary files /dev/null and b/wrt/misc/rss/preview/images/TransperantImage.png differ
diff --git a/wrt/misc/rss/preview/images/active-orientation-icon.png b/wrt/misc/rss/preview/images/active-orientation-icon.png
new file mode 100644 (file)
index 0000000..4572534
Binary files /dev/null and b/wrt/misc/rss/preview/images/active-orientation-icon.png differ
diff --git a/wrt/misc/rss/preview/images/battery-icon.png b/wrt/misc/rss/preview/images/battery-icon.png
new file mode 100644 (file)
index 0000000..ba874cd
Binary files /dev/null and b/wrt/misc/rss/preview/images/battery-icon.png differ
diff --git a/wrt/misc/rss/preview/images/console-clear-button.png b/wrt/misc/rss/preview/images/console-clear-button.png
new file mode 100644 (file)
index 0000000..6d84eff
Binary files /dev/null and b/wrt/misc/rss/preview/images/console-clear-button.png differ
diff --git a/wrt/misc/rss/preview/images/console-close-icon.png b/wrt/misc/rss/preview/images/console-close-icon.png
new file mode 100644 (file)
index 0000000..3dd7d85
Binary files /dev/null and b/wrt/misc/rss/preview/images/console-close-icon.png differ
diff --git a/wrt/misc/rss/preview/images/console-icon.gif b/wrt/misc/rss/preview/images/console-icon.gif
new file mode 100644 (file)
index 0000000..b785b3f
Binary files /dev/null and b/wrt/misc/rss/preview/images/console-icon.gif differ
diff --git a/wrt/misc/rss/preview/images/console-open-icon.png b/wrt/misc/rss/preview/images/console-open-icon.png
new file mode 100644 (file)
index 0000000..065e0df
Binary files /dev/null and b/wrt/misc/rss/preview/images/console-open-icon.png differ
diff --git a/wrt/misc/rss/preview/images/default-Icon.png b/wrt/misc/rss/preview/images/default-Icon.png
new file mode 100644 (file)
index 0000000..7225970
Binary files /dev/null and b/wrt/misc/rss/preview/images/default-Icon.png differ
diff --git a/wrt/misc/rss/preview/images/device/240x320/Landscape.png b/wrt/misc/rss/preview/images/device/240x320/Landscape.png
new file mode 100644 (file)
index 0000000..976e906
Binary files /dev/null and b/wrt/misc/rss/preview/images/device/240x320/Landscape.png differ
diff --git a/wrt/misc/rss/preview/images/device/240x320/Portrait.png b/wrt/misc/rss/preview/images/device/240x320/Portrait.png
new file mode 100644 (file)
index 0000000..31de173
Binary files /dev/null and b/wrt/misc/rss/preview/images/device/240x320/Portrait.png differ
diff --git a/wrt/misc/rss/preview/images/device/320x240/Landscape.png b/wrt/misc/rss/preview/images/device/320x240/Landscape.png
new file mode 100644 (file)
index 0000000..162d69d
Binary files /dev/null and b/wrt/misc/rss/preview/images/device/320x240/Landscape.png differ
diff --git a/wrt/misc/rss/preview/images/device/320x240/Portrait.png b/wrt/misc/rss/preview/images/device/320x240/Portrait.png
new file mode 100644 (file)
index 0000000..58dffb7
Binary files /dev/null and b/wrt/misc/rss/preview/images/device/320x240/Portrait.png differ
diff --git a/wrt/misc/rss/preview/images/device/360x640/Landscape.png b/wrt/misc/rss/preview/images/device/360x640/Landscape.png
new file mode 100644 (file)
index 0000000..fbb081e
Binary files /dev/null and b/wrt/misc/rss/preview/images/device/360x640/Landscape.png differ
diff --git a/wrt/misc/rss/preview/images/device/360x640/Portrait.png b/wrt/misc/rss/preview/images/device/360x640/Portrait.png
new file mode 100644 (file)
index 0000000..ba5dfb7
Binary files /dev/null and b/wrt/misc/rss/preview/images/device/360x640/Portrait.png differ
diff --git a/wrt/misc/rss/preview/images/device/360x640/hs-landscape.png b/wrt/misc/rss/preview/images/device/360x640/hs-landscape.png
new file mode 100644 (file)
index 0000000..cb5ae48
Binary files /dev/null and b/wrt/misc/rss/preview/images/device/360x640/hs-landscape.png differ
diff --git a/wrt/misc/rss/preview/images/device/360x640/hs-portrait.png b/wrt/misc/rss/preview/images/device/360x640/hs-portrait.png
new file mode 100644 (file)
index 0000000..7525815
Binary files /dev/null and b/wrt/misc/rss/preview/images/device/360x640/hs-portrait.png differ
diff --git a/wrt/misc/rss/preview/images/device/800x352/Landscape.png b/wrt/misc/rss/preview/images/device/800x352/Landscape.png
new file mode 100644 (file)
index 0000000..afcc45a
Binary files /dev/null and b/wrt/misc/rss/preview/images/device/800x352/Landscape.png differ
diff --git a/wrt/misc/rss/preview/images/device/MenuItem-keys-Bg2.png b/wrt/misc/rss/preview/images/device/MenuItem-keys-Bg2.png
new file mode 100644 (file)
index 0000000..6700144
Binary files /dev/null and b/wrt/misc/rss/preview/images/device/MenuItem-keys-Bg2.png differ
diff --git a/wrt/misc/rss/preview/images/device/menuKeys-bg.png b/wrt/misc/rss/preview/images/device/menuKeys-bg.png
new file mode 100644 (file)
index 0000000..2d74cd8
Binary files /dev/null and b/wrt/misc/rss/preview/images/device/menuKeys-bg.png differ
diff --git a/wrt/misc/rss/preview/images/errorIcon.png b/wrt/misc/rss/preview/images/errorIcon.png
new file mode 100644 (file)
index 0000000..2d75261
Binary files /dev/null and b/wrt/misc/rss/preview/images/errorIcon.png differ
diff --git a/wrt/misc/rss/preview/images/gradient-bg.png b/wrt/misc/rss/preview/images/gradient-bg.png
new file mode 100644 (file)
index 0000000..6a49674
Binary files /dev/null and b/wrt/misc/rss/preview/images/gradient-bg.png differ
diff --git a/wrt/misc/rss/preview/images/hs-iframeMask.png b/wrt/misc/rss/preview/images/hs-iframeMask.png
new file mode 100644 (file)
index 0000000..62f442b
Binary files /dev/null and b/wrt/misc/rss/preview/images/hs-iframeMask.png differ
diff --git a/wrt/misc/rss/preview/images/infoIcon.png b/wrt/misc/rss/preview/images/infoIcon.png
new file mode 100644 (file)
index 0000000..da1e533
Binary files /dev/null and b/wrt/misc/rss/preview/images/infoIcon.png differ
diff --git a/wrt/misc/rss/preview/images/memory-icon.png b/wrt/misc/rss/preview/images/memory-icon.png
new file mode 100644 (file)
index 0000000..bb24123
Binary files /dev/null and b/wrt/misc/rss/preview/images/memory-icon.png differ
diff --git a/wrt/misc/rss/preview/images/messaging-icon.png b/wrt/misc/rss/preview/images/messaging-icon.png
new file mode 100644 (file)
index 0000000..6313849
Binary files /dev/null and b/wrt/misc/rss/preview/images/messaging-icon.png differ
diff --git a/wrt/misc/rss/preview/images/normal-orientation-icon.png b/wrt/misc/rss/preview/images/normal-orientation-icon.png
new file mode 100644 (file)
index 0000000..8582a24
Binary files /dev/null and b/wrt/misc/rss/preview/images/normal-orientation-icon.png differ
diff --git a/wrt/misc/rss/preview/images/settings-icon.png b/wrt/misc/rss/preview/images/settings-icon.png
new file mode 100644 (file)
index 0000000..c7be390
Binary files /dev/null and b/wrt/misc/rss/preview/images/settings-icon.png differ
diff --git a/wrt/misc/rss/preview/images/statusBar_240x320.png b/wrt/misc/rss/preview/images/statusBar_240x320.png
new file mode 100644 (file)
index 0000000..e2f9c03
Binary files /dev/null and b/wrt/misc/rss/preview/images/statusBar_240x320.png differ
diff --git a/wrt/misc/rss/preview/images/statusBar_320x240.png b/wrt/misc/rss/preview/images/statusBar_320x240.png
new file mode 100644 (file)
index 0000000..fb07b18
Binary files /dev/null and b/wrt/misc/rss/preview/images/statusBar_320x240.png differ
diff --git a/wrt/misc/rss/preview/images/statusBar_360x640.png b/wrt/misc/rss/preview/images/statusBar_360x640.png
new file mode 100644 (file)
index 0000000..9694511
Binary files /dev/null and b/wrt/misc/rss/preview/images/statusBar_360x640.png differ
diff --git a/wrt/misc/rss/preview/images/statusBar_640x360.png b/wrt/misc/rss/preview/images/statusBar_640x360.png
new file mode 100644 (file)
index 0000000..4cc3d91
Binary files /dev/null and b/wrt/misc/rss/preview/images/statusBar_640x360.png differ
diff --git a/wrt/misc/rss/preview/images/statusBar_800x352.png b/wrt/misc/rss/preview/images/statusBar_800x352.png
new file mode 100644 (file)
index 0000000..be6d9ca
Binary files /dev/null and b/wrt/misc/rss/preview/images/statusBar_800x352.png differ
diff --git a/wrt/misc/rss/preview/images/sub-menu-arrow.png b/wrt/misc/rss/preview/images/sub-menu-arrow.png
new file mode 100644 (file)
index 0000000..ea3ad91
Binary files /dev/null and b/wrt/misc/rss/preview/images/sub-menu-arrow.png differ
diff --git a/wrt/misc/rss/preview/images/th-bg-gradient.png b/wrt/misc/rss/preview/images/th-bg-gradient.png
new file mode 100644 (file)
index 0000000..8fd0494
Binary files /dev/null and b/wrt/misc/rss/preview/images/th-bg-gradient.png differ
diff --git a/wrt/misc/rss/preview/images/warningIcon.png b/wrt/misc/rss/preview/images/warningIcon.png
new file mode 100644 (file)
index 0000000..de51084
Binary files /dev/null and b/wrt/misc/rss/preview/images/warningIcon.png differ
diff --git a/wrt/misc/rss/preview/images/wrt-help-icon.png b/wrt/misc/rss/preview/images/wrt-help-icon.png
new file mode 100644 (file)
index 0000000..647ecb0
Binary files /dev/null and b/wrt/misc/rss/preview/images/wrt-help-icon.png differ
diff --git a/wrt/misc/rss/preview/nopreview.html b/wrt/misc/rss/preview/nopreview.html
new file mode 100644 (file)
index 0000000..d721fa1
--- /dev/null
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+<style type="text/css">\r
+body {\r
+       background-image: url(images/Gradient0Background.png);\r
+       background-repeat: repeat-x;\r
+       font-family: "Nokia Sans", "Nokia Sans SemiBold", "Arial Narrow";\r
+       overflow: hidden;\r
+       color: #FFFFFF;\r
+}\r
+div {\r
+       text-align: center;\r
+       padding: 20px;\r
+       margin-top: 50px;\r
+       margin-right: auto;\r
+       margin-left: auto;\r
+       width: 500px;\r
+       font-size: x-large;\r
+       font-weight: normal;\r
+       background-color: #CC3300;\r
+       border-top-width: 2px;\r
+       border-right-width: 2px;\r
+       border-bottom-width: 2px;\r
+       border-left-width: 2px;\r
+       border-top-style: solid;\r
+       border-right-style: solid;\r
+       border-bottom-style: solid;\r
+       border-left-style: solid;\r
+       border-top-color: #FF3300;\r
+       border-right-color: #710000;\r
+       border-bottom-color: #710000;\r
+       border-left-color: #FF3300;\r
+}\r
+strong {\r
+       color: #FFCC00;\r
+}\r
+</style>\r
+</head>\r
+<body>\r
+<div> Widget preview is not available for this file, it is not the <strong>MainHtml</strong> file for the widget.\r
+</div>\r
+</body>\r
+</html>\r
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/000000_40x100_textures_05_inset_soft_25.png b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/000000_40x100_textures_05_inset_soft_25.png
new file mode 100644 (file)
index 0000000..d97a0a6
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/000000_40x100_textures_05_inset_soft_25.png differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png
new file mode 100644 (file)
index 0000000..a7b87eb
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_leftright.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_leftright.gif
new file mode 100644 (file)
index 0000000..b26780a
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_leftright.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_updown.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_updown.gif
new file mode 100644 (file)
index 0000000..69eb077
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_updown.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_close.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_close.gif
new file mode 100644 (file)
index 0000000..ff1ab99
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_close.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_doc.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_doc.gif
new file mode 100644 (file)
index 0000000..26db434
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_doc.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_closed.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_closed.gif
new file mode 100644 (file)
index 0000000..4efed68
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_closed.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_open.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_open.gif
new file mode 100644 (file)
index 0000000..0032ff6
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_open.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_minus.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_minus.gif
new file mode 100644 (file)
index 0000000..6851f39
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_minus.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_plus.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_plus.gif
new file mode 100644 (file)
index 0000000..74ac5cb
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_plus.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_down.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_down.gif
new file mode 100644 (file)
index 0000000..29c6c70
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_down.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_left.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_left.gif
new file mode 100644 (file)
index 0000000..9f95efa
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_left.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_right.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_right.gif
new file mode 100644 (file)
index 0000000..bc02050
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_right.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_up.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_up.gif
new file mode 100644 (file)
index 0000000..28169eb
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_up.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/555555_40x100_textures_02_glass_20.png b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/555555_40x100_textures_02_glass_20.png
new file mode 100644 (file)
index 0000000..ed90c7e
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/555555_40x100_textures_02_glass_20.png differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_leftright.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_leftright.gif
new file mode 100644 (file)
index 0000000..7037706
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_leftright.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_updown.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_updown.gif
new file mode 100644 (file)
index 0000000..cbedced
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_updown.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_close.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_close.gif
new file mode 100644 (file)
index 0000000..7c35291
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_close.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_doc.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_doc.gif
new file mode 100644 (file)
index 0000000..a7d7712
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_doc.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_closed.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_closed.gif
new file mode 100644 (file)
index 0000000..dcc03f6
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_closed.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_open.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_open.gif
new file mode 100644 (file)
index 0000000..d26dd77
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_open.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_minus.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_minus.gif
new file mode 100644 (file)
index 0000000..575d40b
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_minus.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_plus.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_plus.gif
new file mode 100644 (file)
index 0000000..e47eb96
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_plus.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_resize_se.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_resize_se.gif
new file mode 100644 (file)
index 0000000..bab7e3d
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_resize_se.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_down.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_down.gif
new file mode 100644 (file)
index 0000000..4e5b7d8
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_down.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_left.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_left.gif
new file mode 100644 (file)
index 0000000..10d6f24
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_left.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_right.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_right.gif
new file mode 100644 (file)
index 0000000..3c14c5a
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_right.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_up.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_up.gif
new file mode 100644 (file)
index 0000000..7806bec
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_up.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/f58400_40x100_textures_05_inset_soft_30.png b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/f58400_40x100_textures_05_inset_soft_30.png
new file mode 100644 (file)
index 0000000..301f49e
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/f58400_40x100_textures_05_inset_soft_30.png differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_leftright.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_leftright.gif
new file mode 100644 (file)
index 0000000..b23fdec
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_leftright.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_updown.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_updown.gif
new file mode 100644 (file)
index 0000000..71733b7
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_updown.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_close.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_close.gif
new file mode 100644 (file)
index 0000000..2cdf72f
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_close.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_doc.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_doc.gif
new file mode 100644 (file)
index 0000000..586b716
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_doc.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_closed.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_closed.gif
new file mode 100644 (file)
index 0000000..8e4108e
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_closed.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_open.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_open.gif
new file mode 100644 (file)
index 0000000..5f849a2
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_open.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_minus.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_minus.gif
new file mode 100644 (file)
index 0000000..900461f
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_minus.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_plus.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_plus.gif
new file mode 100644 (file)
index 0000000..5047f3d
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_plus.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_down.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_down.gif
new file mode 100644 (file)
index 0000000..43b59a1
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_down.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_left.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_left.gif
new file mode 100644 (file)
index 0000000..c501d76
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_left.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_right.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_right.gif
new file mode 100644 (file)
index 0000000..ab14178
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_right.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_up.gif b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_up.gif
new file mode 100644 (file)
index 0000000..957d108
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_up.gif differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/slider-handle.png b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/slider-handle.png
new file mode 100644 (file)
index 0000000..de7dbbd
Binary files /dev/null and b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/images/slider-handle.png differ
diff --git a/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/ui.all.css b/wrt/misc/rss/preview/script/jquery-ui/css/ui-darkness/ui.all.css
new file mode 100644 (file)
index 0000000..39b7b79
--- /dev/null
@@ -0,0 +1,630 @@
+/*
+ * jQuery UI screen structure and presentation
+ * This CSS file was generated by ThemeRoller, a Filament Group Project for jQuery UI
+ * Author: Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com
+ * Visit ThemeRoller.com
+*/
+
+/*
+ * Note: If your ThemeRoller settings have a font size set in ems, your components will scale according to their parent element's font size.
+ * As a rule of thumb, set your body's font size to 62.5% to make 1em = 10px.
+ * body {font-size: 62.5%;}
+*/
+
+
+
+/*UI accordion*/
+.ui-accordion {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       font-size: 0.8em;
+       border-bottom: 1px solid #666666;
+}
+.ui-accordion-group {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       border: 1px solid #666666;
+       border-bottom: none;
+}
+.ui-accordion-header {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       cursor: pointer;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+}
+.ui-accordion-header a {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       display: block;
+       font-size: 0.8em;
+       font-weight: bold;
+       text-decoration: none;
+       padding: .5em .5em .5em 1.7em;
+       color: #eeeeee;
+       background: url(images/cccccc_7x7_arrow_right.gif) .5em 50% no-repeat;
+}
+.ui-accordion-header a:hover {
+       background: url(images/ffffff_7x7_arrow_right.gif) .5em 50% no-repeat;
+       color: #ffffff;
+}
+.ui-accordion-header:hover {
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+       color: #ffffff;
+}
+.selected .ui-accordion-header, .selected .ui-accordion-header:hover {
+       background: #f58400 url(images/f58400_40x100_textures_05_inset_soft_30.png) 0 50% repeat-x;
+}
+.selected .ui-accordion-header a, .selected .ui-accordion-header a:hover {
+       color: #ffffff;
+       background: url(images/222222_7x7_arrow_down.gif) .5em 50% no-repeat;
+}
+.ui-accordion-content {
+       background: #000000 url(images/000000_40x100_textures_05_inset_soft_25.png) 0 bottom repeat-x;
+       color: #ffffff;
+       font-size: 0.8em;
+}
+.ui-accordion-content p {
+       padding: 0.8em 1.7em 0.6em;
+}
+
+
+
+
+
+
+/*UI tabs*/
+.ui-tabs-nav {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       font-size: 1.0.8em;
+/*
+       float: left;
+
+*/     position: relative;
+       z-index: 1;
+/*
+       border-right: 1px solid #666666;
+*/
+       bottom: -1px;
+}
+.ui-tabs-nav ul {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+}
+.ui-tabs-nav li {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       float: left;
+       border: 1px solid #666666;
+       border-right: none;
+}
+.ui-tabs-nav li a {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       float: left;
+       font-size: 0.8em;
+       font-weight: bold;
+       text-decoration: none;
+       padding: .5em 1.7em;
+       color: #eeeeee;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+}
+.ui-tabs-nav li a:hover {
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+       color: #ffffff;
+}
+.ui-tabs-nav li.ui-tabs-selected {
+       border-bottom-color: #f58400;
+}
+.ui-tabs-nav li.ui-tabs-selected a, .ui-tabs-nav li.ui-tabs-selected a:hover {
+       background: #f58400 url(images/f58400_40x100_textures_05_inset_soft_30.png) 0 50% repeat-x;
+       color: #ffffff;
+}
+.ui-tabs-panel {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       clear:left;
+       border-top: 1px solid #666666;
+/*
+       background: #000000 url(images/000000_40x100_textures_05_inset_soft_25.png) 0 bottom repeat-x;
+
+*/     color: #ffffff;
+       padding: 15px;  
+       font-size: 1.0.8em;
+}
+.ui-tabs-hide {
+       display: none;/* for accessible hiding: position: absolute; left: -99999999px*/;
+}
+
+
+
+
+
+/*slider*/
+.ui-slider {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       font-size: 1.0.8em;
+       background: #000000 url(images/000000_40x100_textures_05_inset_soft_25.png) 0 bottom repeat-x;
+       border: 1px solid #666666;
+       height: .8em;
+       position: relative;
+}
+.ui-slider-handle {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       position: absolute;
+       z-index: 2;
+       top: -7px;
+/*     width: 1.2em;
+       height: 1.2em;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+       border: 1px solid #666666;
+*/
+       background-image: url(images/slider-handle.png);
+       background-repeat: no-repeat;
+       background-position: 0px 0px;
+       height: 19px;
+       width: 17px;
+}
+.ui-slider-handle:hover {
+       background-position: 0px -19px;
+}
+.ui-slider-handle-active, .ui-slider-handle-active:hover {
+       background-position: 0px -38px;
+}
+.ui-slider-range {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       height: .8em;
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+       position: absolute;
+       border: 1px solid #666666;
+       border-left: 0;
+       border-right: 0;
+       top: -1px;
+       z-index: 1;
+       opacity:.7;
+/*
+       filter:Alpha(Opacity=70);
+
+*/}
+
+
+
+
+
+
+/*dialog*/
+.ui-dialog {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       font-size: 0.9em;
+       background: #000000 url(images/000000_40x100_textures_05_inset_soft_25.png) 0 bottom repeat-x;
+       color: #ffffff;
+       border: 4px solid #666666;
+       position: relative;
+}
+.ui-resizable-handle {
+       position: absolute;
+       font-size: 0.1px;
+       z-index: 99999;
+}
+.ui-resizable .ui-resizable-handle {
+       display: block; 
+}
+body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
+body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
+.ui-resizable-n { 
+       cursor: n-resize; 
+       height: 7px; 
+       width: 100%; 
+       top: -5px; 
+       left: 0px;  
+}
+.ui-resizable-s { 
+       cursor: s-resize; 
+       height: 7px; 
+       width: 100%; 
+       bottom: -5px; 
+       left: 0px; 
+}
+.ui-resizable-e { 
+       cursor: e-resize; 
+       width: 7px; 
+       right: -5px; 
+       top: 0px; 
+       height: 100%; 
+}
+.ui-resizable-w { 
+       cursor: w-resize; 
+       width: 7px; 
+       left: -5px; 
+       top: 0px; 
+       height: 100%;
+}
+.ui-resizable-se { 
+       cursor: se-resize; 
+       width: 13px; 
+       height: 13px; 
+       right: 0px; 
+       bottom: 0px; 
+       background: url(images/cccccc_11x11_icon_resize_se.gif) no-repeat 0 0;
+}
+.ui-resizable-sw { 
+       cursor: sw-resize; 
+       width: 9px; 
+       height: 9px; 
+       left: 0px; 
+       bottom: 0px;  
+}
+.ui-resizable-nw { 
+       cursor: nw-resize; 
+       width: 9px; 
+       height: 9px; 
+       left: 0px; 
+       top: 0px; 
+}
+.ui-resizable-ne { 
+       cursor: ne-resize; 
+       width: 9px; 
+       height: 9px; 
+       right: 0px; 
+       top: 0px; 
+}
+.ui-dialog-titlebar {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       padding: .5em 1.5em .5em 0.8em;
+       color: #eeeeee;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+       border-bottom: 1px solid #666666;
+       font-size: 0.8em;
+       font-weight: bold;
+       position: relative;
+}
+.ui-dialog-title {}
+.ui-dialog-titlebar-close {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       background: url(images/cccccc_11x11_icon_close.gif) 0 0 no-repeat;
+       position: absolute;
+       right: 8px;
+       top: .7em;
+       width: 11px;
+       height: 11px;
+       z-index: 100;
+       cursor: pointer !important;
+}
+.ui-dialog-titlebar-close-hover, .ui-dialog-titlebar-close:hover {
+       background: url(images/ffffff_11x11_icon_close.gif) 0 0 no-repeat;
+}
+.ui-dialog-titlebar-close:active {
+       background: url(images/222222_11x11_icon_close.gif) 0 0 no-repeat;
+}
+.ui-dialog-titlebar-close span {
+       display: none;
+}
+.ui-dialog-content {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       color: #ffffff;
+/*
+       padding: 1.5em 1.7em;   
+*/
+       padding-left: 1px;
+}
+.ui-dialog-buttonpane {
+       position: absolute;
+       bottom: 0;
+       width: 100%;
+       text-align: left;
+       border-top: 1px solid #666666;
+       background: #000000;
+}
+.ui-dialog-buttonpane button {
+       margin: .5em 8px .5em 0;
+       color: #eeeeee;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+       font-size: 0.8em;
+       font-weight: bolder;
+       border: 1px solid #666666;
+       cursor: pointer;
+       padding: .2em .6em .3em .6em;
+       line-height: 1.4em;
+       float: right;
+}
+.ui-dialog-buttonpane button:hover {
+       color: #ffffff;
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+       border: 1px solid #4bd94b;
+}
+.ui-dialog-buttonpane button:active {
+       color: #ffffff;
+       background: #f58400 url(images/f58400_40x100_textures_05_inset_soft_30.png) 0 50% repeat-x;
+       border: 1px solid #ffaf0f;
+}
+/* This file skins dialog */
+.ui-dialog.ui-draggable .ui-dialog-titlebar,
+.ui-dialog.ui-draggable .ui-dialog-titlebar {
+       cursor: move;
+}
+
+
+
+
+
+
+
+/*datepicker*/
+/* Main Style Sheet for jQuery UI date picker */
+.ui-datepicker-div, .ui-datepicker-inline, #ui-datepicker-div {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       background: #000000 url(images/000000_40x100_textures_05_inset_soft_25.png) 0 bottom repeat-x;
+       font-size: 1.0.8em;
+       border: 4px solid #666666;
+       width: 15.5em;
+       padding: 2.5em .5em .5em .5em;
+       position: relative;
+}
+.ui-datepicker-div, #ui-datepicker-div {
+       z-index: 9999; /*must have*/
+       display: none;
+}
+.ui-datepicker-inline {
+       float: left;
+       display: block;
+}
+.ui-datepicker-control {
+       display: none;
+}
+.ui-datepicker-current {
+       display: none;
+}
+.ui-datepicker-next, .ui-datepicker-prev {
+       position: absolute;
+       left: .5em;
+       top: .5em;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+}
+.ui-datepicker-next {
+       left: 14.6em;
+}
+.ui-datepicker-next:hover, .ui-datepicker-prev:hover {
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+}
+.ui-datepicker-next a, .ui-datepicker-prev a {
+       text-indent: -999999px;
+       width: 1.3em;
+       height: 1.4em;
+       display: block;
+       font-size: 0.8em;
+       background: url(images/cccccc_7x7_arrow_left.gif) 50% 50% no-repeat;
+       border: 1px solid #666666;
+       cursor: pointer;
+}
+.ui-datepicker-next a {
+       background: url(images/cccccc_7x7_arrow_right.gif) 50% 50% no-repeat;
+}
+.ui-datepicker-prev a:hover {
+       background: url(images/ffffff_7x7_arrow_left.gif) 50% 50% no-repeat;
+}
+.ui-datepicker-next a:hover {
+       background: url(images/ffffff_7x7_arrow_right.gif) 50% 50% no-repeat;
+}
+.ui-datepicker-prev a:active {
+       background: url(images/222222_7x7_arrow_left.gif) 50% 50% no-repeat;
+}
+.ui-datepicker-next a:active {
+       background: url(images/222222_7x7_arrow_right.gif) 50% 50% no-repeat;
+}
+.ui-datepicker-header select {
+       border: 1px solid #666666;
+       color: #eeeeee;
+       background: #555555;
+       font-size: 0.8em;
+       line-height: 1.4em;
+       position: absolute;
+       top: .5em;
+       margin: 0 !important;
+}
+.ui-datepicker-header option:focus, .ui-datepicker-header option:hover {
+       background: #0078a3;
+}
+.ui-datepicker-header select.ui-datepicker-new-month {
+       width: 7em;
+       left: 2.2em;
+}
+.ui-datepicker-header select.ui-datepicker-new-year {
+       width: 5em;
+       left: 9.4em;
+}
+table.ui-datepicker {
+       width: 15.5em;
+       text-align: right;
+}
+table.ui-datepicker td a {
+       padding: .0.8em .3em .0.8em 0;
+       display: block;
+       color: #eeeeee;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+       cursor: pointer;
+       border: 1px solid #000000;
+}
+table.ui-datepicker td a:hover {
+       border: 1px solid #4bd94b;
+       color: #ffffff;
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+}
+table.ui-datepicker td a:active {
+       border: 1px solid #ffaf0f;
+       color: #ffffff;
+       background: #f58400 url(images/f58400_40x100_textures_05_inset_soft_30.png) 0 50% repeat-x;
+}
+table.ui-datepicker .ui-datepicker-title-row td {
+       padding: .3em 0;
+       text-align: center;
+       font-size: .9em;
+       color: #ffffff;
+       text-transform: uppercase;
+}
+table.ui-datepicker .ui-datepicker-title-row td a {
+       color: #ffffff;
+}
+.ui-datepicker-cover {
+       display: none;
+       display: block;
+       position: absolute;
+       z-index: -1;
+/*
+       filter: mask();
+
+*/     top: -4px;
+       left: -4px;
+       width: 193px;
+       height: 200px;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/*
+Generic ThemeRoller Classes
+>> Make your jQuery Components ThemeRoller-Compatible!
+*/
+
+/*component global class*/
+.ui-component {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       font-size: 1.0.8em;
+}
+/*component content styles*/
+.ui-component-content {
+       border: 1px solid #666666;
+       background: #000000 url(images/000000_40x100_textures_05_inset_soft_25.png) 0 bottom repeat-x;
+       color: #ffffff;
+}
+.ui-component-content a {
+       color: #ffffff;
+       text-decoration: underline;
+}
+/*component states*/
+.ui-default-state {
+       border: 1px solid #666666;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+       font-weight: bold;
+       color: #eeeeee !important;
+}
+.ui-default-state a {
+       color: #eeeeee;
+}
+.ui-default-state:hover, .ui-hover-state {
+       border: 1px solid #4bd94b;
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+       font-weight: bold;
+       color: #ffffff !important;
+}
+.ui-hover-state a {
+       color: #ffffff;
+}
+.ui-default-state:active, .ui-active-state {
+       border: 1px solid #ffaf0f;
+       background: #f58400 url(images/f58400_40x100_textures_05_inset_soft_30.png) 0 50% repeat-x;
+       font-weight: bold;
+       color: #ffffff !important;
+       outline: none;
+}
+.ui-active-state a {
+       color: #ffffff;
+       outline: none;
+}
+/*icons*/
+.ui-arrow-right-default {background: url(images/cccccc_7x7_arrow_right.gif) no-repeat 50% 50%;}
+.ui-arrow-right-default:hover, .ui-arrow-right-hover {background: url(images/ffffff_7x7_arrow_right.gif) no-repeat 50% 50%;}
+.ui-arrow-right-default:active, .ui-arrow-right-active {background: url(images/222222_7x7_arrow_right.gif) no-repeat 50% 50%;}
+.ui-arrow-right-content {background: url(images/cccccc_7x7_arrow_right.gif) no-repeat 50% 50%;}
+
+.ui-arrow-left-default {background: url(images/cccccc_7x7_arrow_left.gif) no-repeat 50% 50%;}
+.ui-arrow-left-default:hover, .ui-arrow-left-hover {background: url(images/ffffff_7x7_arrow_left.gif) no-repeat 50% 50%;}
+.ui-arrow-left-default:active, .ui-arrow-left-active {background: url(images/222222_7x7_arrow_left.gif) no-repeat 50% 50%;}
+.ui-arrow-left-content {background: url(images/cccccc_7x7_arrow_left.gif) no-repeat 50% 50%;}
+
+.ui-arrow-down-default {background: url(images/cccccc_7x7_arrow_down.gif) no-repeat 50% 50%;}
+.ui-arrow-down-default:hover, .ui-arrow-down-hover {background: url(images/ffffff_7x7_arrow_down.gif) no-repeat 50% 50%;}
+.ui-arrow-down-default:active, .ui-arrow-down-active {background: url(images/222222_7x7_arrow_down.gif) no-repeat 50% 50%;}
+.ui-arrow-down-content {background: url(images/cccccc_7x7_arrow_down.gif) no-repeat 50% 50%;}
+
+.ui-arrow-up-default {background: url(images/cccccc_7x7_arrow_up.gif) no-repeat 50% 50%;}
+.ui-arrow-up-default:hover, .ui-arrow-up-hover {background: url(images/ffffff_7x7_arrow_up.gif) no-repeat 50% 50%;}
+.ui-arrow-up-default:active, .ui-arrow-up-active {background: url(images/222222_7x7_arrow_up.gif) no-repeat 50% 50%;}
+.ui-arrow-up-content {background: url(images/cccccc_7x7_arrow_up.gif) no-repeat 50% 50%;}
+
+.ui-close-default {background: url(images/cccccc_11x11_icon_close.gif) no-repeat 50% 50%;}
+.ui-close-default:hover, .ui-close-hover {background: url(images/ffffff_11x11_icon_close.gif) no-repeat 50% 50%;}
+.ui-close-default:active, .ui-close-active {background: url(images/222222_11x11_icon_close.gif) no-repeat 50% 50%;}
+.ui-close-content {background: url(images/222222_11x11_icon_close.gif) no-repeat 50% 50%;}
+
+.ui-folder-closed-default {background: url(images/cccccc_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
+.ui-folder-closed-default:hover, .ui-folder-closed-hover {background: url(images/ffffff_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
+.ui-folder-closed-default:active, .ui-folder-closed-active {background: url(images/222222_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
+.ui-folder-closed-content {background: url(images/cccccc_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
+
+.ui-folder-open-default {background: url(images/cccccc_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
+.ui-folder-open-default:hover, .ui-folder-open-hover {background: url(images/ffffff_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
+.ui-folder-open-default:active, .ui-folder-open-active {background: url(images/222222_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
+.ui-folder-open-content {background: url(images/222222_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
+
+.ui-doc-default {background: url(images/cccccc_11x11_icon_doc.gif) no-repeat 50% 50%;}
+.ui-doc-default:hover, .ui-doc-hover {background: url(images/ffffff_11x11_icon_doc.gif) no-repeat 50% 50%;}
+.ui-doc-default:active, .ui-doc-active {background: url(images/222222_11x11_icon_doc.gif) no-repeat 50% 50%;}
+.ui-doc-content {background: url(images/cccccc_11x11_icon_doc.gif) no-repeat 50% 50%;}
+
+.ui-arrows-leftright-default {background: url(images/cccccc_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
+.ui-arrows-leftright-default:hover, .ui-arrows-leftright-hover {background: url(images/ffffff_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
+.ui-arrows-leftright-default:active, .ui-arrows-leftright-active {background: url(images/222222_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
+.ui-arrows-leftright-content {background: url(images/cccccc_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
+
+.ui-arrows-updown-default {background: url(images/cccccc_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
+.ui-arrows-updown-default:hover, .ui-arrows-updown-hover {background: url(images/ffffff_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
+.ui-arrows-updown-default:active, .ui-arrows-updown-active {background: url(images/222222_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
+.ui-arrows-updown-content {background: url(images/cccccc_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
+
+.ui-minus-default {background: url(images/cccccc_11x11_icon_minus.gif) no-repeat 50% 50%;}
+.ui-minus-default:hover, .ui-minus-hover {background: url(images/ffffff_11x11_icon_minus.gif) no-repeat 50% 50%;}
+.ui-minus-default:active, .ui-minus-active {background: url(images/222222_11x11_icon_minus.gif) no-repeat 50% 50%;}
+.ui-minus-content {background: url(images/cccccc_11x11_icon_minus.gif) no-repeat 50% 50%;}
+
+.ui-plus-default {background: url(images/cccccc_11x11_icon_plus.gif) no-repeat 50% 50%;}
+.ui-plus-default:hover, .ui-plus-hover {background: url(images/ffffff_11x11_icon_plus.gif) no-repeat 50% 50%;}
+.ui-plus-default:active, .ui-plus-active {background: url(images/222222_11x11_icon_plus.gif) no-repeat 50% 50%;}
+.ui-plus-content {background: url(images/cccccc_11x11_icon_plus.gif) no-repeat 50% 50%;}
+
+/*hidden elements*/
+.ui-hidden {
+       display: none;/* for accessible hiding: position: absolute; left: -99999999px*/;
+}
+.ui-accessible-hidden {
+        position: absolute; left: -99999999px;
+}
+/*reset styles*/
+.ui-reset {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+}
+/*clearfix class*/
+.ui-clearfix:after {
+    content: "."; 
+    display: block; 
+    height: 0; 
+    clear: both; 
+    visibility: hidden;
+}
+.ui-clearfix {display: block;}
+/* Hides from IE-mac \*/
+* html .ui-clearfix {height: 1%;}
+.ui-clearfix {display: block;}
+/* End hide from IE-mac */
+
+/* Note: for resizable styles, use the styles listed above in the dialog section */
+
+
diff --git a/wrt/misc/rss/preview/script/jquery-ui/js/jquery-1.2.6.min.js b/wrt/misc/rss/preview/script/jquery-ui/js/jquery-1.2.6.min.js
new file mode 100644 (file)
index 0000000..82b98e1
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * jQuery 1.2.6 - New Wave Javascript
+ *
+ * Copyright (c) 2008 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
+ * $Rev: 5685 $
+ */
+(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
+return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
+return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
+selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
+return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
+this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
+return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
+jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
+script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else
+for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else
+for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
+jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
+ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
+while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
+while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
+for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
+jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
+xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
+jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
+for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
+s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
+e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/script/jquery-ui/js/jquery-ui-1.6.custom.min.js b/wrt/misc/rss/preview/script/jquery-ui/js/jquery-ui-1.6.custom.min.js
new file mode 100644 (file)
index 0000000..56de588
--- /dev/null
@@ -0,0 +1,78 @@
+/*\r
+ * jQuery UI 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI\r
+ */\r(function(C){var I=C.fn.remove,D=C.browser.mozilla&&(parseFloat(C.browser.version)<1.9);C.ui={version:"1.6",plugin:{add:function(K,L,N){var M=C.ui[K].prototype;for(var J in N){M.plugins[J]=M.plugins[J]||[];M.plugins[J].push([L,N[J]])}},call:function(J,L,K){var N=J.plugins[L];if(!N){return }for(var M=0;M<N.length;M++){if(J.options[N[M][0]]){N[M][1].apply(J.element,K)}}}},contains:function(L,K){var J=C.browser.safari&&C.browser.version<522;if(L.contains&&!J){return L.contains(K)}if(L.compareDocumentPosition){return !!(L.compareDocumentPosition(K)&16)}while(K=K.parentNode){if(K==L){return true}}return false},cssCache:{},css:function(J){if(C.ui.cssCache[J]){return C.ui.cssCache[J]}var K=C('<div class="ui-gen">').addClass(J).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[J]=!!((!(/auto|default/).test(K.css("cursor"))||(/^[1-9]/).test(K.css("height"))||(/^[1-9]/).test(K.css("width"))||!(/none/).test(K.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(K.css("backgroundColor"))));try{C("body").get(0).removeChild(K.get(0))}catch(L){}return C.ui.cssCache[J]},hasScroll:function(M,K){if(C(M).css("overflow")=="hidden"){return false}var J=(K&&K=="left")?"scrollLeft":"scrollTop",L=false;if(M[J]>0){return true}M[J]=1;L=(M[J]>0);M[J]=0;return L},isOverAxis:function(K,J,L){return(K>J)&&(K<(J+L))},isOver:function(O,K,N,M,J,L){return C.ui.isOverAxis(O,N,J)&&C.ui.isOverAxis(K,M,L)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(D){var F=C.attr,E=C.fn.removeAttr,H="http://www.w3.org/2005/07/aaa",A=/^aria-/,B=/^wairole:/;C.attr=function(K,J,L){var M=L!==undefined;return(J=="role"?(M?F.call(this,K,J,"wairole:"+L):(F.apply(this,arguments)||"").replace(B,"")):(A.test(J)?(M?K.setAttributeNS(H,J.replace(A,"aaa:"),L):F.call(this,K,J.replace(A,"aaa:"))):F.apply(this,arguments)))};C.fn.removeAttr=function(J){return(A.test(J)?this.each(function(){this.removeAttributeNS(H,J.replace(A,""))}):E.call(this,J))}}C.fn.extend({remove:function(){C("*",this).add(this).each(function(){C(this).triggerHandler("remove")});return I.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var J;if((C.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){J=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(C.curCSS(this,"position",1))&&(/(auto|scroll)/).test(C.curCSS(this,"overflow",1)+C.curCSS(this,"overflow-y",1)+C.curCSS(this,"overflow-x",1))}).eq(0)}else{J=this.parents().filter(function(){return(/(auto|scroll)/).test(C.curCSS(this,"overflow",1)+C.curCSS(this,"overflow-y",1)+C.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!J.length?C(document):J}});C.extend(C.expr[":"],{data:function(K,L,J){return C.data(K,J[3])},tabbable:function(L,M,K){var N=L.nodeName.toLowerCase();function J(O){return !(C(O).is(":hidden")||C(O).parents(":hidden").length)}return(L.tabIndex>=0&&(("a"==N&&L.href)||(/input|select|textarea|button/.test(N)&&"hidden"!=L.type&&!L.disabled))&&J(L))}});function G(M,N,O,L){function K(Q){var P=C[M][N][Q]||[];return(typeof P=="string"?P.split(/,?\s+/):P)}var J=K("getter");if(L.length==1&&typeof L[0]=="string"){J=J.concat(K("getterSetter"))}return(C.inArray(O,J)!=-1)}C.widget=function(K,J){var L=K.split(".")[0];K=K.split(".")[1];C.fn[K]=function(P){var N=(typeof P=="string"),O=Array.prototype.slice.call(arguments,1);if(N&&P.substring(0,1)=="_"){return this}if(N&&G(L,K,P,O)){var M=C.data(this[0],K);return(M?M[P].apply(M,O):undefined)}return this.each(function(){var Q=C.data(this,K);(!Q&&!N&&C.data(this,K,new C[L][K](this,P)));(Q&&N&&C.isFunction(Q[P])&&Q[P].apply(Q,O))})};C[L]=C[L]||{};C[L][K]=function(O,N){var M=this;this.widgetName=K;this.widgetEventPrefix=C[L][K].eventPrefix||K;this.widgetBaseClass=L+"-"+K;this.options=C.extend({},C.widget.defaults,C[L][K].defaults,C.metadata&&C.metadata.get(O)[K],N);this.element=C(O).bind("setData."+K,function(Q,P,R){return M._setData(P,R)}).bind("getData."+K,function(Q,P){return M._getData(P)}).bind("remove",function(){return M.destroy()});this._init()};C[L][K].prototype=C.extend({},C.widget.prototype,J);C[L][K].getterSetter="option"};C.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName)},option:function(L,M){var K=L,J=this;if(typeof L=="string"){if(M===undefined){return this._getData(L)}K={};K[L]=M}C.each(K,function(N,O){J._setData(N,O)})},_getData:function(J){return this.options[J]},_setData:function(J,K){this.options[J]=K;if(J=="disabled"){this.element[K?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(K,L,M){var J=(K==this.widgetEventPrefix?K:this.widgetEventPrefix+K);L=L||C.event.fix({type:J,target:this.element[0]});return this.element.triggerHandler(J,[L,M],this.options[K])}};C.widget.defaults={disabled:false};C.ui.mouse={_mouseInit:function(){var J=this;this.element.bind("mousedown."+this.widgetName,function(K){return J._mouseDown(K)}).bind("click."+this.widgetName,function(K){if(J._preventClickEvent){J._preventClickEvent=false;return false}});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(L){(this._mouseStarted&&this._mouseUp(L));this._mouseDownEvent=L;var K=this,M=(L.which==1),J=(typeof this.options.cancel=="string"?C(L.target).parents().add(L.target).filter(this.options.cancel).length:false);if(!M||J||!this._mouseCapture(L)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){K.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(L)&&this._mouseDelayMet(L)){this._mouseStarted=(this._mouseStart(L)!==false);if(!this._mouseStarted){L.preventDefault();return true}}this._mouseMoveDelegate=function(N){return K._mouseMove(N)};this._mouseUpDelegate=function(N){return K._mouseUp(N)};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);if(!C.browser.safari){L.preventDefault()}return true},_mouseMove:function(J){if(C.browser.msie&&!J.button){return this._mouseUp(J)}if(this._mouseStarted){this._mouseDrag(J);return J.preventDefault()}if(this._mouseDistanceMet(J)&&this._mouseDelayMet(J)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,J)!==false);(this._mouseStarted?this._mouseDrag(J):this._mouseUp(J))}return !this._mouseStarted},_mouseUp:function(J){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=true;this._mouseStop(J)}return false},_mouseDistanceMet:function(J){return(Math.max(Math.abs(this._mouseDownEvent.pageX-J.pageX),Math.abs(this._mouseDownEvent.pageY-J.pageY))>=this.options.distance)},_mouseDelayMet:function(J){return this.mouseDelayMet},_mouseStart:function(J){},_mouseDrag:function(J){},_mouseStop:function(J){},_mouseCapture:function(J){return true}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);/*\r
+ * jQuery UI Draggable 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI/Draggables\r
+ *\r
+ * Depends:\r
+ *     ui.core.js\r
+ */\r(function(A){A.widget("ui.draggable",A.extend({},A.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return }this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(B){var C=this.options;if(this.helper||C.disabled||A(B.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(B);if(!this.handle){return false}return true},_mouseStart:function(B){var C=this.options;this.helper=this._createHelper(B);this._cacheHelperProportions();if(A.ui.ddmanager){A.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};A.extend(this.offset,{click:{left:B.pageX-this.offset.left,top:B.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});if(C.cursorAt){this._adjustOffsetFromHelper(C.cursorAt)}this.originalPosition=this._generatePosition(B);if(C.containment){this._setContainment()}this._propagate("start",B);this._cacheHelperProportions();if(A.ui.ddmanager&&!C.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,B)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(B,true);return true},_mouseDrag:function(B,C){this.position=this._generatePosition(B);this.positionAbs=this._convertPositionTo("absolute");if(!C){this.position=this._propagate("drag",B)||this.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false},_mouseStop:function(C){var D=false;if(A.ui.ddmanager&&!this.options.dropBehaviour){var D=A.ui.ddmanager.drop(this,C)}if((this.options.revert=="invalid"&&!D)||(this.options.revert=="valid"&&D)||this.options.revert===true||(A.isFunction(this.options.revert)&&this.options.revert.call(this.element,D))){var B=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){B._propagate("stop",C);B._clear()})}else{this._propagate("stop",C);this._clear()}return false},_getHandle:function(B){var C=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==B.target){C=true}});return C},_createHelper:function(C){var D=this.options;var B=A.isFunction(D.helper)?A(D.helper.apply(this.element[0],[C])):(D.helper=="clone"?this.element.clone():this.element);if(!B.parents("body").length){B.appendTo((D.appendTo=="parent"?this.element[0].parentNode:D.appendTo))}if(B[0]!=this.element[0]&&!(/(fixed|absolute)/).test(B.css("position"))){B.css("position","absolute")}return B},_adjustOffsetFromHelper:function(B){if(B.left!=undefined){this.offset.click.left=B.left+this.margins.left}if(B.right!=undefined){this.offset.click.left=this.helperProportions.width-B.right+this.margins.left}if(B.top!=undefined){this.offset.click.top=B.top+this.margins.top}if(B.bottom!=undefined){this.offset.click.top=this.helperProportions.height-B.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if((this.offsetParent[0]==document.body&&A.browser.mozilla)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&A.browser.msie)){B={top:0,left:0}}return{top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var B=this.element.position();return{top:B.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:B.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var E=this.options;if(E.containment=="parent"){E.containment=this.helper[0].parentNode}if(E.containment=="document"||E.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(E.containment=="document"?document:window).width()-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),(A(E.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}if(!(/^(document|window|parent)$/).test(E.containment)){var C=A(E.containment)[0];var D=A(E.containment).offset();var B=(A(C).css("overflow")!="hidden");this.containment=[D.left+(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.margins.left,D.top+(parseInt(A(C).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.margins.top,D.left+(B?Math.max(C.scrollWidth,C.offsetWidth):C.offsetWidth)-(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left,D.top+(B?Math.max(C.scrollHeight,C.offsetHeight):C.offsetHeight)-(parseInt(A(C).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(D,F){if(!F){F=this.position}var C=D=="absolute"?1:-1;var B=this[(this.cssPosition=="absolute"?"offset":"scroll")+"Parent"],E=(/(html|body)/i).test(B[0].tagName);return{top:(F.top+this.offset.relative.top*C+this.offset.parent.top*C+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(E?0:B.scrollTop()))*C+this.margins.top*C),left:(F.left+this.offset.relative.left*C+this.offset.parent.left*C+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():(E?0:B.scrollLeft()))*C+this.margins.left*C)}},_generatePosition:function(D){var G=this.options,C=this[(this.cssPosition=="absolute"?"offset":"scroll")+"Parent"],H=(/(html|body)/i).test(C[0].tagName);var B={top:(D.pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(H?0:C.scrollTop()))),left:(D.pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():H?0:C.scrollLeft()))};if(!this.originalPosition){return B}if(this.containment){if(B.left<this.containment[0]){B.left=this.containment[0]}if(B.top<this.containment[1]){B.top=this.containment[1]}if(B.left>this.containment[2]){B.left=this.containment[2]}if(B.top>this.containment[3]){B.top=this.containment[3]}}if(G.grid){var F=this.originalPosition.top+Math.round((B.top-this.originalPosition.top)/G.grid[1])*G.grid[1];B.top=this.containment?(!(F<this.containment[1]||F>this.containment[3])?F:(!(F<this.containment[1])?F-G.grid[1]:F+G.grid[1])):F;var E=this.originalPosition.left+Math.round((B.left-this.originalPosition.left)/G.grid[0])*G.grid[0];B.left=this.containment?(!(E<this.containment[0]||E>this.containment[2])?E:(!(E<this.containment[0])?E-G.grid[0]:E+G.grid[0])):E}return B},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_propagate:function(C,B){A.ui.plugin.call(this,C,[B,this._uiHash()]);if(C=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return this.element.triggerHandler(C=="drag"?C:"drag"+C,[B,this._uiHash()],this.options[C])},plugins:{},_uiHash:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options}}}));A.extend(A.ui.draggable,{version:"1.6",defaults:{appendTo:"parent",axis:false,cancel:":input",connectToSortable:false,containment:false,cssNamespace:"ui",cursor:"default",cursorAt:null,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:1,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:null}});A.ui.plugin.add("draggable","connectToSortable",{start:function(B,D){var C=A(this).data("draggable");C.sortables=[];A(D.options.connectToSortable).each(function(){A(this+"").each(function(){if(A.data(this,"sortable")){var E=A.data(this,"sortable");C.sortables.push({instance:E,shouldRevert:E.options.revert});E._refreshItems();E._propagate("activate",B,C)}})})},stop:function(B,D){var C=A(this).data("draggable");A.each(C.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;C.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(B);this.instance.element.triggerHandler("sortreceive",[B,A.extend(this.instance._ui(),{sender:C.element})],this.instance.options["receive"]);this.instance.options.helper=this.instance.options._helper;if(C.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._propagate("deactivate",B,C)}})},drag:function(C,F){var E=A(this).data("draggable"),B=this;var D=function(I){var N=this.offset.click.top,M=this.offset.click.left;var G=this.positionAbs.top,K=this.positionAbs.left;var J=I.height,L=I.width;var O=I.top,H=I.left;return A.ui.isOver(G+N,K+M,O,H,J,L)};A.each(E.sortables,function(G){if(D.call(E,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=A(B).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return F.helper[0]};C.target=this.instance.currentItem[0];this.instance._mouseCapture(C,true);this.instance._mouseStart(C,true,true);this.instance.offset.click.top=E.offset.click.top;this.instance.offset.click.left=E.offset.click.left;this.instance.offset.parent.left-=E.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=E.offset.parent.top-this.instance.offset.parent.top;E._propagate("toSortable",C)}if(this.instance.currentItem){this.instance._mouseDrag(C)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._mouseStop(C,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}E._propagate("fromSortable",C)}}})}});A.ui.plugin.add("draggable","cursor",{start:function(C,D){var B=A("body");if(B.css("cursor")){D.options._cursor=B.css("cursor")}B.css("cursor",D.options.cursor)},stop:function(B,C){if(C.options._cursor){A("body").css("cursor",C.options._cursor)}}});A.ui.plugin.add("draggable","iframeFix",{start:function(B,C){A(C.options.iframeFix===true?"iframe":C.options.iframeFix).each(function(){A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")})},stop:function(B,C){A("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","opacity",{start:function(C,D){var B=A(D.helper);if(B.css("opacity")){D.options._opacity=B.css("opacity")}B.css("opacity",D.options.opacity)},stop:function(B,C){if(C.options._opacity){A(C.helper).css("opacity",C.options._opacity)}}});A.ui.plugin.add("draggable","scroll",{start:function(C,D){var E=D.options;var B=A(this).data("draggable");if(B.scrollParent[0]!=document&&B.scrollParent[0].tagName!="HTML"){B.overflowOffset=B.scrollParent.offset()}},drag:function(D,E){var F=E.options,B=false;var C=A(this).data("draggable");if(C.scrollParent[0]!=document&&C.scrollParent[0].tagName!="HTML"){if((C.overflowOffset.top+C.scrollParent[0].offsetHeight)-D.pageY<F.scrollSensitivity){C.scrollParent[0].scrollTop=B=C.scrollParent[0].scrollTop+F.scrollSpeed}else{if(D.pageY-C.overflowOffset.top<F.scrollSensitivity){C.scrollParent[0].scrollTop=B=C.scrollParent[0].scrollTop-F.scrollSpeed}}if((C.overflowOffset.left+C.scrollParent[0].offsetWidth)-D.pageX<F.scrollSensitivity){C.scrollParent[0].scrollLeft=B=C.scrollParent[0].scrollLeft+F.scrollSpeed}else{if(D.pageX-C.overflowOffset.left<F.scrollSensitivity){C.scrollParent[0].scrollLeft=B=C.scrollParent[0].scrollLeft-F.scrollSpeed}}}else{if(D.pageY-A(document).scrollTop()<F.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()-F.scrollSpeed)}else{if(A(window).height()-(D.pageY-A(document).scrollTop())<F.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()+F.scrollSpeed)}}if(D.pageX-A(document).scrollLeft()<F.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()-F.scrollSpeed)}else{if(A(window).width()-(D.pageX-A(document).scrollLeft())<F.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()+F.scrollSpeed)}}}if(B!==false&&A.ui.ddmanager&&!F.dropBehaviour){A.ui.ddmanager.prepareOffsets(C,D)}if(B!==false&&C.cssPosition=="absolute"&&C.scrollParent[0]!=document&&A.ui.contains(C.scrollParent[0],C.offsetParent[0])){C.offset.parent=C._getParentOffset()}if(B!==false&&C.cssPosition=="relative"&&!(C.scrollParent[0]!=document&&C.scrollParent[0]!=C.offsetParent[0])){C.offset.relative=C._getRelativeOffset()}}});A.ui.plugin.add("draggable","snap",{start:function(B,D){var C=A(this).data("draggable");C.snapElements=[];A(D.options.snap.constructor!=String?(D.options.snap.items||":data(draggable)"):D.options.snap).each(function(){var F=A(this);var E=F.offset();if(this!=C.element[0]){C.snapElements.push({item:this,width:F.outerWidth(),height:F.outerHeight(),top:E.top,left:E.left})}})},drag:function(M,K){var E=A(this).data("draggable");var Q=K.options.snapTolerance;var P=K.absolutePosition.left,O=P+E.helperProportions.width,D=K.absolutePosition.top,C=D+E.helperProportions.height;for(var N=E.snapElements.length-1;N>=0;N--){var L=E.snapElements[N].left,J=L+E.snapElements[N].width,I=E.snapElements[N].top,S=I+E.snapElements[N].height;if(!((L-Q<P&&P<J+Q&&I-Q<D&&D<S+Q)||(L-Q<P&&P<J+Q&&I-Q<C&&C<S+Q)||(L-Q<O&&O<J+Q&&I-Q<D&&D<S+Q)||(L-Q<O&&O<J+Q&&I-Q<C&&C<S+Q))){if(E.snapElements[N].snapping){(E.options.snap.release&&E.options.snap.release.call(E.element,M,A.extend(E._uiHash(),{snapItem:E.snapElements[N].item})))}E.snapElements[N].snapping=false;continue}if(K.options.snapMode!="inner"){var B=Math.abs(I-C)<=Q;var R=Math.abs(S-D)<=Q;var G=Math.abs(L-O)<=Q;var H=Math.abs(J-P)<=Q;if(B){K.position.top=E._convertPositionTo("relative",{top:I-E.helperProportions.height,left:0}).top}if(R){K.position.top=E._convertPositionTo("relative",{top:S,left:0}).top}if(G){K.position.left=E._convertPositionTo("relative",{top:0,left:L-E.helperProportions.width}).left}if(H){K.position.left=E._convertPositionTo("relative",{top:0,left:J}).left}}var F=(B||R||G||H);if(K.options.snapMode!="outer"){var B=Math.abs(I-D)<=Q;var R=Math.abs(S-C)<=Q;var G=Math.abs(L-P)<=Q;var H=Math.abs(J-O)<=Q;if(B){K.position.top=E._convertPositionTo("relative",{top:I,left:0}).top}if(R){K.position.top=E._convertPositionTo("relative",{top:S-E.helperProportions.height,left:0}).top}if(G){K.position.left=E._convertPositionTo("relative",{top:0,left:L}).left}if(H){K.position.left=E._convertPositionTo("relative",{top:0,left:J-E.helperProportions.width}).left}}if(!E.snapElements[N].snapping&&(B||R||G||H||F)){(E.options.snap.snap&&E.options.snap.snap.call(E.element,M,A.extend(E._uiHash(),{snapItem:E.snapElements[N].item})))}E.snapElements[N].snapping=(B||R||G||H||F)}}});A.ui.plugin.add("draggable","stack",{start:function(B,C){var D=A.makeArray(A(C.options.stack.group)).sort(function(F,E){return(parseInt(A(F).css("zIndex"),10)||C.options.stack.min)-(parseInt(A(E).css("zIndex"),10)||C.options.stack.min)});A(D).each(function(E){this.style.zIndex=C.options.stack.min+E});this[0].style.zIndex=C.options.stack.min+D.length}});A.ui.plugin.add("draggable","zIndex",{start:function(C,D){var B=A(D.helper);if(B.css("zIndex")){D.options._zIndex=B.css("zIndex")}B.css("zIndex",D.options.zIndex)},stop:function(B,C){if(C.options._zIndex){A(C.helper).css("zIndex",C.options._zIndex)}}})})(jQuery);/*\r
+ * jQuery UI Droppable 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI/Droppables\r
+ *\r
+ * Depends:\r
+ *     ui.core.js\r
+ *     ui.draggable.js\r
+ */\r(function(A){A.widget("ui.droppable",{_init:function(){var C=this.options,B=C.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&A.isFunction(this.options.accept)?this.options.accept:function(D){return D.is(B)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};A.ui.ddmanager.droppables[this.options.scope]=A.ui.ddmanager.droppables[this.options.scope]||[];A.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-droppable"))},destroy:function(){var B=A.ui.ddmanager.droppables[this.options.scope];for(var C=0;C<B.length;C++){if(B[C]==this){B.splice(C,1)}}this.element.removeClass("ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(B,C){if(B=="accept"){this.options.accept=C&&A.isFunction(C)?C:function(D){return D.is(accept)}}else{A.widget.prototype._setData.apply(this,arguments)}},_activate:function(C){var B=A.ui.ddmanager.current;A.ui.plugin.call(this,"activate",[C,this.ui(B)]);if(B){this.element.triggerHandler("dropactivate",[C,this.ui(B)],this.options.activate)}},_deactivate:function(C){var B=A.ui.ddmanager.current;A.ui.plugin.call(this,"deactivate",[C,this.ui(B)]);if(B){this.element.triggerHandler("dropdeactivate",[C,this.ui(B)],this.options.deactivate)}},_over:function(C){var B=A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element,(B.currentItem||B.element))){A.ui.plugin.call(this,"over",[C,this.ui(B)]);this.element.triggerHandler("dropover",[C,this.ui(B)],this.options.over)}},_out:function(C){var B=A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element,(B.currentItem||B.element))){A.ui.plugin.call(this,"out",[C,this.ui(B)]);this.element.triggerHandler("dropout",[C,this.ui(B)],this.options.out)}},_drop:function(C,D){var B=D||A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return false}var E=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var F=A.data(this,"droppable");if(F.options.greedy&&A.ui.intersect(B,A.extend(F,{offset:F.element.offset()}),F.options.tolerance)){E=true;return false}});if(E){return false}if(this.options.accept.call(this.element,(B.currentItem||B.element))){A.ui.plugin.call(this,"drop",[C,this.ui(B)]);this.element.triggerHandler("drop",[C,this.ui(B)],this.options.drop);return this.element}return false},plugins:{},ui:function(B){return{draggable:(B.currentItem||B.element),helper:B.helper,position:B.position,absolutePosition:B.positionAbs,options:this.options,element:this.element}}});A.extend(A.ui.droppable,{version:"1.6",defaults:{accept:"*",activeClass:null,cssNamespace:"ui",greedy:false,hoverClass:null,scope:"default",tolerance:"intersect"}});A.ui.intersect=function(O,I,M){if(!I.offset){return false}var D=(O.positionAbs||O.position.absolute).left,C=D+O.helperProportions.width,L=(O.positionAbs||O.position.absolute).top,K=L+O.helperProportions.height;var F=I.offset.left,B=F+I.proportions.width,N=I.offset.top,J=N+I.proportions.height;switch(M){case"fit":return(F<D&&C<B&&N<L&&K<J);break;case"intersect":return(F<D+(O.helperProportions.width/2)&&C-(O.helperProportions.width/2)<B&&N<L+(O.helperProportions.height/2)&&K-(O.helperProportions.height/2)<J);break;case"pointer":var G=((O.positionAbs||O.position.absolute).left+(O.clickOffset||O.offset.click).left),H=((O.positionAbs||O.position.absolute).top+(O.clickOffset||O.offset.click).top),E=A.ui.isOver(H,G,N,F,I.proportions.height,I.proportions.width);return E;break;case"touch":return((L>=N&&L<=J)||(K>=N&&K<=J)||(L<N&&K>J))&&((D>=F&&D<=B)||(C>=F&&C<=B)||(D<F&&C>B));break;default:return false;break}};A.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(E,G){var B=A.ui.ddmanager.droppables[E.options.scope];var F=G?G.type:null;var H=(E.currentItem||E.element).find(":data(droppable)").andSelf();droppablesLoop:for(var D=0;D<B.length;D++){if(B[D].options.disabled||(E&&!B[D].options.accept.call(B[D].element,(E.currentItem||E.element)))){continue}for(var C=0;C<H.length;C++){if(H[C]==B[D].element[0]){B[D].proportions.height=0;continue droppablesLoop}}B[D].visible=B[D].element.css("display")!="none";if(!B[D].visible){continue}B[D].offset=B[D].element.offset();B[D].proportions={width:B[D].element[0].offsetWidth,height:B[D].element[0].offsetHeight};if(F=="dragstart"||F=="sortactivate"){B[D]._activate.call(B[D],G)}}},drop:function(B,C){var D=false;A.each(A.ui.ddmanager.droppables[B.options.scope],function(){if(!this.options){return }if(!this.options.disabled&&this.visible&&A.ui.intersect(B,this,this.options.tolerance)){D=this._drop.call(this,C)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element,(B.currentItem||B.element))){this.isout=1;this.isover=0;this._deactivate.call(this,C)}});return D},drag:function(B,C){if(B.options.refreshPositions){A.ui.ddmanager.prepareOffsets(B,C)}A.each(A.ui.ddmanager.droppables[B.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return }var E=A.ui.intersect(B,this,this.options.tolerance);var G=!E&&this.isover==1?"isout":(E&&this.isover==0?"isover":null);if(!G){return }var F;if(this.options.greedy){var D=this.element.parents(":data(droppable):eq(0)");if(D.length){F=A.data(D[0],"droppable");F.greedyChild=(G=="isover"?1:0)}}if(F&&G=="isover"){F["isover"]=0;F["isout"]=1;F._out.call(F,C)}this[G]=1;this[G=="isout"?"isover":"isout"]=0;this[G=="isover"?"_over":"_out"].call(this,C);if(F&&G=="isout"){F["isout"]=0;F["isover"]=1;F._over.call(F,C)}})}};A.ui.plugin.add("droppable","activeClass",{activate:function(B,C){A(this).addClass(C.options.activeClass)},deactivate:function(B,C){A(this).removeClass(C.options.activeClass)},drop:function(B,C){A(this).removeClass(C.options.activeClass)}});A.ui.plugin.add("droppable","hoverClass",{over:function(B,C){A(this).addClass(C.options.hoverClass)},out:function(B,C){A(this).removeClass(C.options.hoverClass)},drop:function(B,C){A(this).removeClass(C.options.hoverClass)}})})(jQuery);/*\r
+ * jQuery UI Accordion 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI/Accordion\r
+ *\r
+ * Depends:\r
+ *     ui.core.js\r
+ */\r(function(E){E.widget("ui.accordion",{_init:function(){var H=this.options;if(H.navigation){var K=this.element.find("a").filter(H.navigationFilter);if(K.length){if(K.filter(H.header).length){H.active=K}else{H.active=K.parent().parent().prev();K.addClass("current")}}}H.headers=this.element.find(H.header);H.active=C(H.headers,H.active);if(E.browser.msie){this.element.find("a").css("zoom","1")}if(!this.element.hasClass("ui-accordion")){this.element.addClass("ui-accordion");E('<span class="ui-accordion-left"></span>').insertBefore(H.headers);E('<span class="ui-accordion-right"></span>').appendTo(H.headers);H.headers.addClass("ui-accordion-header")}var J;if(H.fillSpace){J=this.element.parent().height();H.headers.each(function(){J-=E(this).outerHeight()});var I=0;H.headers.next().each(function(){I=Math.max(I,E(this).innerHeight()-E(this).height())}).height(J-I)}else{if(H.autoHeight){J=0;H.headers.next().each(function(){J=Math.max(J,E(this).outerHeight())}).height(J)}}this.element.attr("role","tablist");var G=this;H.headers.attr("role","tab").bind("keydown",function(L){return G._keydown(L)}).next().attr("role","tabpanel");H.headers.not(H.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!H.active.length){H.headers.eq(0).attr("tabIndex","0")}else{H.active.attr("aria-expanded","true").attr("tabIndex","0").parent().andSelf().addClass(H.selectedClass)}if(!E.browser.safari){H.headers.find("a").attr("tabIndex","-1")}if(H.event){this.element.bind((H.event)+".accordion",F)}},destroy:function(){this.options.headers.parent().andSelf().removeClass(this.options.selectedClass);this.options.headers.prev(".ui-accordion-left").remove();this.options.headers.children(".ui-accordion-right").remove();this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoHeight){this.options.headers.next().css("height","")}E.removeData(this.element[0],"accordion");this.element.removeClass("ui-accordion").unbind(".accordion")},_keydown:function(J){if(this.options.disabled||J.altKey||J.ctrlKey){return }var K=E.ui.keyCode;var I=this.options.headers.length;var G=this.options.headers.index(J.target);var H=false;switch(J.keyCode){case K.RIGHT:case K.DOWN:H=this.options.headers[(G+1)%I];break;case K.LEFT:case K.UP:H=this.options.headers[(G-1+I)%I];break;case K.SPACE:case K.ENTER:return F.call(this.element[0],{target:J.target})}if(H){E(J.target).attr("tabIndex","-1");E(H).attr("tabIndex","0");H.focus();return false}return true},activate:function(G){F.call(this.element[0],{target:C(this.options.headers,G)[0]})}});function B(H,G){return function(){return H.apply(G,arguments)}}function D(I){if(!E.data(this,"accordion")){return }var G=E.data(this,"accordion");var H=G.options;H.running=I?0:--H.running;if(H.running){return }if(H.clearStyle){H.toShow.add(H.toHide).css({height:"",overflow:""})}G._trigger("change",null,H.data)}function A(G,N,K,L,O){var Q=E.data(this,"accordion").options;Q.toShow=G;Q.toHide=N;Q.data=K;var H=B(D,this);E.data(this,"accordion")._trigger("changestart",null,Q.data);Q.running=N.size()===0?G.size():N.size();if(Q.animated){var J={};if(!Q.alwaysOpen&&L){J={toShow:E([]),toHide:N,complete:H,down:O,autoHeight:Q.autoHeight}}else{J={toShow:G,toHide:N,complete:H,down:O,autoHeight:Q.autoHeight}}if(!Q.proxied){Q.proxied=Q.animated}if(!Q.proxiedDuration){Q.proxiedDuration=Q.duration}Q.animated=E.isFunction(Q.proxied)?Q.proxied(J):Q.proxied;Q.duration=E.isFunction(Q.proxiedDuration)?Q.proxiedDuration(J):Q.proxiedDuration;var P=E.ui.accordion.animations,I=Q.duration,M=Q.animated;if(!P[M]){P[M]=function(R){this.slide(R,{easing:M,duration:I||700})}}P[M](J)}else{if(!Q.alwaysOpen&&L){G.toggle()}else{N.hide();G.show()}H(true)}N.prev().attr("aria-expanded","false").attr("tabIndex","-1");G.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()}function F(L){var J=E.data(this,"accordion").options;if(J.disabled){return false}if(!L.target&&!J.alwaysOpen){J.active.parent().andSelf().toggleClass(J.selectedClass);var I=J.active.next(),M={options:J,newHeader:E([]),oldHeader:J.active,newContent:E([]),oldContent:I},G=(J.active=E([]));A.call(this,G,I,M);return false}var K=E(L.target);K=E(K.parents(J.header)[0]||K);var H=K[0]==J.active[0];if(J.running||(J.alwaysOpen&&H)){return false}if(!K.is(J.header)){return }J.active.parent().andSelf().toggleClass(J.selectedClass);if(!H){K.parent().andSelf().addClass(J.selectedClass)}var G=K.next(),I=J.active.next(),M={options:J,newHeader:H&&!J.alwaysOpen?E([]):K,oldHeader:J.active,newContent:H&&!J.alwaysOpen?E([]):G,oldContent:I},N=J.headers.index(J.active[0])>J.headers.index(K[0]);J.active=H?E([]):K;A.call(this,G,I,M,H,N);return false}function C(H,G){return G?typeof G=="number"?H.filter(":eq("+G+")"):H.not(H.not(G)):G===false?E([]):H.filter(":eq(0)")}E.extend(E.ui.accordion,{version:"1.6",defaults:{autoHeight:true,alwaysOpen:true,animated:"slide",event:"click",header:"a",navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()},running:0,selectedClass:"selected"},animations:{slide:function(G,J){G=E.extend({easing:"swing",duration:300},G,J);if(!G.toHide.size()){G.toShow.animate({height:"show"},G);return }var I=G.toHide.height(),L=G.toShow.height(),N=L/I,K=G.toShow.outerHeight()-G.toShow.height(),H=G.toShow.css("marginBottom"),M=G.toShow.css("overflow");tmargin=G.toShow.css("marginTop");G.toShow.css({height:0,overflow:"hidden",marginTop:0,marginBottom:-K}).show();G.toHide.filter(":hidden").each(G.complete).end().filter(":visible").animate({height:"hide"},{step:function(O){var P=(I-O)*N;if(E.browser.msie||E.browser.opera){P=Math.ceil(P)}G.toShow.height(P)},duration:G.duration,easing:G.easing,complete:function(){if(!G.autoHeight){G.toShow.css("height","auto")}G.toShow.css({marginTop:tmargin,marginBottom:H,overflow:M});G.complete()}})},bounceslide:function(G){this.slide(G,{easing:G.down?"easeOutBounce":"swing",duration:G.down?1000:200})},easeslide:function(G){this.slide(G,{easing:"easeinout",duration:700})}}})})(jQuery);/*\r
+ * jQuery UI Dialog 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI/Dialog\r
+ *\r
+ * Depends:\r
+ *     ui.core.js\r
+ *     ui.draggable.js\r
+ *     ui.resizable.js\r
+ */\r(function(B){var A={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"};B.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");this.options.title=this.options.title||this.originalTitle;var M=this,N=this.options,F=this.element.removeAttr("title").addClass("ui-dialog-content").wrap("<div></div>").wrap("<div></div>"),I=(this.uiDialogContainer=F.parent()).addClass("ui-dialog-container").css({position:"relative",width:"100%",height:"100%"}),E=(this.uiDialogTitlebar=B("<div></div>")).addClass("ui-dialog-titlebar").mousedown(function(){M.moveToTop()}).prependTo(I),J=B('<a href="#"/>').addClass("ui-dialog-titlebar-close").attr("role","button").appendTo(E),G=(this.uiDialogTitlebarCloseText=B("<span/>")).text(N.closeText).appendTo(J),L=N.title||"&nbsp;",D=B.ui.dialog.getTitleId(this.element),C=B("<span/>").addClass("ui-dialog-title").attr("id",D).html(L).prependTo(E),K=(this.uiDialog=I.parent()).appendTo(document.body).hide().addClass("ui-dialog").addClass(N.dialogClass).css({position:"absolute",width:N.width,height:N.height,overflow:"hidden",zIndex:N.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(O){(N.closeOnEscape&&O.keyCode&&O.keyCode==B.ui.keyCode.ESCAPE&&M.close())}).attr({role:"dialog","aria-labelledby":D}).mouseup(function(){M.moveToTop()}),H=(this.uiDialogButtonPane=B("<div></div>")).addClass("ui-dialog-buttonpane").css({position:"absolute",bottom:0}).appendTo(K),J=B(".ui-dialog-titlebar-close",E).hover(function(){B(this).addClass("ui-dialog-titlebar-close-hover")},function(){B(this).removeClass("ui-dialog-titlebar-close-hover")}).mousedown(function(O){O.stopPropagation()}).click(function(){M.close();return false});E.find("*").add(E).disableSelection();(N.draggable&&B.fn.draggable&&this._makeDraggable());(N.resizable&&B.fn.resizable&&this._makeResizable());this._createButtons(N.buttons);this._isOpen=false;(N.bgiframe&&B.fn.bgiframe&&K.bgiframe());(N.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(){if(false===this._trigger("beforeclose",null,{options:this.options})){return }(this.overlay&&this.overlay.destroy());this.uiDialog.hide(this.options.hide).unbind("keypress.ui-dialog");this._trigger("close",null,{options:this.options});B.ui.dialog.overlay.resize();this._isOpen=false},isOpen:function(){return this._isOpen},moveToTop:function(F){if((this.options.modal&&!F)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",null,{options:this.options})}var E=this.options.zIndex,D=this.options;B(".ui-dialog:visible").each(function(){E=Math.max(E,parseInt(B(this).css("z-index"),10)||D.zIndex)});(this.overlay&&this.overlay.$el.css("z-index",++E));var C={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++E);this.element.attr(C);this._trigger("focus",null,{options:this.options})},open:function(){if(this._isOpen){return }this.overlay=this.options.modal?new B.ui.dialog.overlay(this):null;(this.uiDialog.next().length&&this.uiDialog.appendTo("body"));this._position(this.options.position);this.uiDialog.show(this.options.show);(this.options.autoResize&&this._size());this.moveToTop(true);(this.options.modal&&this.uiDialog.bind("keypress.ui-dialog",function(E){if(E.keyCode!=B.ui.keyCode.TAB){return }var D=B(":tabbable",this),F=D.filter(":first")[0],C=D.filter(":last")[0];if(E.target==C&&!E.shiftKey){setTimeout(function(){F.focus()},1)}else{if(E.target==F&&E.shiftKey){setTimeout(function(){C.focus()},1)}}}));this.uiDialog.find(":tabbable:first").focus();this._trigger("open",null,{options:this.options});this._isOpen=true},_createButtons:function(F){var E=this,C=false,D=this.uiDialogButtonPane;D.empty().hide();B.each(F,function(){return !(C=true)});if(C){D.show();B.each(F,function(G,H){B('<button type="button"></button>').text(G).click(function(){H.apply(E.element[0],arguments)}).appendTo(D)})}},_makeDraggable:function(){var C=this,D=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content",helper:D.dragHelper,handle:".ui-dialog-titlebar",start:function(){C.moveToTop();(D.dragStart&&D.dragStart.apply(C.element[0],arguments))},drag:function(){(D.drag&&D.drag.apply(C.element[0],arguments))},stop:function(){(D.dragStop&&D.dragStop.apply(C.element[0],arguments));B.ui.dialog.overlay.resize()}})},_makeResizable:function(F){F=(F===undefined?this.options.resizable:F);var C=this,E=this.options,D=typeof F=="string"?F:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",helper:E.resizeHelper,maxWidth:E.maxWidth,maxHeight:E.maxHeight,minWidth:E.minWidth,minHeight:E.minHeight,start:function(){(E.resizeStart&&E.resizeStart.apply(C.element[0],arguments))},resize:function(){(E.autoResize&&C._size.apply(C));(E.resize&&E.resize.apply(C.element[0],arguments))},handles:D,stop:function(){(E.autoResize&&C._size.apply(C));(E.resizeStop&&E.resizeStop.apply(C.element[0],arguments));B.ui.dialog.overlay.resize()}})},_position:function(H){var D=B(window),E=B(document),F=E.scrollTop(),C=E.scrollLeft(),G=F;if(B.inArray(H,["center","top","right","bottom","left"])>=0){H=[H=="right"||H=="left"?H:"center",H=="top"||H=="bottom"?H:"middle"]}if(H.constructor!=Array){H=["center","middle"]}if(H[0].constructor==Number){C+=H[0]}else{switch(H[0]){case"left":C+=0;break;case"right":C+=D.width()-this.uiDialog.outerWidth();break;default:case"center":C+=(D.width()-this.uiDialog.outerWidth())/2}}if(H[1].constructor==Number){F+=H[1]}else{switch(H[1]){case"top":F+=0;break;case"bottom":F+=(B.browser.opera?window.innerHeight:D.height())-this.uiDialog.outerHeight();break;default:case"middle":F+=((B.browser.opera?window.innerHeight:D.height())-this.uiDialog.outerHeight())/2}}F=Math.max(F,G);this.uiDialog.css({top:F,left:C})},_setData:function(D,E){(A[D]&&this.uiDialog.data(A[D],E));switch(D){case"buttons":this._createButtons(E);break;case"closeText":this.uiDialogTitlebarCloseText.text(E);break;case"draggable":(E?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(E);break;case"position":this._position(E);break;case"resizable":var C=this.uiDialog,F=this.uiDialog.is(":data(resizable)");(F&&!E&&C.resizable("destroy"));(F&&typeof E=="string"&&C.resizable("option","handles",E));(F||this._makeResizable(E));break;case"title":B(".ui-dialog-title",this.uiDialogTitlebar).html(E||"&nbsp;");break;case"width":this.uiDialog.width(E);break}B.widget.prototype._setData.apply(this,arguments)},_size:function(){var D=this.uiDialogContainer,G=this.uiDialogTitlebar,E=this.element,F=(parseInt(E.css("margin-top"),10)||0)+(parseInt(E.css("margin-bottom"),10)||0),C=(parseInt(E.css("margin-left"),10)||0)+(parseInt(E.css("margin-right"),10)||0);E.height(D.height()-G.outerHeight()-F);E.width(D.width()-C)}});B.extend(B.ui.dialog,{version:"1.6",defaults:{autoOpen:true,autoResize:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",draggable:true,height:200,minHeight:100,minWidth:150,modal:false,overlay:{},position:"center",resizable:true,stack:true,width:300,zIndex:1000},getter:"isOpen",uuid:0,getTitleId:function(C){return"ui-dialog-title-"+(C.attr("id")||++this.uuid)},overlay:function(C){this.$el=B.ui.dialog.overlay.create(C)}});B.extend(B.ui.dialog.overlay,{instances:[],events:B.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(C){return C+".dialog-overlay"}).join(" "),create:function(D){if(this.instances.length===0){setTimeout(function(){B("a, :input").bind(B.ui.dialog.overlay.events,function(){var F=false;var H=B(this).parents(".ui-dialog");if(H.length){var E=B(".ui-dialog-overlay");if(E.length){var G=parseInt(E.css("z-index"),10);E.each(function(){G=Math.max(G,parseInt(B(this).css("z-index"),10))});F=parseInt(H.css("z-index"),10)>G}else{F=true}}return F})},1);B(document).bind("keydown.dialog-overlay",function(E){(D.options.closeOnEscape&&E.keyCode&&E.keyCode==B.ui.keyCode.ESCAPE&&D.close())});B(window).bind("resize.dialog-overlay",B.ui.dialog.overlay.resize)}var C=B("<div></div>").appendTo(document.body).addClass("ui-dialog-overlay").css(B.extend({borderWidth:0,margin:0,padding:0,position:"absolute",top:0,left:0,width:this.width(),height:this.height()},D.options.overlay));(D.options.bgiframe&&B.fn.bgiframe&&C.bgiframe());this.instances.push(C);return C},destroy:function(C){this.instances.splice(B.inArray(this.instances,C),1);if(this.instances.length===0){B("a, :input").add([document,window]).unbind(".dialog-overlay")}C.remove()},height:function(){if(B.browser.msie&&B.browser.version<7){var D=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var C=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(D<C){return B(window).height()+"px"}else{return D+"px"}}else{if(B.browser.opera){return Math.max(window.innerHeight,B(document).height())+"px"}else{return B(document).height()+"px"}}},width:function(){if(B.browser.msie&&B.browser.version<7){var C=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var D=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(C<D){return B(window).width()+"px"}else{return C+"px"}}else{if(B.browser.opera){return Math.max(window.innerWidth,B(document).width())+"px"}else{return B(document).width()+"px"}}},resize:function(){var C=B([]);B.each(B.ui.dialog.overlay.instances,function(){C=C.add(this)});C.css({width:0,height:0}).css({width:B.ui.dialog.overlay.width(),height:B.ui.dialog.overlay.height()})}});B.extend(B.ui.dialog.overlay.prototype,{destroy:function(){B.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);/*\r
+ * jQuery UI Slider 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI/Slider\r
+ *\r
+ * Depends:\r
+ *     ui.core.js\r
+ */\r(function(A){A.fn.unwrap=A.fn.unwrap||function(B){return this.each(function(){A(this).parents(B).eq(0).after(this).remove()})};A.widget("ui.slider",{_init:function(){var B=this;this.element.addClass("ui-slider");this._initBoundaries();this.handle=A(this.options.handle,this.element);if(!this.handle.length){B.handle=B.generated=A(B.options.handles||[0]).map(function(){var D=A("<div/>").addClass("ui-slider-handle").appendTo(B.element);if(this.id){D.attr("id",this.id)}return D[0]})}var C=function(D){this.element=A(D);this.element.data("mouse",this);this.options=B.options;this.element.bind("mousedown",function(){if(B.currentHandle){this.blur(B.currentHandle)}B._focus(this,true)});this._mouseInit()};A.extend(C.prototype,A.ui.mouse,{_mouseCapture:function(){return true},_mouseStart:function(D){return B._start.call(B,D,this.element[0])},_mouseDrag:function(D){return B._drag.call(B,D,this.element[0])},_mouseStop:function(D){return B._stop.call(B,D,this.element[0])},trigger:function(D){this._mouseDown(D)}});A(this.handle).each(function(){new C(this)}).wrap('<a href="#" style="outline:none;border:none;"></a>').parent().bind("click",function(){return false}).bind("focus",function(D){B._focus(this.firstChild)}).bind("blur",function(D){B._blur(this.firstChild)}).bind("keydown",function(D){if(!B.options.noKeyboard){return B._keydown(D.keyCode,this.firstChild)}});this.element.bind("mousedown.slider",function(D){if(A(D.target).is(".ui-slider-handle")){return }B._click.apply(B,[D]);B.currentHandle.data("mouse").trigger(D);B.firstValue=B.firstValue+1});A.each(this.options.handles||[],function(D,E){B.moveTo(E.start,D,true)});if(!isNaN(this.options.startValue)){this.moveTo(this.options.startValue,0,true)}this.previousHandle=A(this.handle[0]);if(this.handle.length==2&&this.options.range){this._createRange()}},destroy:function(){this.element.removeClass("ui-slider ui-slider-disabled").removeData("slider").unbind(".slider");if(this.handle&&this.handle.length){this.handle.unwrap("a");this.handle.each(function(){var B=A(this).data("mouse");B&&B._mouseDestroy()})}this.generated&&this.generated.remove()},_start:function(B,C){var D=this.options;if(D.disabled){return false}this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};if(!this.currentHandle){this._focus(this.previousHandle,true)}this.offset=this.element.offset();this.handleOffset=this.currentHandle.offset();this.clickOffset={top:B.pageY-this.handleOffset.top,left:B.pageX-this.handleOffset.left};this.firstValue=this.value();this._propagate("start",B);this._drag(B,C);return true},_drag:function(C,E){var F=this.options;var B={top:C.pageY-this.offset.top-this.clickOffset.top,left:C.pageX-this.offset.left-this.clickOffset.left};if(!this.currentHandle){this._focus(this.previousHandle,true)}B.left=this._translateLimits(B.left,"x");B.top=this._translateLimits(B.top,"y");if(F.stepping.x){var D=this._convertValue(B.left,"x");D=this._round(D/F.stepping.x)*F.stepping.x;B.left=this._translateValue(D,"x")}if(F.stepping.y){var D=this._convertValue(B.top,"y");D=this._round(D/F.stepping.y)*F.stepping.y;B.top=this._translateValue(D,"y")}B.left=this._translateRange(B.left,"x");B.top=this._translateRange(B.top,"y");if(F.axis!="vertical"){this.currentHandle.css({left:B.left})}if(F.axis!="horizontal"){this.currentHandle.css({top:B.top})}this.currentHandle.data("mouse").sliderValue={x:this._round(this._convertValue(B.left,"x"))||0,y:this._round(this._convertValue(B.top,"y"))||0};if(this.rangeElement){this._updateRange()}this._propagate("slide",C);return false},_stop:function(B){this._propagate("stop",B);if(this.firstValue!=this.value()){this._propagate("change",B)}this._focus(this.currentHandle,true);return false},_round:function(B){return this.options.round?parseInt(B,10):parseFloat(B)},_setData:function(B,C){A.widget.prototype._setData.apply(this,arguments);if(/min|max|steps/.test(B)){this._initBoundaries()}if(B=="range"){C?this.handle.length==2&&this._createRange():this._removeRange()}},_initBoundaries:function(){var B=this.element[0],C=this.options;this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};A.extend(C,{axis:C.axis||(B.offsetWidth<B.offsetHeight?"vertical":"horizontal"),max:!isNaN(parseInt(C.max,10))?{x:parseInt(C.max,10),y:parseInt(C.max,10)}:({x:C.max&&C.max.x||100,y:C.max&&C.max.y||100}),min:!isNaN(parseInt(C.min,10))?{x:parseInt(C.min,10),y:parseInt(C.min,10)}:({x:C.min&&C.min.x||0,y:C.min&&C.min.y||0})});C.realMax={x:C.max.x-C.min.x,y:C.max.y-C.min.y};C.stepping={x:C.stepping&&C.stepping.x||parseInt(C.stepping,10)||(C.steps?C.realMax.x/(C.steps.x||parseInt(C.steps,10)||C.realMax.x):0),y:C.stepping&&C.stepping.y||parseInt(C.stepping,10)||(C.steps?C.realMax.y/(C.steps.y||parseInt(C.steps,10)||C.realMax.y):0)}},_keydown:function(F,E){if(this.options.disabled){return }var C=F;if(/(33|34|35|36|37|38|39|40)/.test(C)){var G=this.options,B,I;if(/(35|36)/.test(C)){B=(C==35)?G.max.x:G.min.x;I=(C==35)?G.max.y:G.min.y}else{var H=/(34|37|40)/.test(C)?"-=":"+=";var D=/(37|38|39|40)/.test(C)?"_oneStep":"_pageStep";B=H+this[D]("x");I=H+this[D]("y")}this.moveTo({x:B,y:I},E);return false}return true},_focus:function(B,C){this.currentHandle=A(B).addClass("ui-slider-handle-active");if(C){this.currentHandle.parent()[0].focus()}},_blur:function(B){A(B).removeClass("ui-slider-handle-active");if(this.currentHandle&&this.currentHandle[0]==B){this.previousHandle=this.currentHandle;this.currentHandle=null}},_click:function(C){var D=[C.pageX,C.pageY];var B=false;this.handle.each(function(){if(this==C.target){B=true}});if(B||this.options.disabled||!(this.currentHandle||this.previousHandle)){return }if(!this.currentHandle&&this.previousHandle){this._focus(this.previousHandle,true)}this.offset=this.element.offset();this.moveTo({y:this._convertValue(C.pageY-this.offset.top-this.currentHandle[0].offsetHeight/2,"y"),x:this._convertValue(C.pageX-this.offset.left-this.currentHandle[0].offsetWidth/2,"x")},null,!this.options.distance)},_createRange:function(){if(this.rangeElement){return }this.rangeElement=A("<div></div>").addClass("ui-slider-range").css({position:"absolute"}).appendTo(this.element);this._updateRange()},_removeRange:function(){this.rangeElement.remove();this.rangeElement=null},_updateRange:function(){var C=this.options.axis=="vertical"?"top":"left";var B=this.options.axis=="vertical"?"height":"width";this.rangeElement.css(C,(this._round(A(this.handle[0]).css(C))||0)+this._handleSize(0,this.options.axis=="vertical"?"y":"x")/2);this.rangeElement.css(B,(this._round(A(this.handle[1]).css(C))||0)-(this._round(A(this.handle[0]).css(C))||0))},_getRange:function(){return this.rangeElement?this._convertValue(this._round(this.rangeElement.css(this.options.axis=="vertical"?"height":"width")),this.options.axis=="vertical"?"y":"x"):null},_handleIndex:function(){return this.handle.index(this.currentHandle[0])},value:function(D,B){if(this.handle.length==1){this.currentHandle=this.handle}if(!B){B=this.options.axis=="vertical"?"y":"x"}var C=A(D!=undefined&&D!==null?this.handle[D]||D:this.currentHandle);if(C.data("mouse").sliderValue){return this._round(C.data("mouse").sliderValue[B])}else{return this._round(((this._round(C.css(B=="x"?"left":"top"))/(this.actualSize[B=="x"?"width":"height"]-this._handleSize(D,B)))*this.options.realMax[B])+this.options.min[B])}},_convertValue:function(C,B){return this.options.min[B]+(C/(this.actualSize[B=="x"?"width":"height"]-this._handleSize(null,B)))*this.options.realMax[B]},_translateValue:function(C,B){return((C-this.options.min[B])/this.options.realMax[B])*(this.actualSize[B=="x"?"width":"height"]-this._handleSize(null,B))},_translateRange:function(D,B){if(this.rangeElement){if(this.currentHandle[0]==this.handle[0]&&D>=this._translateValue(this.value(1),B)){D=this._translateValue(this.value(1,B)-this._oneStep(B),B)}if(this.currentHandle[0]==this.handle[1]&&D<=this._translateValue(this.value(0),B)){D=this._translateValue(this.value(0,B)+this._oneStep(B),B)}}if(this.options.handles){var C=this.options.handles[this._handleIndex()];if(D<this._translateValue(C.min,B)){D=this._translateValue(C.min,B)}else{if(D>this._translateValue(C.max,B)){D=this._translateValue(C.max,B)}}}return D},_translateLimits:function(C,B){if(C>=this.actualSize[B=="x"?"width":"height"]-this._handleSize(null,B)){C=this.actualSize[B=="x"?"width":"height"]-this._handleSize(null,B)}if(C<=0){C=0}return C},_handleSize:function(C,B){return A(C!=undefined&&C!==null?this.handle[C]:this.currentHandle)[0]["offset"+(B=="x"?"Width":"Height")]},_oneStep:function(B){return this.options.stepping[B]||1},_pageStep:function(B){return 10},moveTo:function(F,E,G){var H=this.options;this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};if(E==undefined&&!this.currentHandle&&this.handle.length!=1){return false}if(E==undefined&&!this.currentHandle){E=0}if(E!=undefined){this.currentHandle=this.previousHandle=A(this.handle[E]||E)}if(F.x!==undefined&&F.y!==undefined){var B=F.x,I=F.y}else{var B=F,I=F}if(B!==undefined&&B.constructor!=Number){var D=/^\-\=/.test(B),C=/^\+\=/.test(B);if(D||C){B=this.value(null,"x")+this._round(B.replace(D?"=":"+=",""))}else{B=isNaN(this._round(B))?undefined:this._round(B)}}if(I!==undefined&&I.constructor!=Number){var D=/^\-\=/.test(I),C=/^\+\=/.test(I);if(D||C){I=this.value(null,"y")+this._round(I.replace(D?"=":"+=",""))}else{I=isNaN(this._round(I))?undefined:this._round(I)}}if(H.axis!="vertical"&&B!==undefined){if(H.stepping.x){B=this._round(B/H.stepping.x)*H.stepping.x}B=this._translateValue(B,"x");B=this._translateLimits(B,"x");B=this._translateRange(B,"x");H.animate?this.currentHandle.stop().animate({left:B},(Math.abs(parseInt(this.currentHandle.css("left"),10)-B))*(!isNaN(parseInt(H.animate,10))?H.animate:5)):this.currentHandle.css({left:B})}if(H.axis!="horizontal"&&I!==undefined){if(H.stepping.y){I=this._round(I/H.stepping.y)*H.stepping.y}I=this._translateValue(I,"y");I=this._translateLimits(I,"y");I=this._translateRange(I,"y");H.animate?this.currentHandle.stop().animate({top:I},(Math.abs(parseInt(this.currentHandle.css("top"),10)-I))*(!isNaN(parseInt(H.animate,10))?H.animate:5)):this.currentHandle.css({top:I})}if(this.rangeElement){this._updateRange()}this.currentHandle.data("mouse").sliderValue={x:this._round(this._convertValue(B,"x"))||0,y:this._round(this._convertValue(I,"y"))||0};if(!G){this._propagate("start",null);this._propagate("slide",null);this._propagate("stop",null);this._propagate("change",null)}},_propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);this.element.triggerHandler(C=="slide"?C:"slide"+C,[B,this.ui()],this.options[C])},plugins:{},ui:function(B){return{options:this.options,handle:this.currentHandle,value:this.options.axis!="both"||!this.options.axis?this._round(this.value(null,this.options.axis=="vertical"?"y":"x")):{x:this._round(this.value(null,"x")),y:this._round(this.value(null,"y"))},range:this._getRange()}}});A.extend(A.ui.slider,{getter:"value",version:"1.6",defaults:{animate:false,distance:1,handle:".ui-slider-handle",round:true}})})(jQuery);/*\r
+ * jQuery UI Tabs 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI/Tabs\r
+ *\r
+ * Depends:\r
+ *     ui.core.js\r
+ */\r(function(A){A.widget("ui.tabs",{_init:function(){this._tabify(true)},destroy:function(){var B=this.options;this.element.unbind(".tabs").removeClass(B.navClass).removeData("tabs");this.$tabs.each(function(){var C=A.data(this,"href.tabs");if(C){this.href=C}var D=A(this).unbind(".tabs");A.each(["href","load","cache"],function(E,F){D.removeData(F+".tabs")})});this.$lis.add(this.$panels).each(function(){if(A.data(this,"destroy.tabs")){A(this).remove()}else{A(this).removeClass([B.selectedClass,B.deselectableClass,B.disabledClass,B.panelClass,B.hideClass].join(" "))}});if(B.cookie){this._cookie(null,B.cookie)}},_setData:function(B,C){if((/^selected/).test(B)){this.select(C)}else{this.options[B]=C;this._tabify()}},length:function(){return this.$tabs.length},_tabId:function(B){return B.title&&B.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+A.data(B)},_sanitizeSelector:function(B){return B.replace(/:/g,"\\:")},_cookie:function(){var B=this.cookie||(this.cookie="ui-tabs-"+A.data(this.element[0]));return A.cookie.apply(null,[B].concat(A.makeArray(arguments)))},_tabify:function(N){this.$lis=A("li:has(a[href])",this.element);this.$tabs=this.$lis.map(function(){return A("a",this)[0]});this.$panels=A([]);var O=this,C=this.options;this.$tabs.each(function(Q,P){if(P.hash&&P.hash.replace("#","")){O.$panels=O.$panels.add(O._sanitizeSelector(P.hash))}else{if(A(P).attr("href")!="#"){A.data(P,"href.tabs",P.href);A.data(P,"load.tabs",P.href);var S=O._tabId(P);P.href="#"+S;var R=A("#"+S);if(!R.length){R=A(C.panelTemplate).attr("id",S).addClass(C.panelClass).insertAfter(O.$panels[Q-1]||O.element);R.data("destroy.tabs",true)}O.$panels=O.$panels.add(R)}else{C.disabled.push(Q+1)}}});if(N){this.element.addClass(C.navClass);this.$panels.addClass(C.panelClass);if(C.selected===undefined){if(location.hash){this.$tabs.each(function(Q,P){if(P.hash==location.hash){C.selected=Q;return false}})}else{if(C.cookie){var I=parseInt(O._cookie(),10);if(I&&O.$tabs[I]){C.selected=I}}else{if(O.$lis.filter("."+C.selectedClass).length){C.selected=O.$lis.index(O.$lis.filter("."+C.selectedClass)[0])}}}}C.selected=C.selected===null||C.selected!==undefined?C.selected:0;C.disabled=A.unique(C.disabled.concat(A.map(this.$lis.filter("."+C.disabledClass),function(Q,P){return O.$lis.index(Q)}))).sort();if(A.inArray(C.selected,C.disabled)!=-1){C.disabled.splice(A.inArray(C.selected,C.disabled),1)}this.$panels.addClass(C.hideClass);this.$lis.removeClass(C.selectedClass);if(C.selected!==null){this.$panels.eq(C.selected).removeClass(C.hideClass);var E=[C.selectedClass];if(C.deselectable){E.push(C.deselectableClass)}this.$lis.eq(C.selected).addClass(E.join(" "));var J=function(){O._trigger("show",null,O.ui(O.$tabs[C.selected],O.$panels[C.selected]))};if(A.data(this.$tabs[C.selected],"load.tabs")){this.load(C.selected,J)}else{J()}}A(window).bind("unload",function(){O.$tabs.unbind(".tabs");O.$lis=O.$tabs=O.$panels=null})}else{C.selected=this.$lis.index(this.$lis.filter("."+C.selectedClass)[0])}if(C.cookie){this._cookie(C.selected,C.cookie)}for(var G=0,M;M=this.$lis[G];G++){A(M)[A.inArray(G,C.disabled)!=-1&&!A(M).hasClass(C.selectedClass)?"addClass":"removeClass"](C.disabledClass)}if(C.cache===false){this.$tabs.removeData("cache.tabs")}var B,H;if(C.fx){if(C.fx.constructor==Array){B=C.fx[0];H=C.fx[1]}else{B=H=C.fx}}function D(P,Q){P.css({display:""});if(A.browser.msie&&Q.opacity){P[0].style.removeAttribute("filter")}}var K=H?function(P,Q){Q.animate(H,H.duration||"normal",function(){Q.removeClass(C.hideClass);D(Q,H);O._trigger("show",null,O.ui(P,Q[0]))})}:function(P,Q){Q.removeClass(C.hideClass);O._trigger("show",null,O.ui(P,Q[0]))};var L=B?function(Q,P,R){P.animate(B,B.duration||"normal",function(){P.addClass(C.hideClass);D(P,B);if(R){K(Q,R,P)}})}:function(Q,P,R){P.addClass(C.hideClass);if(R){K(Q,R)}};function F(R,T,P,S){var Q=[C.selectedClass];if(C.deselectable){Q.push(C.deselectableClass)}T.addClass(Q.join(" ")).siblings().removeClass(Q.join(" "));L(R,P,S)}this.$tabs.unbind(".tabs").bind(C.event+".tabs",function(){var S=A(this).parents("li:eq(0)"),P=O.$panels.filter(":visible"),R=A(O._sanitizeSelector(this.hash));if((S.hasClass(C.selectedClass)&&!C.deselectable)||S.hasClass(C.disabledClass)||A(this).hasClass(C.loadingClass)||O._trigger("select",null,O.ui(this,R[0]))===false){this.blur();return false}C.selected=O.$tabs.index(this);if(C.deselectable){if(S.hasClass(C.selectedClass)){O.options.selected=null;S.removeClass([C.selectedClass,C.deselectableClass].join(" "));O.$panels.stop();L(this,P);this.blur();return false}else{if(!P.length){O.$panels.stop();var Q=this;O.load(O.$tabs.index(this),function(){S.addClass([C.selectedClass,C.deselectableClass].join(" "));K(Q,R)});this.blur();return false}}}if(C.cookie){O._cookie(C.selected,C.cookie)}O.$panels.stop();if(R.length){var Q=this;O.load(O.$tabs.index(this),P.length?function(){F(Q,S,P,R)}:function(){S.addClass(C.selectedClass);K(Q,R)})}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(A.browser.msie){this.blur()}return false});if(C.event!="click"){this.$tabs.bind("click.tabs",function(){return false})}},add:function(E,D,C){if(C==undefined){C=this.$tabs.length}var G=this.options;var I=A(G.tabTemplate.replace(/#\{href\}/g,E).replace(/#\{label\}/g,D));I.data("destroy.tabs",true);var H=E.indexOf("#")==0?E.replace("#",""):this._tabId(A("a:first-child",I)[0]);var F=A("#"+H);if(!F.length){F=A(G.panelTemplate).attr("id",H).addClass(G.hideClass).data("destroy.tabs",true)}F.addClass(G.panelClass);if(C>=this.$lis.length){I.appendTo(this.element);F.appendTo(this.element[0].parentNode)}else{I.insertBefore(this.$lis[C]);F.insertBefore(this.$panels[C])}G.disabled=A.map(G.disabled,function(K,J){return K>=C?++K:K});this._tabify();if(this.$tabs.length==1){I.addClass(G.selectedClass);F.removeClass(G.hideClass);var B=A.data(this.$tabs[0],"load.tabs");if(B){this.load(C,B)}}this._trigger("add",null,this.ui(this.$tabs[C],this.$panels[C]))},remove:function(B){var D=this.options,E=this.$lis.eq(B).remove(),C=this.$panels.eq(B).remove();if(E.hasClass(D.selectedClass)&&this.$tabs.length>1){this.select(B+(B+1<this.$tabs.length?1:-1))}D.disabled=A.map(A.grep(D.disabled,function(G,F){return G!=B}),function(G,F){return G>=B?--G:G});this._tabify();this._trigger("remove",null,this.ui(E.find("a")[0],C[0]))},enable:function(B){var C=this.options;if(A.inArray(B,C.disabled)==-1){return }var D=this.$lis.eq(B).removeClass(C.disabledClass);if(A.browser.safari){D.css("display","inline-block");setTimeout(function(){D.css("display","block")},0)}C.disabled=A.grep(C.disabled,function(F,E){return F!=B});this._trigger("enable",null,this.ui(this.$tabs[B],this.$panels[B]))},disable:function(C){var B=this,D=this.options;if(C!=D.selected){this.$lis.eq(C).addClass(D.disabledClass);D.disabled.push(C);D.disabled.sort();this._trigger("disable",null,this.ui(this.$tabs[C],this.$panels[C]))}},select:function(B){if(typeof B=="string"){B=this.$tabs.index(this.$tabs.filter("[href$="+B+"]")[0])}this.$tabs.eq(B).trigger(this.options.event+".tabs")},load:function(G,K){var L=this,D=this.options,E=this.$tabs.eq(G),J=E[0],H=K==undefined||K===false,B=E.data("load.tabs");K=K||function(){};if(!B||!H&&A.data(J,"cache.tabs")){K();return }var M=function(N){var O=A(N),P=O.find("*:last");return P.length&&P.is(":not(img)")&&P||O};var C=function(){L.$tabs.filter("."+D.loadingClass).removeClass(D.loadingClass).each(function(){if(D.spinner){M(this).parent().html(M(this).data("label.tabs"))}});L.xhr=null};if(D.spinner){var I=M(J).html();M(J).wrapInner("<em></em>").find("em").data("label.tabs",I).html(D.spinner)}var F=A.extend({},D.ajaxOptions,{url:B,success:function(P,N){A(L._sanitizeSelector(J.hash)).html(P);C();if(D.cache){A.data(J,"cache.tabs",true)}L._trigger("load",null,L.ui(L.$tabs[G],L.$panels[G]));try{D.ajaxOptions.success(P,N)}catch(O){}K()}});if(this.xhr){this.xhr.abort();C()}E.addClass(D.loadingClass);L.xhr=A.ajax(F)},url:function(C,B){this.$tabs.eq(C).removeData("cache.tabs").data("load.tabs",B)},ui:function(C,B){return{options:this.options,tab:C,panel:B,index:this.$tabs.index(C)}}});A.extend(A.ui.tabs,{version:"1.6",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,deselectable:false,deselectableClass:"ui-tabs-deselectable",disabled:[],disabledClass:"ui-tabs-disabled",event:"click",fx:null,hideClass:"ui-tabs-hide",idPrefix:"ui-tabs-",loadingClass:"ui-tabs-loading",navClass:"ui-tabs-nav",panelClass:"ui-tabs-panel",panelTemplate:"<div></div>",selectedClass:"ui-tabs-selected",spinner:"Loading&#8230;",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});A.extend(A.ui.tabs.prototype,{rotation:null,rotate:function(C,F){F=F||false;var B=this,E=this.options.selected;function G(){B.rotation=setInterval(function(){E=++E<B.$tabs.length?E:0;B.select(E)},C)}function D(H){if(!H||H.clientX){clearInterval(B.rotation)}}if(C){G();if(!F){this.$tabs.bind(this.options.event+".tabs",D)}else{this.$tabs.bind(this.options.event+".tabs",function(){D();E=B.options.selected;G()})}}else{D();this.$tabs.unbind(this.options.event+".tabs",D)}}})})(jQuery);
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/script/lib/console.js b/wrt/misc/rss/preview/script/lib/console.js
new file mode 100644 (file)
index 0000000..8a95349
--- /dev/null
@@ -0,0 +1,121 @@
+//     for console support\r
+if (typeof window.parent.console == 'undefined') {\r
+       window.console = {\r
+       \r
+                       sprintf: function(args){\r
+                               if (typeof args == 'undefined') {\r
+                                       return null;\r
+                               }\r
+                               \r
+                               if (args.length < 1) {\r
+                                       return null;\r
+                               };\r
+                               \r
+                               if (typeof args[0] != 'string') {\r
+                                       return null;\r
+                               }\r
+                               \r
+                               if (typeof RegExp == 'undefined') {\r
+                                       return null;\r
+                               }\r
+                               \r
+                               if (args.length == 1) {\r
+                                       return args[0];\r
+                               }\r
+                               \r
+                               \r
+                               var str = args[0];\r
+                               var newString = args[0];\r
+                               var arr = new Array();\r
+                               var exp = new RegExp(/[^%](%)([a-zA-Z])/g);\r
+                               var match = null;\r
+                               var lastMatch = 0;\r
+                               var argPos = 1;\r
+                               while (match = exp.exec(str) && argPos < args.length) {\r
+                                       if (str[exp.lastIndex - 1] == "%") {\r
+                                               \r
+                                       }\r
+                                       else \r
+                                               if (str[exp.lastIndex - 1] == "d") {\r
+                                                       arr.push(str.substring(lastMatch, exp.lastIndex - 2));\r
+                                                       arr.push(args[argPos++]);\r
+                                               }\r
+                                               else \r
+                                                       if (str[exp.lastIndex - 1] == "i") {\r
+                                                               arr.push(str.substring(lastMatch, exp.lastIndex - 2));\r
+                                                               arr.push(args[argPos++]);\r
+                                                       }\r
+                                                       else \r
+                                                               if (str[exp.lastIndex - 1] == "f") {\r
+                                                                       arr.push(str.substring(lastMatch, exp.lastIndex - 2));\r
+                                                                       arr.push(args[argPos++]);\r
+                                                               }\r
+                                                               else \r
+                                                                       if (str[exp.lastIndex - 1] == "s") {\r
+                                                                               arr.push(str.substring(lastMatch, exp.lastIndex - 2));\r
+                                                                               arr.push(args[argPos++]);\r
+                                                                       }\r
+                                                                       else \r
+                                                                               if (str[exp.lastIndex - 1] != "%") {\r
+                                                                                       arr.push(str.substring(lastMatch, exp.lastIndex - 2));\r
+                                                                                       arr.push("\"");\r
+                                                                                       arr.push(args[argPos++]);\r
+                                                                                       arr.push("\"");\r
+                                                                               }\r
+                                       lastMatch = exp.lastIndex;\r
+                               }\r
+                               if (lastMatch < str.length) {\r
+                                       arr.push(str.substring(lastMatch, str.length));\r
+                               }\r
+                               while (argPos < args.length) {\r
+                                       arr.push(" ");\r
+                                       arr.push(args[argPos++]);\r
+                               }\r
+                               return arr.join("").replace(/\%\%/g,"%");\r
+                       },\r
+               error: function(){\r
+                       var errorStr = console.sprintf(arguments);\r
+                       if (errorStr) {\r
+                               _BRIDGE_REF.nokia.layout.log('error', errorStr);\r
+                       }\r
+               },\r
+               info: function(){\r
+                       var errorStr = console.sprintf(arguments);\r
+                       if (errorStr) {\r
+                               _BRIDGE_REF.nokia.layout.log('info', errorStr);\r
+                       }\r
+               },\r
+               warn: function(){\r
+                       var errorStr = console.sprintf(arguments);\r
+                       if (errorStr) {\r
+                               _BRIDGE_REF.nokia.layout.log('warn', errorStr);\r
+                       }\r
+               },\r
+               log: function(){\r
+                       var errorStr = console.sprintf(arguments);\r
+                       if (errorStr) {\r
+                               _BRIDGE_REF.nokia.layout.log('log', errorStr);\r
+                       }\r
+               },\r
+               debug: function(){\r
+                       var errorStr = console.sprintf(arguments);\r
+                       if (errorStr) {\r
+                               _BRIDGE_REF.nokia.layout.log('debug', errorStr);\r
+                       }\r
+               },\r
+               assert: function(){\r
+                       var errorStr = console.sprintf(arguments);\r
+                       if (errorStr) {\r
+                               //      @todo\r
+                       }\r
+               }\r
+       }\r
+       \r
+       //      enable the Console.\r
+       _BRIDGE_REF.nokia.layout._console_enabled = true;\r
+       _BRIDGE_REF.nokia.layout.render();\r
+\r
+}\r
+\r
+//     make TRUE console.js script loaded\r
+window.parent.NOKIA.scriptsLoaded.console = true;\r
diff --git a/wrt/misc/rss/preview/script/lib/device.js b/wrt/misc/rss/preview/script/lib/device.js
new file mode 100644 (file)
index 0000000..10b62f7
--- /dev/null
@@ -0,0 +1,544 @@
+/**
+ * device.js
+ * 
+ * Nokia Web Runtime Service API emulation 
+ * WRT v1.1
+ * 
+ * Copyright 2009 Nokia Corporation. All rights reserved.
+*/
+
+
+/**
+ * device object. entry point to device service API (SAPI)
+ */
+var device = {
+       /**
+        * device API public method
+        * 
+        * @method
+        * @param {string} provider Name of service provider, eg, "Service.Calendar"
+        * @param {string} Interface Name of interface, eg, "IDataSource"
+        * @return {Object} service object  
+        */
+       getServiceObject: function(provider, Interface){
+
+               if (!device.implementation.context)
+                       throw 'device implementation object not instantiated!'
+
+               if (device.implementation.options.enabled) 
+                       return device.implementation.getInterface(provider, Interface);
+               else {
+                       device.implementation.context.notify('device SAPI is disabled.');
+                       throw 'device not defined!';
+               }
+       }
+};
+
+
+
+/**
+ * implementation of device emulation mode
+ * 
+ * @param {String}             version - version number (default: current version)
+ * @return {Object}    returns new implementation context object 
+ * @constructor                
+ */
+device.implementation = function(version){
+
+       this.version = version || '';
+       
+       // set context to current object
+       device.implementation.context = this;   
+
+       var libpath = 'preview/script/lib/',
+               datapath = 'preview/data/';
+       
+       // load implementation files
+       // this is done async by the browser engine, so be aware of sync conditions!!
+       if (version == '1')
+               loadSAPI(libpath + 'sapi1/');
+       else if (!version)
+               loadSAPI();
+       else
+               throw 'unsuppported SAPI version!';
+       
+       function loadSAPI(path){
+               var path = path || (libpath + "sapi/");
+               
+               // load API
+               loadScript(path + "AppManager.js");
+               loadScript(path + "Calendar.js");
+               loadScript(path + "Contact.js");
+               loadScript(path + "Landmarks.js");
+               loadScript(path + "Location.js");
+               loadScript(path + "Logging.js");
+               loadScript(path + "MediaManagement.js");
+               loadScript(path + "Messaging.js");
+               loadScript(path + "Sensor.js");
+               loadScript(path + "SysInfo.js");
+               
+               // load sample data
+               loadScript(datapath + "appManager_data.js");
+               loadScript(datapath + "calendar_data.js");
+               loadScript(datapath + "contact_data.js");
+               loadScript(datapath + "landmarks_data.js");
+               loadScript(datapath + "location_data.js");
+               loadScript(datapath + "logging_data.js");
+               loadScript(datapath + "mediaManagement_data.js");
+               loadScript(datapath + "messaging_data.js");
+               loadScript(datapath + "sensor_data.js");
+               loadScript(datapath + "sysInfo_data.js");
+       }
+       
+       function loadScript(src){
+               var head = document.getElementsByTagName("head")[0] || document.documentElement, 
+                       script = document.createElement("script");
+               
+               script.type = "text/javascript";
+               script.src = src;
+               head.appendChild(script);
+       }
+};
+
+(function(){
+device.implementation.prototype = {
+       
+       /**
+        * Result object
+        * 
+        * object returned by API calls
+        * 
+        * @param {Object} value
+        * @param {Integer} code
+        * @param {String} msg
+        */
+       Result : function(value, code, msg){
+               return {
+                       ReturnValue     : value,
+                       ErrorCode       : code || 0,
+                       ErrorMessage: msg || undefined
+               };
+       },
+       
+       /**
+        * AsyncResult object
+        * 
+        * object returned by API calls with callbacks
+        * 
+        * @param {Integer} transaction id
+        * @param {Integer} code
+        * @param {String} msg
+        */
+       AsyncResult : function(id, code, msg){
+               return {
+                       TransactionID   : id,
+                       ErrorCode               : code || 0,
+                       ErrorMessage    : msg || undefined
+               };
+       },
+       /**
+        * ErrorResult object
+        * 
+        * object returned by API calls when error
+        * 
+        * @param {Integer} code
+        * @param {String} msg
+        */
+       ErrorResult : function(code, msg){
+               device.implementation.context.debug(code, msg);         
+               return {
+                       ErrorCode       : code || 0,
+                       ErrorMessage: msg || undefined
+               };
+       },
+       
+       /**
+        * Iterator object
+        * 
+        * object returned as ReturnValue by some API
+        * 
+        * @param {Array} data
+        */
+       Iterator : function(data){
+               var index = 0,
+                       data = data || [];
+               return {
+                       /**
+                        * reset
+                        */
+                       reset : function(){
+                               index = 0;
+                       },
+                       
+                       /**
+                       * getNext
+                       */
+                       getNext : function(){
+                               return index < data.length ? data[index++] : undefined;
+                       }
+               }
+       },
+       
+       
+       /**
+        * internal __methods__
+        */
+       
+       $break:         {}, // 'not implemented',
+       
+       debug: function() {
+               if (device.implementation.options.debug && window.console && console.log) 
+                       console.log(arguments);
+       },
+       
+       // notify developer of api action
+       notify: function(msg){
+               if (window.console && console.warn)
+                       console.warn('API Notice -- ' + msg);
+       },
+       
+       getData : function(provider){
+               if (!device.implementation.data[provider])
+                       throw "no data defined for provider '"+provider+"'";
+               
+               if (device.implementation.data[provider]['default'])
+                       return device.implementation.data[provider]['default'];
+               else 
+                       return device.implementation.data[provider]; 
+       },      
+       
+       getUniqueID : function(){
+               return Number(''+Number(new Date())+ Math.floor(1000*Math.random()));
+       },
+       
+       callAsync : function(object, method, criteria, callback, flag){
+               flag = flag || false;
+               var tid = setTimeout(function(){
+                       var result,
+                               eventCode = {completed:2, error:4, progress:9},
+                               code = eventCode.completed;
+                       try{
+                               // call method in object's context
+                               // flag is passed to trigger the method in case of mandatory callback arg
+                               if (flag)
+                                       result = method.call(object, criteria, null, flag);
+                               else
+                                       result = method.call(object, criteria);
+                       } 
+                       catch(e){
+                               code = eventCode.error;
+                       }
+                       callback(tid, code, result);
+                       
+               }, device.implementation.options.callbackDelay);
+               
+               return this.AsyncResult(tid);
+       },
+               
+       addListener : function(provider, eventType, criteria, callback, handler){
+               if (!device.implementation.listeners[provider])
+                       device.implementation.listeners[provider] = {};
+                       
+               var tid = this.getUniqueID();
+               device.implementation.listeners[provider][eventType] = {
+                       'criteria': criteria,
+                       'callback': callback,
+                       'handler': handler,
+                       'transactionID' : tid
+               };
+               return this.AsyncResult(tid);
+       },
+
+       /*
+        * specify either eventType or transactionID
+        * return true if found and removed
+        */
+       removeListener: function(provider, eventType, transactionID){
+               transactionID = transactionID || null;
+               if (transactionID) {
+                       var allEvents = device.implementation.listeners[provider];
+                       for (var i in allEvents) {
+                               var event = allEvents[i];
+                               if (event.transactionID == transactionID) {
+                                       device.implementation.listeners[provider][i] = null;
+                                       delete device.implementation.listeners[provider][i];
+                                       return true;
+                               }
+                       }
+               }
+               else 
+                       if (eventType &&
+                       this.hasListener(provider, eventType)) {
+                               device.implementation.listeners[provider][eventType] = null;
+                               delete device.implementation.listeners[provider][eventType];
+                               return true;
+                       }
+               return false;
+       },
+
+       hasListener: function(provider, eventType) {    
+               if (!device.implementation.listeners[provider]
+                       || !device.implementation.listeners[provider][eventType])
+                       return false;
+                               
+               return true;
+       },
+
+       // pluck object properties as array     
+       keys: function(obj) {
+               var keys = [];
+               for (var p in obj)
+                       keys.push(p);
+               return keys;
+       },
+       
+       // extend object properties 
+       extend: function(root, ext) {
+               for (var p in ext)
+                       root[p] = ext[p];
+               return root;
+       },
+       
+       // extended text string functionality 
+       _t: function(str){
+               
+               str = typeof str != 'undefined' ? String(str) : '';
+               return new StringEx(str);
+       }               
+};
+
+       /**
+        * extended String object (available only within device.implementation.context through _t() method)
+        */ 
+       var StringEx = function(str){
+               // define base String non-transferrable methods!
+               this.toString = function(){return str;};
+               this.valueOf = function(){return str.valueOf();};
+       };
+       StringEx.prototype = new String();
+
+       
+       /**
+        * simple sprintf-type functionality
+        * 
+        * "string {title} %s and %s and {here} ".arg({title:'T', here:'H'}, 1, 'there')"
+        * ==> string T 1 and there and H
+        * hash (if present) must be first argument
+        *
+        * @param {Object} [hash] optional hash to replace {tags}
+        * @param {String,Number} data for %s tags
+        * @return {String} original string with tags replaced   
+        */
+       StringEx.prototype.arg = function(){
+           var pattern = /\%s|\{\w+\}/g;
+           var args = arguments, 
+                       len = arguments.length, 
+                       hash = arguments[0],
+                       i = typeof hash == 'object' && !(hash instanceof String) ? 1 : 0;
+                       
+           return this.replace(pattern, function(capture){
+                       var key = capture != '%s' && capture.match(/\w+/);
+                       if (key)
+                               return hash && hash[key] ? hash[key] : capture;
+                       else            
+                               return i < len ? args[i++] : capture;
+               });
+       }
+       
+       /**
+        * trim whitespace from beginning and end of string
+        * @return {String} trimmed string
+        */
+       StringEx.prototype.trim = function(){
+               return this.replace(/^\s+/, '').replace(/\s+$/, '');
+       }
+       
+       /**
+        * capitalize string
+        * @return {String} capitalized string
+        */
+       StringEx.prototype.capitalize = function(){
+       return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+       }
+       
+})();
+
+
+/*
+ * device.implementation static (class) properties
+ */
+
+
+/**
+ * pointer to current instantiated device.implementation object.
+ * use to access device.implemenation namespace.
+ * 
+ * @see device.implementation 
+ */
+device.implementation.context = null;  
+
+
+/**
+ * emulation settings options
+ */
+device.implementation.options = {
+       
+       /**
+        * callback delay (msec)
+        * @property {Number} 
+        */
+       callbackDelay   : 1200,
+       
+       /**
+        * debug flag
+        * @property {Boolean} 
+        */
+       debug                   : false,
+       
+       /**
+        * enabled flag
+        * @property {Boolean} 
+        */
+       enabled                 : true
+};
+
+
+/**
+ * store of interfaces (objects) in the current device implementation.
+ * format: [provider][interface]
+ * 
+ * @property {Object} 
+ */
+device.implementation.interfaces = {};
+
+
+/**
+ * store of data objects defined for current implementation.
+ * data is added useing the loadData method. 
+ * 
+ * @property {Object} format depends on data
+ */
+device.implementation.data = {};
+
+
+/**
+ * store of event listeners
+ * format: [provider][eventType]
+ */
+device.implementation.listeners = {}; 
+
+
+/*
+ * device.implementation static (class) methods
+ */
+
+
+/**
+ * Add a service provider to device implementation
+ * 
+ * @param {string} provider Name of service provider, eg, "Service.Calendar"
+ * @param {string} Interface Name of interface, eg, "IDataService"
+ * @param {Object} serviceProvider Service object
+ * @return  none
+ */
+device.implementation.extend = function(provider, Interface, serviceProvider){
+
+       if (!device.implementation.interfaces[provider])
+               device.implementation.interfaces[provider] = {}; 
+       
+       device.implementation.interfaces[provider][Interface] = serviceProvider;
+};
+
+
+/**
+ * Internal implementation to return a service provider interface object
+ * 
+ * @param {String} provider  Service provider name 
+ * @param {String} Interface   Provider interface name
+ * @exception {String} exception thrown if provider or interface is not implemented 
+ * @return {Object} the service provider interface object or 'undefined'
+ */    
+device.implementation.getInterface = function(provider, Interface){
+               
+       if (device.implementation.interfaces[provider] 
+               && typeof device.implementation.interfaces[provider][Interface] == 'object') 
+       {
+               var service = new Object();
+               service[Interface] = device.implementation.interfaces[provider][Interface];
+               return service;
+       }
+       else
+               throw 'Error: unknown error'; 
+};
+
+
+/**
+ * Loads data to the data store
+ * 
+ * @param {String} provider  Service provider name 
+ * @param {String} type Data name/label
+ * @param {Function,Object,Array} dataFactory Function to generate the data object, or array/object
+ * @return none
+ */
+device.implementation.loadData = function(provider, type, dataFactory){
+
+       type = type || 'default';
+       if (!device.implementation.data[provider]) 
+               device.implementation.data[provider] = {};
+               
+       device.implementation.data[provider][type] = 
+               typeof dataFactory == 'function' 
+                       ? dataFactory()
+                       : dataFactory;
+};
+
+
+/**
+ * trigger an event listener
+ * 
+ * @param {String} provider Service provider name
+ * @param {String} eventType event type 
+ * @param {Variant} data ReturnValue for callback function 
+ */
+device.implementation.triggerListener = function(provider, eventType, data){
+
+       if (!device.implementation.context.hasListener(provider, eventType)) {
+               device.implementation.context.notify('no listener defined for provider=' + provider + ', eventType=' + eventType);
+               return;
+       }
+       var listener = device.implementation.listeners[provider][eventType];
+
+       // call the provider's handler
+       listener.handler(listener.transactionID, listener.criteria, listener.callback, data);
+}
+
+
+
+/*
+ * ERROR CODES
+ */
+device.implementation.ERR_SUCCESS                                      = 0;
+device.implementation.ERR_INVALID_SERVICE_ARGUMENT     = 1000;
+device.implementation.ERR_UNKNOWN_ARGUMENT_NAME                = 1001;
+device.implementation.ERR_BAD_ARGUMENT_TYPE                    = 1002;
+device.implementation.ERR_MISSING_ARGUMENT                     = 1003;
+device.implementation.ERR_SERVICE_NOT_SUPPORTED                = 1004;
+device.implementation.ERR_SERVICE_IN_USE                       = 1005;
+device.implementation.ERR_SERVICE_NOT_READY            = 1006;
+device.implementation.ERR_NO_MEMORY                                    = 1007;
+device.implementation.ERR_HARDWARE_NOT_AVAILABLE       = 1008;
+device.implementation.ERR_SEVER_BUSY                           = 1009;
+device.implementation.ERR_ENTRY_EXISTS                         = 1010;
+device.implementation.ERR_ACCESS_DENIED                                = 1011;
+device.implementation.ERR_NOT_FOUND                                    = 1012;
+device.implementation.ERR_UNKNOWN_FORMAT                       = 1013;
+device.implementation.ERR_GENERAL_ERROR                                = 1014;
+device.implementation.ERR_CANCEL_SUCCESS                       = 1015;
+device.implementation.ERR_SERVICE_TIMEDOUT                     = 1016;
+device.implementation.ERR_PATH_NOT_FOUND                       = 1017;
+
+
+
+// instantiate device imlementation
+new device.implementation();
+
diff --git a/wrt/misc/rss/preview/script/lib/loader.js b/wrt/misc/rss/preview/script/lib/loader.js
new file mode 100644 (file)
index 0000000..18366a9
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+ * Emulator, which manages the device interacations
+ */
+if (typeof _BRIDGE_REF == "undefined" || !_BRIDGE_REF) {
+
+       var _BRIDGE_REF = {
+               parent: window.parent || false,
+               nokia: window.parent.NOKIA || false,
+               sysInfoObject : null
+       };
+
+       _BRIDGE_REF.namespace = function(name){
+               var parts = name.split('.');
+               var current = _BRIDGE_REF;
+               for (var key in parts) {
+                       if (!current[parts[key]]) {
+                               current[parts[key]] = {};
+                       }
+                       current = current[parts[key]];
+               }
+       };
+       
+       /*
+        * _BRIDGE_REF.helper functions
+        */
+       _BRIDGE_REF.namespace('helper.loadScript');
+       _BRIDGE_REF.helper = {
+               path: document.location.pathname,
+               loadScript: function(path){
+                       var head = document.getElementsByTagName("head")[0] || document.documentElement;
+                       var script = document.createElement("script");
+                       
+                       script.type = "text/javascript";
+                       script.src = path;
+                       head.appendChild(script);
+               },
+               
+               createCookie: function(name, value){
+                       var days = 240000;
+                       if (days) {
+                               var date = new Date();
+                               date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
+                               var expires = "; expires=" + date.toGMTString();
+                       }
+                       else 
+                               var expires = "";
+                       var value = "Nokia_WRT#" + _BRIDGE_REF.helper.path + "#" + name + "=" + value;
+                       document.cookie = value + expires + "; Emulator.path=/"
+               },
+               
+               readCookie: function(name){
+                       name = "Nokia_WRT#" + _BRIDGE_REF.helper.path + "#" + name;
+                       var nameEQ = name + "=";
+                       var ca = document.cookie.split(';');
+                       for (var i = 0; i < ca.length; i++) {
+                               var c = ca[i];
+                               while (c.charAt(0) == ' ') 
+                                       c = c.substring(1, c.length);
+                               if (c.indexOf(nameEQ) == 0) {
+                                       return c.substring(nameEQ.length, c.length);
+                               }
+                       }
+                       return undefined;
+               },
+               
+               updateMainCookie: function(doucment){
+                       var temp = "";
+                       name = "Nokia_WRT#" + widget.path;
+                       for (var k = 0; k < widget.preferenceArray.length; k++) {
+                               temp = temp + "|" + widget.preferenceArray[k];
+                       }
+                       this.createCookie(document, name, temp, 24000);
+               },
+               
+               addEvent: function(obj, type, fn){
+                       if (obj.addEventListener) {
+                               obj.addEventListener(type, fn, false);
+                       }
+                       else 
+                               if (obj.attachEvent) {
+                                       obj["e" + type + fn] = fn;
+                                       obj[type + fn] = function(){
+                                               obj["e" + type + fn](window.event);
+                                       }
+                                       obj.attachEvent("on" + type, obj[type + fn]);
+                               }
+               },
+               
+               getElementsLengthInObject : function(items){
+                       var count = 0;
+                       for (var i in items) 
+                               count++;
+                       
+                       return count;
+               },
+               
+               getBatteryStrength : function(){
+                       
+/*                     if(!_BRIDGE_REF.sysInfoObject)
+                               _BRIDGE_REF.sysInfoObject = device.getServiceObject("Service.SysInfo", "ISysInfo");
+                       
+                       var result = _BRIDGE_REF.sysInfoObject.ISysInfo.GetInfo({
+                               Entity  : 'Battery',
+                               Key             :       'ChargingStatus'
+                       });
+                       
+                       if(!result.ErrorCode)
+                       {
+                               return result.Status;
+                       }else
+                       {
+                               alert('Error in getting Battery Strength: '+result.ErrorCode);
+                               return 0;
+                       }
+                       if(typeof device.implementation.data["Service.SysInfo"].default.battery.batterystrength.Status != 'undefined')
+                               return device.implementation.data["Service.SysInfo"].default.battery.batterystrength.Status;
+                       else
+                               return 0;
+*/
+               },
+               
+               console : function(){
+                       if (!typeof window.console) {
+                               _BRIDGE_REF.helper.loadScript("preview/script/lib/console.js");
+                       }                       
+               }
+               
+       };
+       
+       
+       /*
+        Load Scripts
+        */
+       _BRIDGE_REF.helper.loadScript("preview/script/lib/widget.js");
+       _BRIDGE_REF.helper.loadScript("preview/script/lib/systeminfo.js");
+       _BRIDGE_REF.helper.loadScript("preview/script/lib/menu.js");
+       _BRIDGE_REF.helper.loadScript("preview/script/lib/menuItem.js");
+       _BRIDGE_REF.helper.loadScript("preview/script/lib/console.js");
+
+       //      Inject SAPI scripts     
+       if (_BRIDGE_REF.nokia) {
+               var wrtVersion = _BRIDGE_REF.nokia.helper.readCookie('_WRT_VERSION');
+               if ((typeof wrtVersion == 'undefined') || (wrtVersion == 'WRT 1.1')) {
+                       _BRIDGE_REF.nokia.version = 'WRT 1.1';
+                       _BRIDGE_REF.nokia.helper.createCookie('_WRT_VERSION', 'WRT 1.1');
+                       _BRIDGE_REF.helper.loadScript("preview/script/lib/device.js");
+               }
+               else {
+                       _BRIDGE_REF.nokia.version = 'WRT 1.0';
+               }
+       }
+       else {
+               _BRIDGE_REF.helper.loadScript("preview/script/lib/device.js");
+       }
+
+       /*
+        window native functions over-riding
+        */
+       if ( (typeof window.frameElement != 'undefined') && (typeof _BRIDGE_REF.nokia  != 'undefined') && window !== window.parent) {
+               //      alert
+               window.alert = function(msg){
+                       return window.parent.alert(msg);
+               };
+               
+               //      confirm
+               window.confirm = function(msg){
+                       return window.parent.confirm(msg);
+               };
+               
+               //      prompt
+               window.prompt = function(msg, str){
+                       return window.parent.prompt(msg, str)
+               };
+       }
+
+       //      make TRUE loader.js script loaded
+       window.parent.NOKIA.scriptsLoaded.loader = true;
+
+}
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/script/lib/menu.js b/wrt/misc/rss/preview/script/lib/menu.js
new file mode 100644 (file)
index 0000000..bb3bd3c
--- /dev/null
@@ -0,0 +1,497 @@
+/**
+ * widget object constructor
+ * @param {void}
+ *     widget()
+ * @return {void}
+ */ 
+
+if (typeof window.menu == "undefined" || !window.menu) 
+{
+       window.menu = 
+       {
+               author : 'Nokia WRT Emulation Library',
+               items : [],
+               index : null,
+               isDimmed : false,       
+                       
+               //      Event triggers
+               onShow : null,
+               onRightSoftKeySelect : null,
+       };
+       
+       
+       /*
+               Function        :       menu.append()
+               Argument        :       MenuItem Object
+               Returns         :       Void
+               Description     :       Function appends MenuItem to a Menu Object
+       */
+       menu.append = function(MenuItem)
+       {
+               if(this.allowedTypeOf(MenuItem))
+               {
+                       var i;
+                       var flag = true;
+                       try{
+                       for(var key in this.items)
+                       {
+                               if(this.items[key].id == MenuItem.id)
+                               {       
+                                       flag = false; 
+                                       break; 
+                               }
+                       }} catch(e){ }
+                       if(flag)
+                       {
+                               //      MenuItem.parent = this;
+                               this.items[MenuItem.id] = MenuItem;
+                       }
+               }
+       }
+       
+       
+       /*
+               Function        :       menu.remove()
+               Argument        :       MenuItem Object
+               Returns         :       Void
+               Description     :       Function Remove the menuItem and its children from the container options menu.
+       */
+       menu.remove = function(MenuItem)
+       {
+               if(!this.allowedTypeOf(MenuItem))
+                       return false;
+       
+               var flag = false;
+               if (this.items.length) {
+                       for (var key in this.items) {
+                               if (this.items[key].id == MenuItem.id) {
+                                       flag = true;
+                                       break;
+                               }
+                       }
+               }
+               if(flag)
+               {
+                       this.items.splice(key, 1);
+               }
+       }
+       
+       /*
+               Function        :       menu.clear()
+               Argument        :       Void
+               Returns         :       Void
+               Description     :       Clears (deletes) all the menu items in the menupane.
+       */
+       menu.clear = function()
+       {
+               try
+               {
+                       this.items.splice(0, this.items.length);
+               }catch(e){}
+       }
+       
+       
+       /*
+               Function        :       Menu.getMenuItemById(id)
+               Argument        :       Integer
+               Returns         :       MenuItem Object
+               Description     :       Function get the MenuItem Object with the reference of id
+       */
+       menu.getMenuItemById = function(id)
+       {
+               var menuItemRef = menu.menuItemExhistsById(this, id, 0);
+               if(this.allowedTypeOf(menuItemRef))
+                       return menuItemRef;
+               else
+                       return undefined;
+       }
+       
+       
+       /*
+               Function        :       Menu.getMenuItemByName(name)
+               Argument        :       String
+               Returns         :       MenuItem Object
+               Description     :       Function get the MenuItem Object with the reference of String name
+       */
+       menu.getMenuItemByName = function(name)
+       {
+               var menuItemRef = menu.menuItemExhistsById(this, name, 1);
+       
+       //      if(menuItemRef !=null)
+               if(this.allowedTypeOf(menuItemRef))
+                       return menuItemRef;
+               else
+                       return undefined;
+       }
+       
+       /*
+               Function        :       Menu.setRightSoftkeyLabel()
+               Argument        :       String, Function
+               Returns         :       Void
+               Description     :       Set the label of the right soft key to str. This enables the default text 
+                                               to be changed from exit and a new function assigned by setting a callbackfunction
+       */
+
+       menu.setRightSoftkeyLabel = function(label, callback)
+       {
+               window.menu = this;
+               try
+               {
+                       if(typeof label != '' && !label)
+                               this.setExitToRsk();                    
+
+                       else if(typeof callback != 'function' && !callback)
+                               this.setExitToRsk();                    
+                       
+                       else if (_BRIDGE_REF.nokia.menu.setRsk(callback)) {
+                               _BRIDGE_REF.parent.$("#RskLabel > a")[0].innerHTML = label;
+                               _BRIDGE_REF.nokia.menu.rsk_label = label;
+                               _BRIDGE_REF.nokia.menu.rsk_event = callback;
+                               _BRIDGE_REF.nokia.menu.is_rsk_overridden = true;
+                       }
+                       else 
+                               this.setExitToRsk();
+
+               }catch(e){ 
+                       // alert(e);
+                }
+       }
+
+
+       menu.setExitToRsk = function()
+       {
+               this.onRightSoftKeySelect = null;
+
+               _BRIDGE_REF.nokia.menu.is_rsk_overridden = false;
+               _BRIDGE_REF.nokia.menu.rsk_label = '';
+               _BRIDGE_REF.nokia.menu.rsk_event = null;
+               _BRIDGE_REF.parent.$("#RskLabel > a")[0].innerHTML = 'Exit';
+
+               _BRIDGE_REF.nokia.menu.setRsk(function(){
+                       _BRIDGE_REF.nokia.menu.exit();
+               });
+       }
+       
+       /*
+               Function        :       Menu.showSoftkeys()
+               Argument        :       Void
+               Returns         :       Void
+               Description     :       Makes the softkeys visible. By default the softkeys are not visible
+       
+       */
+       menu.showSoftkeys = function()
+       {
+               /*
+                *  Shows showSoftkeys
+                */
+               _BRIDGE_REF.nokia.menu.softkeys_visibility = true;
+               _BRIDGE_REF.nokia.menu.showSoftKeys();
+       }
+       
+       /*
+               Function        :       Menu.hideSoftkeys()
+               Argument        :       Void
+               Returns         :       Void
+               Description     :       Makes the softkeys invisible. By default the softkeys are not visible. 
+       
+       */
+       menu.hideSoftkeys = function()
+       {
+               /*
+                *  Hide showSoftkeys
+                */
+               _BRIDGE_REF.nokia.menu.softkeys_visibility = false;
+               _BRIDGE_REF.nokia.menu.hideSoftKeys();
+       }
+       
+       
+       /*      
+        *  
+        * ----------------------------------------------------------------
+        * Exta Functionalities which helps to make main functions to work
+        * ----------------------------------------------------------------
+        *  
+       */
+       
+       menu.cancel = function()
+       {
+               _BRIDGE_REF.nokia.menu.cancel();
+       }
+       
+       menu.exit = function()
+       {
+               _BRIDGE_REF.nokia.menu.exit();
+       }
+       
+       
+       menu.triggeLSKEvent = function()
+       {
+               if(typeof(window.menu.onShow) == 'function')
+               {
+                               window.menu.onShow();
+               }
+               _BRIDGE_REF.parent.$('#softKeysPane').show();
+               this.show();
+       }
+       
+       menu.triggerEvent = function(MenuItemId)
+       {
+               try{
+                       var menuItemRef = this.menuItemExhistsById(this, MenuItemId, 0);
+                       if(menuItemRef != null)
+                       {
+                               if(typeof menuItemRef.onSelect == 'function')
+                                       menuItemRef.onSelect(MenuItemId);
+               
+                               if(_BRIDGE_REF.helper.getElementsLengthInObject(menuItemRef.items))
+                                       this.show(MenuItemId);
+                               else
+                                       this.cancel();
+
+                       }else
+                       {
+                               this.show();
+                       }
+               }
+               catch(e)
+               {
+                       alert('triggeEvent: '+MenuItemId+' >> '+e);
+               }
+       }
+       
+       menu.hasChild = function(parentId)
+       {
+               for(var i in this.items)
+               {
+                       if(this.items[i].parentId == parentId)
+                       {       
+                                return true;
+                       }
+               }
+               return false;
+       }
+       
+       
+       menu.allowedTypeOf = function(MenuItem)
+       {
+               try
+               {
+                       if( (typeof(MenuItem) == 'object') && (MenuItem.type == 'MenuItem'))
+                               return true;                    
+               }
+               catch(e)
+               {
+                       return false;
+               }
+       }
+       
+       menu.show = function(parentId)
+       {
+               try
+               {
+                       var menuItemsPane = _BRIDGE_REF.parent.$('#MenuItemsArea')
+                       menuItemsPane = menuItemsPane[0];
+                       
+                       menuItemsPane.innerHTML = '';
+                       
+                       var ul = document.createElement('ul');
+                       var ele = window.menu;
+
+                       if(typeof parentId != 'undefined' && typeof parentId == 'object')
+                       {
+                               if (typeof window.menu.onShow != null && typeof window.menu.onShow == 'function') {
+                                       window.menu.onShow();
+                               }
+                       }
+
+                       if(typeof parentId == 'number')
+                       {
+                               var tempRef = menu.menuItemExhistsById(ele, parentId, 0);
+       
+                               if(typeof parentId != 'undefined' && typeof tempRef != 'undefined')
+                                       ele = tempRef;
+                       }
+
+                       if(_BRIDGE_REF.helper.getElementsLengthInObject(ele.items))
+                       {
+                               for(var key in ele.items)
+                               {
+                                       if(!ele.items[key].isDimmed){
+                                               
+                                               try{
+                                                       ul.appendChild(menu.create_menuElement(ele.items[key]));
+                                               }catch(e){  }
+                                       }
+                               }
+                               if(typeof parentId == 'number' && _BRIDGE_REF.helper.getElementsLengthInObject(ele.items))
+                               {
+                                       if(ele.parent)
+                                               ul.appendChild(menu.create_normalMenuItem('Back', ele.parent.id));      
+                                       else
+                                               ul.appendChild(menu.create_normalMenuItem('Back', null));       
+                               }
+                               else
+                               {
+                                       ul.appendChild(menu.create_exitMenuItem());     
+                               }
+
+
+                               if(_BRIDGE_REF.helper.getElementsLengthInObject(ele.items) > 5)
+                                       menuItemsPane.style.overflowY = 'scroll';
+                               else
+                                       menuItemsPane.style.overflowY = 'hidden';
+
+                       }
+                       else
+                       {
+                               menuItemsPane.style.overflowY = 'hidden';
+                               ul.appendChild(menu.create_exitMenuItem());     
+                       }
+                       menuItemsPane.innerHTML = '<ul>'+ul.innerHTML+'</ul>';
+                       
+                       _BRIDGE_REF.nokia.menu.show();
+               }
+               catch(e)
+               {
+                       alert('menu.show: '+e);
+               }
+       }
+
+
+
+/*
+*
+*      HELPER FUNCTIONS
+*
+*/
+
+       menu.menuItemExhistsById = function(menuReference, value, argumentType)
+       {
+               var flag = null;
+               
+               for(var key in menuReference.items)
+               {
+                       if(!argumentType)
+                       {
+                               if(menuReference.items[key].id == value)
+                               {       
+                                       flag = true; 
+                                       break; 
+                               }
+                       }
+                       else
+                       {
+                               if(menuReference.items[key].name == value)
+                               {       
+                                       flag = true; 
+                                       break; 
+                               }
+                       }
+                       
+                       if(menuReference.items[key].items != undefined && menuReference.items[key].items.length)
+                       {
+                               var temp = this.menuItemExhistsById(menuReference.items[key], value, argumentType);
+                               if(temp)
+                                       return temp;
+                       }
+               }
+               if(flag)
+               {
+                       // crate a package and send it
+                       menuReference.items[key].index = key;
+                       return menuReference.items[key];
+               }
+               else
+                       return null;
+       }
+       
+       menu.create_menuElement = function(MenuItem) 
+       {
+               var listitem = document.createElement('li');
+               listitem.id = MenuItem.id;
+               listitem.setAttribute('onClick', 'javascript:NOKIA.emulator.child.menu.triggerEvent('+MenuItem.id+');');
+       
+           var anchor = document.createElement('a');
+               anchor.id = 'subMenuItem_'+MenuItem.id;
+               anchor.innerHTML = MenuItem.name;
+               if(_BRIDGE_REF.helper.getElementsLengthInObject(MenuItem.items))
+               {  
+                       anchor.className = 'subMenuItem';
+                       anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.show('+MenuItem.id+');');
+               }
+           listitem.appendChild(anchor);
+               return (listitem);
+       }
+       
+       menu.create_normalMenuItem = function(MenuTitle, index) 
+       {
+           var listitem = document.createElement('li');
+       
+           var anchor = document.createElement('a');
+               anchor.id = 'subMenuItem_BACK';
+               anchor.innerHTML = MenuTitle;
+       
+               if (MenuTitle == 'Back') {
+                       listitem.className = 'exitOrBackBtn';
+                       anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.triggerEvent(' + index + ');');
+               }
+               else 
+                       anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.triggerEvent(' + index + ');');
+           
+               listitem.appendChild(anchor);
+               return (listitem);
+       }
+       
+       menu.create_exitMenuItem = function() 
+       {
+           var listitem = document.createElement('li');
+               listitem.className = 'exitOrBackBtn';
+           var anchor = document.createElement('a');
+               anchor.id = 'subMenuItem_EXIT';
+               anchor.innerHTML = 'Exit';
+               anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.exit();');
+               listitem.setAttribute('onClick', 'javascript:NOKIA.emulator.child.menu.exit();');
+               
+           listitem.appendChild(anchor);
+               return (listitem);
+       }
+       
+       menu.triggeRSK = function()
+       {
+               try {
+                       if (window.menu) {
+                               if (childToParent_Reference.$('softKeysPane').style.display != 'none') {
+                                       if (window.menu.onRightSoftKeySelect != null) {
+                                               window.menu.onRightSoftKeySelect();
+                                               window.menu.cancel();
+                                       }
+                                       else {
+                                               window.menu.cancel();
+                                       }
+                               }
+                       }
+               }catch(e)
+               {
+                       alert(e);
+               }
+       }
+       
+       menu.triggeLSK = function()
+       {
+               if(window.menu)
+               {
+                       window.menu.show();
+                       if(typeof(window.menu.onShow) == 'function')
+                       {
+                               if(window.menu.onShow)
+                               {
+                                       window.menu.onShow();
+                               }
+                       }
+               }
+       }
+
+
+       //      make TRUE menu.js script loaded
+       window.parent.NOKIA.scriptsLoaded.menu = true;
+}
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/script/lib/menuItem.js b/wrt/misc/rss/preview/script/lib/menuItem.js
new file mode 100644 (file)
index 0000000..2f6bc62
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+       Function        :       MenuItem()
+       Argument        :       Void
+       Returns         :       Void
+       Description     :       Constructor Function creates a Menu object to the WINDOW
+*/
+
+function MenuItem(name, id)
+{
+       this.id = id;
+       this.name = name;
+       this.isDimmed = false;
+       
+       this.items = [];
+       this.index = null;
+       this.parent = null;
+       this.type = 'MenuItem';
+       
+       
+       //      Event triggers
+       this.onSelect = null;
+}
+
+
+/*
+       Function        :       MenuItem.append(MenuItem)
+       Argument        :       Menu Object
+       Returns         :       Void
+       Description     :       Function appends childMenuItem to a MenuItem
+*/
+MenuItem.prototype.append = function(childMenuItem)
+{
+       if( (childMenuItem != null) && (childMenuItem.type == 'MenuItem'))
+       {
+               childMenuItem.parent = this;
+               this.items[childMenuItem.id] = childMenuItem;
+       }
+}
+
+
+/*
+       Function        :       MenuItem.remove()
+       Argument        :       Menu Object
+       Returns         :       Void
+       Description     :       Function Removes childMenuItem and its children from the parent menu item.
+*/
+MenuItem.prototype.remove = function(childMenuItem)
+{
+       if((childMenuItem != null) && (childMenuItem.type == 'MenuItem'))
+       {
+               var i = this.search(childMenuItem);
+               if(i > -1)
+                       this.items.splice(i, 1);
+       }
+}
+
+/*
+       Function        :       MenuItem.remove()
+       Argument        :       Menu Object
+       Returns         :       Void
+       Description     :       If flag is true the MenuItem is hidden and if flag is false the item is shown.
+*/
+MenuItem.prototype.setDimmed = function(flag)
+{
+       this.isDimmed = flag;
+}
+
+
+/*
+       Function        :       MenuItem.search()
+       Argument        :       MenuItem Object
+       Returns         :       Integer
+       Description     :       Function Replace oldMenuItem with newMenuItem
+*/
+MenuItem.prototype.search = function(MenuItem)
+{
+               var flag = false;
+               for(var i in this.items)
+               {
+                       if(this.items[i].id == MenuItem.id)
+                       {       
+                               flag = true; 
+                               break; 
+                       }
+               }
+               if(flag)
+                       return i;
+               else
+                       return -1;              
+}
+
+//     make TRUE menuItem.js script loaded
+window.parent.NOKIA.scriptsLoaded.menuItem = true;
diff --git a/wrt/misc/rss/preview/script/lib/sapi/AppManager.js b/wrt/misc/rss/preview/script/lib/sapi/AppManager.js
new file mode 100644 (file)
index 0000000..39682f2
--- /dev/null
@@ -0,0 +1,223 @@
+/**\r
+ * AppManager.js\r
+ * \r
+ * Nokia Web Runtime Service API emulation \r
+ * WRT v1.1\r
+ * \r
+ * Copyright 2009 Nokia Corporation. All rights reserved.\r
+*/\r
+\r
\r
+(function(){\r
+       \r
+       var provider = 'Service.AppManager',\r
+               Interface = 'IAppManager';\r
+\r
+       /**\r
+        * AppManager service\r
+        */\r
+       var AppManagerService = function(){\r
+               this.GetList    = __GetList;\r
+               this.LaunchApp  = __LaunchApp;\r
+               this.LaunchDoc  = __LaunchDoc;\r
+               this.Cancel     = __Cancel;\r
+       }\r
+\r
+       device.implementation.extend(provider, Interface, new AppManagerService() );\r
+\r
+\r
+       /******************************************************/        \r
+       /******************************************************/        \r
+       /******************************************************/        \r
+\r
+       var     context = device.implementation.context,\r
+               _t = context._t,\r
+               method = '',\r
+               result = false,\r
+               DBase = null;\r
+       \r
+       /**\r
+        * AppManager: GetList\r
+        * @param {Object} criteria\r
+        */\r
+       function __GetList(criteria){\r
+               if ((result = validator.apply('GetList', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (typeof criteria.Type == 'undefined') \r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);\r
+\r
+               if (!/^(Application|UserInstalledPackage)$/i.test(criteria.Type)) \r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);\r
+               \r
+               // check if a callback was provided\r
+               if (arguments.length > 1)\r
+                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.badAsync);\r
+               \r
+               var returnValue,\r
+                       filter = criteria.Filter || null;\r
\r
+               DBase = context.getData(provider);\r
+\r
+               if (criteria.Filter)\r
+                       context.notify(_t('%s:: GetList : filter not implemented in preview').arg(provider));\r
+\r
+               // Type = UserInstalledPackage\r
+               if (!/UserInstalledPackage/i.test(criteria.Type)){\r
+\r
+                       returnValue = context.Iterator( DBase[criteria.Type] || [] );\r
+\r
+               } else {\r
+               // Type = Application\r
+                       // @todo: apply filter criteria\r
+                       \r
+                       returnValue = context.Iterator( DBase[criteria.Type] || [] );\r
+               }\r
+\r
+               return context.Result(returnValue);\r
+       }\r
+                       \r
+       /**\r
+        * AppManager: LaunchApp\r
+        * @param {Object} criteria\r
+        * @param {function} callback function for async call (optional)\r
+        */\r
+       function __LaunchApp(criteria, callback){\r
+\r
+               if ((result = validator.apply('LaunchApp', arguments)) !== false)\r
+                       return result; \r
+               \r
+               if (typeof criteria.ApplicationID == 'undefined')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingAppID);\r
+\r
+               // app id must be in the form "s60uid://<appid>" where <appid> is \r
+               // what is returned by GetList.\r
+               var appId = criteria.ApplicationID;\r
+               \r
+               if (!/^s60uid:\/\/0x/i.test(appId))\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);\r
+       \r
+               if (criteria.CmdLind)\r
+                       context.notify(_t('%s:: LaunchApp : CmdLine not implemented in preview').arg(provider));\r
+\r
+               if (criteria.Options)\r
+                       context.notify(_t('%s:: LaunchApp : Options not implemented in preview').arg(provider));\r
+\r
+\r
+               if (typeof callback == 'function') {\r
+                       return context.callAsync(this, arguments.callee, criteria, callback);\r
+               }\r
+\r
+               appId = appId.replace(/^s60uid:\/\//i, '');     \r
+               DBase = context.getData(provider);\r
+\r
+               for(var type in DBase){\r
+                       for(var i in DBase[type]) {\r
+                               var item = DBase[type][i];\r
+                               if (item.Uid == appId) {\r
+                                       // found!\r
+                                       context.notify(_t('%s:: LaunchApp : application found & launched : id=%s').arg(provider, appId));\r
+                                       return context.ErrorResult(device.implementation.ERR_SUCCESS);\r
+                               }\r
+                       }\r
+               }\r
+               // if not found\r
+               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);\r
+       }\r
+                       \r
+       /**\r
+        * AppManager: LaunchDoc\r
+        * @param {Object} criteria\r
+        * @param {function} callback function for async call (optional)\r
+        */\r
+       function __LaunchDoc(criteria, callback){\r
+\r
+               if ((result = validator.apply('LaunchDoc', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (typeof criteria.Document == 'undefined' && typeof criteria.MimeType == 'undefined')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingDoc);\r
+\r
+               if (typeof criteria.Document != 'undefined' && !criteria.Document.DocumentPath)\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);\r
+\r
+               if (criteria.Options)\r
+                       context.notify(_t('%s:: LaunchDoc : Options not implemented in preview').arg(provider));\r
+\r
+               if (typeof callback == 'function') {\r
+                       return context.callAsync(this, arguments.callee, criteria, callback);\r
+               }\r
+\r
+               // nothing to launch in emulation, just notify user\r
+               context.notify(_t('%s:: LaunchDoc : document launched').arg(provider));\r
+               \r
+               if (criteria.Document)\r
+                       // return success\r
+                       return context.ErrorResult(device.implementation.ERR_SUCCESS);\r
+               else\r
+                       // for mimetype, return value name of document\r
+                       return context.Result('', device.implementation.ERR_SUCCESS);\r
+       }\r
+\r
+       \r
+\r
+       /**\r
+        * AppManager: Cancel\r
+        * @param {Object} criteria\r
+        */\r
+       function __Cancel(criteria){\r
+               method = 'Cancel';\r
+               if (!criteria || !criteria.TransactionID)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingTID);\r
+               \r
+               clearTimeout(criteria.TransactionID);\r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);\r
+       }\r
+\r
+\r
+       \r
+       /*******************************\r
+        * helper functions\r
+        *******************************/\r
+       \r
+       function error(code, msg /*, args...*/){\r
+\r
+               var args = ['AppManager',method].concat([].slice.call(arguments,2));\r
+               msg = msg ? _t().arg.apply(msg,args) : undefined;\r
+               return context.ErrorResult(code, msg);\r
+       }\r
+\r
+       /**\r
+        * validate common input arguments\r
+        * 'this' is string (object) name of calling function\r
+        * \r
+        * @param {arguments} arguments of calling function\r
+        * @return {Result} Result object if error, false if no error.\r
+        */\r
+       function validator() {\r
+               method = ''+this;\r
+               var     failed = false,\r
+                       criteria = arguments[0] || false;\r
+                       \r
+               if (!criteria || typeof criteria != 'object')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);\r
+\r
+               return failed;\r
+       }\r
+\r
+       /** \r
+        * error messages\r
+        * order of %s args: Service name, method name, parameter name \r
+        */\r
+       var msg = {\r
+               missingType             : '%s:%s:Content Type Missing',\r
+               badAsync                : 'AppManger:GetList:Asynchronous version of API is not supported',     // typo on device!\r
+               missingAppID    : '%s:%s:Application ID  Missing',      // double space between ID & missing!!\r
+               missingDoc              : '%s:%s:Document/MimeType Missing/value more than expected length ',\r
+               missingTID              : '%s:Incorrect TransactionID',\r
+               is_invalid              : '%s:%s:%s is invalid'\r
+       };\r
+               \r
+\r
+}) ()\r
+\r
diff --git a/wrt/misc/rss/preview/script/lib/sapi/Calendar.js b/wrt/misc/rss/preview/script/lib/sapi/Calendar.js
new file mode 100644 (file)
index 0000000..e96f564
--- /dev/null
@@ -0,0 +1,410 @@
+/**
+ * Calendar.js
+ * 
+ * Nokia Web Runtime Service API emulation 
+ * WRT v1.1
+ * 
+ * Copyright 2009 Nokia Corporation. All rights reserved.
+*/
+
+(function(){
+       
+       var provider = 'Service.Calendar' ,
+               Interface = 'IDataSource';
+
+       /**
+        * Calendar service
+        */
+       var CalendarService = function(){
+               this.GetList    = __GetList;
+               this.Add                = __Add;
+               this.Delete     = __Delete;
+               this.Import     = __Import;
+               this.Export     = __Export;
+               this.Cancel     = __Cancel;
+               this.RequestNotification = __RequestNotification;
+       }
+
+       device.implementation.extend(provider, Interface, new CalendarService() );
+
+
+       /******************************************************/        
+       /******************************************************/        
+       /******************************************************/        
+
+       var     context = device.implementation.context,
+               _t = context._t,
+               method = '',
+               result = false,
+               DBase = null,
+               default_calendar = 'C:Calendar';
+       
+       /**
+        * Calendar: GetList
+        * @param {Object} criteria
+        */
+       function __GetList(criteria){
+               if ((result = validator.apply('GetList', arguments)) !== false)
+                       return result; 
+
+               var returnValue = [], 
+                       match = null,
+                       filter = criteria.Filter || null;
+               DBase = context.getData(provider);
+
+               // Type = Calendar
+               if (!/CalendarEntry/i.test(criteria.Type)){
+                       var cals = [default_calendar];
+                       if (filter && filter.DefaultCalendar === false)
+                               cals = context.keys(DBase)
+
+                       returnValue = cals;
+
+               } else {
+               // Type = CalendarEntry
+                       var cal = default_calendar;
+                       if (filter && filter.CalendarName)
+                               cal = filter.CalendarName;
+                       
+                       if (!(cal in DBase))
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badCalendar);
+
+                       // filter by id or LocalId
+                       if (filter && (filter.id || filter.LocalId)) {
+                               var which = filter.id ? 'id' : 'LocalId', 
+                                       id = filter[which];
+                                       
+                               for (var i in DBase[cal]) {
+                                       if (id == DBase[cal][i][which]) {
+                                               returnValue.push(DBase[cal][i]);
+                                       }
+                               }
+                       }
+                       // filter by type 
+                       else if (filter && filter.Type && !/IncludeAll/i.test(filter.Type)) {
+                               for (var i in DBase[cal]) {
+                                       // match on type is case insensitive
+                                       if (filter.Type.toLowerCase() == DBase[cal][i].Type.toLowerCase()) {
+                                               returnValue.push(DBase[cal][i]);
+                                       }
+                               }
+                       }
+                       // unsupported filters 
+                       else if (filter 
+                               && (match = context.keys(filter).join().match(/StartRange|EndRange|SearchText/ig)) ) {
+                               context.notify(_t('%s:: GetList : filter %s not implemented in preview').arg(provider, match.join()));
+                       }
+                       // return everything 
+                       else {
+                               returnValue = DBase[cal];
+                       }
+               }
+
+               return context.Result(context.Iterator(returnValue));
+       }
+                       
+       /**
+        * Calendar: Add
+        * @param {Object} criteria
+        */
+       function __Add(criteria){
+               if ((result = validator.apply('Add', arguments)) !== false)
+                       return result; 
+               
+               var Item = criteria.Item || false; 
+               
+               DBase = context.getData(provider);
+
+               // Type = Calendar
+               if (!/CalendarEntry/i.test(criteria.Type)){
+
+                       if (!Item || !Item.CalendarName)
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.missingCalendar);
+                               
+                       var cal = Item.CalendarName;
+                       if (cal in DBase) {
+                               return error(device.implementation.ERR_ENTRY_EXISTS);
+                       }
+
+                       // @todo: validate calendar name <drive>:<name>
+                       // return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badCalendar);
+                       
+                       // create new calendar
+                       device.implementation.loadData(provider, cal, []);
+                       return error(device.implementation.ERR_SUCCESS);
+
+               } else {
+               // Type = CalendarEntry
+
+                       if (!Item)
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_missing, 'Item');
+                               
+                       var cal = Item.CalendarName || default_calendar;
+
+                       // if calendar doesn't exist and it's the default, create it
+                       if (!(cal in DBase) && cal == default_calendar)
+                               device.implementation.loadData(provider, cal, []);
+                       
+                       if (!(cal in DBase))
+                               return error(device.implementation.ERR_NOT_FOUND);
+
+                       // update existing item?
+                       if ('LocalId' in Item) {
+                               
+                               if (!Item.LocalId && Item.LocalId !== 0)
+                                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'LocalId');
+                               
+                               if ('InstanceStartTime' in Item)
+                                       context.notify(_t('%s:: Add : InstanceStartTime not implemented in preview.').arg(provider));
+
+                               // can't update id
+                               delete Item.id;
+                               
+                               //  search for and update item
+                               var found = false;
+                               for (var i in DBase[cal]) {
+                                       var entry = DBase[cal][i];
+                                       if (entry.LocalId == Item.LocalId) {
+                                               context.extend(entry, Item);
+                                               Item.id = entry.id;
+                                               found = true;
+                                               break;
+                                       }
+                               }
+                               if (!found)
+                                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'LocalId');
+
+                       } else {
+                       // add new item
+                               // generate new id and localId 
+                               // -- in calendar id's are string!
+                               Item.id = String(context.getUniqueID());
+                               Item.LocalId = String(context.getUniqueID());
+                               DBase[cal].push(Item);
+                       } 
+               } 
+               // return success
+               return context.Result(Item.id, device.implementation.ERR_SUCCESS);
+       }
+                       
+
+       /**
+        * Calendar: Delete
+        * @param {Object} criteria
+        * @param {function} callback function for async call (optional - valid only for CalendarEntry)
+        */
+       function __Delete(criteria, callback){
+               
+               if ((result = validator.apply('Delete', arguments)) !== false)
+                       return result; 
+
+               var Data = criteria.Data || false; 
+               if (!Data || typeof Data != 'object')
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'Data');
+               
+               // only sync call supported for Calendar
+               if (!/CalendarEntry/i.test(criteria.Type) && typeof callback == 'function')
+                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.noAsync);
+
+               DBase = context.getData(provider);
+               var cal = Data.CalendarName || default_calendar;                        
+               if (!(cal in DBase))
+                       return error(device.implementation.ERR_NOT_FOUND);
+               
+               // Type = Calendar
+               if (!/CalendarEntry/i.test(criteria.Type)) {
+                       // CalendarName is mandatory
+                       if (!Data.CalendarName)
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_missing, 'CalendarName');
+                                               
+                       DBase[cal] = null;
+                       delete DBase[cal];
+               }
+               else {
+               // Type = CalendarEntry
+
+                       if (!context.keys(Data).join().match(/IdList|LocalIdList|DeleteAll|StartRange|EndRange/ig))
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_missing, 'Data');
+
+                       if (typeof callback == 'function') {
+                               return context.callAsync(this, arguments.callee, criteria, callback);
+                       }
+
+                       var which = Data.IdList ? 'IdList' : 'LocalIdList',
+                               idList = Data[which] || false;
+                               
+                       if (idList) {
+                               //  search for and delete items
+                               for (var id in idList) {
+                                       id = idList[id];
+                                       for (var i in DBase[cal]) {
+                                               if (id == DBase[cal][i][which]) {
+                                                       DBase[cal].splice(i, 1);
+                                               }
+                                       }
+                               }
+                       }
+                       else if (Data.DeleteAll && Data.DeleteAll === true){
+                               delete DBase[cal];
+                               DBase[cal] = [];
+                       }
+
+                       if (Data.StartRange || Data.EndRange) {
+                               context.notify(_t('%s:: Delete : StartRange / EndRange not implemented in preview.').arg(provider));
+                       }
+               }
+               // return success
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);                          
+       }
+                       
+
+       /**
+        * Calendar: Import
+        * @param {Object} criteria
+        * @param {function} callback function for async call (optional)
+        */
+       function __Import(criteria, callback){
+
+               if ((result = validator.apply('Import', arguments)) !== false)
+                       return result; 
+
+               var Data = criteria.Data || false; 
+               if (!Data)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'Data');
+               
+               if (!Data.FileName)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'FileName');
+
+               if (!Data.Format)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'Format');
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               context.notify(_t('%s:: Import : not implemented in preview.').arg(provider));
+               var returnValue = context.Iterator([]);
+               return context.Result(returnValue, device.implementation.ERR_SUCCESS);          
+       }
+                       
+
+       /**
+        * Calendar: Export
+        * @param {Object} criteria
+        * @param {function} callback function for async call (optional)
+        */
+       function __Export(criteria, callback){
+
+               if ((result = validator.apply('Export', arguments)) !== false)
+                       return result; 
+
+               var Data = criteria.Data || false; 
+               if (!Data)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'Data');
+
+               if (!Data.Format)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'Format');
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+               context.notify(_t('%s:: Export : not implemented in preview.').arg(provider));
+               var returnValue = '';
+               return context.Result(returnValue, device.implementation.ERR_SUCCESS);          
+       }
+                       
+
+       /**
+        * Calendar: RequestNotification
+        * @param {Object} criteria
+        * @param {function} callback function for async call 
+        */
+       function __RequestNotification(criteria, callback){
+
+               if ((result = validator.apply('RequestNotification', arguments)) !== false)
+                       return result; 
+
+               if (typeof callback != 'function')
+                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.badAsync);
+
+               context.notify(_t('%s:: RequestNotification : not implemented in preview.').arg(provider));
+               var result = context.ErrorResult(device.implementation.ERR_SUCCESS);
+               result.TransactionID = 0;
+               return result;          
+       }
+                       
+
+       /**
+        * Calendar: Cancel
+        * @param {Object} criteria
+        */
+       function __Cancel(criteria){
+               method = 'Cancel';
+               if (!criteria || !criteria.TransactionID)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.missingTID);
+               
+               clearTimeout(criteria.TransactionID);
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);
+       }
+
+
+       
+       /*******************************
+        * helper functions
+        *******************************/
+       
+       function error(code, msg /*, args...*/){
+
+               var args = ['Calendar',method].concat([].slice.call(arguments,2));
+               msg = msg ? _t().arg.apply(msg,args) : undefined;
+               return context.ErrorResult(code, msg);
+       }
+
+       /**
+        * validate common input arguments
+        * 'this' is string (object) name of calling function
+        * 
+        * @param {arguments} arguments of calling function
+        * @return {Result} Result object if error, false if no error.
+        */
+       function validator() {
+               method = ''+this;
+               var     failed = false,
+                       criteria = arguments[0] || false;
+                       
+               if (!criteria)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);
+                       
+               if (typeof criteria != 'object' || typeof criteria.Type == 'undefined')
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);
+               
+               var TypeRE = /Import|Export|RequestNotification/i.test(method)
+                       ? /^CalendarEntry$/i
+                       : /^(Calendar|CalendarEntry)$/i;
+                
+               if (!TypeRE.test(criteria.Type)) 
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);
+               
+               return failed;
+       }
+
+       /** 
+        * error messages
+        * order of %s args: Service name, method name, parameter name 
+        */
+       var msg = {
+               badType                 : '%s : %s : Type is invalid',
+               badCalendar             : '%s : %s : CalendarName is invalid',
+               missingCalendar : '%s : %s : CalendarName is missing',
+               missingTID              : '%s : %s : TransactionID is missing',
+               badAsync                : '%s : %s : Invalid async parameters',
+               noAsync                 : '%s : %s : Async not supported',
+               is_missing              : '%s : %s : %s is missing',
+               is_invalid              : '%s : %s : %s is invalid'
+       };
+               
+
+}) ();
+
diff --git a/wrt/misc/rss/preview/script/lib/sapi/Contact.js b/wrt/misc/rss/preview/script/lib/sapi/Contact.js
new file mode 100644 (file)
index 0000000..32cf5ed
--- /dev/null
@@ -0,0 +1,407 @@
+/**
+ * Contact.js
+ * 
+ * Nokia Web Runtime Service API emulation 
+ * WRT v1.1
+ * 
+ * Copyright 2009 Nokia Corporation. All rights reserved.
+*/
+
+(function(){
+       
+       var provider = 'Service.Contact' ,
+               Interface = 'IDataSource';
+
+       /**
+        * Contact service
+        */
+       var ContactService = function(){
+               this.GetList    = __GetList;
+               this.Add                = __Add;
+               this.Delete     = __Delete;
+               this.Import     = __Import;
+               this.Export     = __Export;
+               this.Organise   = __Organise;
+               this.Cancel     = __Cancel;
+       }
+
+       device.implementation.extend(provider, Interface, new ContactService() );
+
+
+       /******************************************************/        
+       /******************************************************/        
+       /******************************************************/        
+
+       var     context = device.implementation.context,
+               _t = context._t,
+               method = '',
+               result = false,
+               DBase = null;
+       
+       /**
+        * Contact: GetList
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __GetList(criteria, callback){
+
+               if ((result = validator.apply('GetList', arguments)) !== false)
+                       return result; 
+       
+               if (!/^(Contact|Group|Database)$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType);
+       
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               var returnValue = [], 
+                       match = null,
+                       filter = criteria.Filter || null;
+               DBase = context.getData(provider);
+
+               // Type = Database
+               if (/Database/i.test(criteria.Type)){
+                       returnValue = DBase.Database;
+               } 
+               // Type = Group
+               else if (/Group/i.test(criteria.Type)){
+                       // filter by id
+                       if (filter && filter.id) {
+                               returnValue = findById(DBase.Group, filter.id);
+                               if (returnValue.length == 0)
+                                       return error(device.implementation.ERR_NOT_FOUND);
+                       }
+                       // return all groups 
+                       else {
+                               returnValue = DBase.Group;
+                       }
+               }                               
+               // Type = Contact
+               else if (/Contact/i.test(criteria.Type)){
+
+                       // filter by id
+                       if (filter && filter.id) {
+                               returnValue = findById(DBase.Contact, filter.id); 
+                               if (returnValue.length == 0)
+                                       return error(device.implementation.ERR_NOT_FOUND);
+                       }
+                       // return all contacts 
+                       else {
+                               returnValue = DBase.Contact;
+                       }
+
+                       // unsupported filters 
+                       if (filter 
+                               && (match = context.keys(filter).join().match(/SearchVal|DBUri/ig)) ) {
+                               context.notify(_t('%s:: GetList : filter %s not implemented in preview').arg(provider, match.join()));
+                       }
+                       // unsupported sort                     
+                       if (criteria.Sort) { 
+                               context.notify(_t('%s:: GetList : sort not implemented in preview').arg(provider));
+                       }
+               }
+               return context.Result(context.Iterator(returnValue));
+       }
+                       
+       /**
+        * Contact: Add
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __Add(criteria, callback){
+
+               if ((result = validator.apply('Add', arguments)) !== false)
+                       return result; 
+               
+               if (!/^(Contact|Group)$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType2);
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               DBase = context.getData(provider);
+               var Data = criteria.Data,
+                       item;
+
+               // unsupported!                 
+               if (Data.DBUri) {
+                       context.notify(_t('%s:: Add : Data.DBUri not implemented in preview').arg(provider));
+               }
+
+               // Type = Group
+               if (/Group/i.test(criteria.Type)){
+
+                       if (!Data.GroupLabel)
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.missingGroupLabel);
+
+                       // update
+                       if (Data.id) {
+                               returnValue = findById(DBase.Group, Data.id); 
+                               if (returnValue.length == 0)
+                                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);
+                               
+                               returnValue[0].GroupLabel = Data.GroupLabel;
+                               //@todo: group contents!?
+                       }
+                       // new
+                       else {
+                               item = context.extend({}, Data); 
+                               item.id = String(context.getUniqueID());
+                               DBase.Group.push(item);
+                       }
+               } 
+               // Type = Contact
+               else {
+                       // update
+                       if (Data.id) {
+                               returnValue = findById(DBase.Contact, Data.id); 
+                               if (returnValue.length == 0)
+                                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);
+                               
+                               context.extend(returnValue[0], Data); 
+                       }
+                       // new
+                       else {
+                               item = context.extend({}, Data); 
+                               item.id = String(context.getUniqueID());
+                               DBase.Contact.push(item);
+                       }
+               } 
+               // return success
+               return error(device.implementation.ERR_SUCCESS);
+       }
+                       
+
+       /**
+        * Contact: Delete
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __Delete(criteria, callback){
+               
+               if ((result = validator.apply('Delete', arguments)) !== false)
+                       return result; 
+
+               if (!/^(Contact|Group)$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType2);
+
+               var Data = criteria.Data;
+               if (!Data.IdList)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingIdList);
+               if (typeof Data.IdList != 'object')
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badIdList);
+               
+               DBase = context.getData(provider);
+               var type = criteria.Type;
+
+               // unsupported!                 
+               if (Data.DBUri) {
+                       context.notify(_t('%s:: Delete : Data.DBUri not implemented in preview').arg(provider));
+               }
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               // for both Group & Contact:
+               var i,j,id,item;
+               for (j in Data.IdList) {
+                       id = Data.IdList[j];
+                       for (i in DBase[type]) {
+                               item = DBase[type][i];
+                               if (id == item.id) {
+                                       DBase[type].splice(i, 1);
+                               }
+                       }
+               }
+               // return success
+               return error(device.implementation.ERR_SUCCESS);                                
+       }
+                       
+
+       /**
+        * Contact: Import
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __Import(criteria, callback){
+
+               if ((result = validator.apply('Import', arguments)) !== false)
+                       return result; 
+
+               if (!/^(Contact)$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType3);
+
+               var Data = criteria.Data;
+               if (!Data.SourceFile)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingSourceFile);
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               context.notify(_t('%s:: Import : not implemented in preview.').arg(provider));
+               return error(device.implementation.ERR_SUCCESS);                
+       }
+                       
+
+       /**
+        * Contact: Export
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __Export(criteria, callback){
+
+               if ((result = validator.apply('Export', arguments)) !== false)
+                       return result; 
+
+               if (!/^(Contact)$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType4);
+
+               var Data = criteria.Data;
+               if (!Data.DestinationFile)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingDestinationFile);
+
+               if (!Data.id)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingId);
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               context.notify(_t('%s:: Export : not implemented in preview.').arg(provider));
+               return error(device.implementation.ERR_SUCCESS);                
+       }
+                       
+
+       /**
+        * Contact: Organise
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __Organise(criteria, callback){
+
+               if ((result = validator.apply('Organise', arguments)) !== false)
+                       return result; 
+
+               if (!/^(Group)$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.badType5);
+
+               var Data = criteria.Data;
+               if (!Data.id)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingId2);
+
+               if (!Data.IdList)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingIdList);
+
+               if (typeof Data.IdList != 'object')
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badIdList);
+
+               if (!/^(Associate|Disassociate)$/i.test(criteria.OperationType))
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badOperationType);
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               context.notify(_t('%s:: Organise : not implemented in preview.').arg(provider));
+               return error(device.implementation.ERR_SUCCESS);                
+       }
+                       
+
+       /**
+        * Contact: Cancel
+        * @param {Object} criteria
+        */
+       function __Cancel(criteria){
+               method = 'Cancel';
+               if (!criteria || !criteria.TransactionID)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.missingTID);
+               
+               clearTimeout(criteria.TransactionID);
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);
+       }
+
+       
+       /*******************************
+        * helper functions
+        *******************************/
+       
+       function error(code, msg /*, args...*/){
+
+               var args = ['Contacts',method].concat([].slice.call(arguments,2));
+               msg = msg ? _t().arg.apply(msg,args) : undefined;
+               return context.ErrorResult(code, msg);
+       }
+
+       /**
+        * validate common input arguments
+        * 'this' is string (object) name of calling function
+        * 
+        * @param {arguments} arguments of calling function
+        * @return {Result} Result object if error, false if no error.
+        */
+       function validator() {
+               method = ''+this;
+               var     failed = false,
+                       criteria = arguments[0] || false;
+                       
+               if (!criteria || typeof criteria != 'object' || typeof criteria.Type == 'undefined')
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType, method);
+
+               if (method == 'GetList') return failed;
+
+               var Data = criteria.Data || false; 
+               if (!Data)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingData, method);
+               if (typeof Data != 'object')
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.badData);
+                
+               return failed;
+       }
+
+
+       function findById(dbase, id){
+               var result = [];
+               for (var i in dbase) {
+                       if (id == dbase[i]['id']) {
+                               result.push(dbase[i]);
+                       }
+               }
+               return result;
+       }
+
+       /** 
+        * error messages
+        * order of %s args: Service name, method name, parameter name 
+        */
+       var msg = {
+               missingType             : '%s : %s : Type is Missing',
+               badType                 : '%s: %s : Invalid value for Type, Must be Contact/Group/Database',
+               badType2                : '%s : %s : Invalid Type, must be Contact/Group',
+               badType3                : '%s : %s : Invalid Type,it must be Contact',
+               badType4                : '%s : %s : Invalid Type, it must be Contact',
+               badType5                : '%s : %s : Invalid Content Type, It must be Group',
+               badOperationType: '%s : %s : Invalid Operation Type',
+               missingGroupLabel: '%s : %s : Group Label is Missing',
+               missingTID              : 'Contact : Cancel : TransactionID is missing',        // not 'Contacts'!!
+               badAsync                : '%s : %s : Invalid async parameters',
+               missingData             : '%s : %s : %s data Missing',
+               badData                 : '%s : %s : Invalid Type of Data , Map is required',
+               missingIdList   : '%s : %s : List of Ids is missing',
+               badIdList               : '%s : %s : Type of IdList is wrong, List is required',
+               missingSourceFile: '%s : %s : Import Source Filename is Missing',
+               missingDestinationFile: '%s : %s : Export Destination Filename is Missing',
+               missingId               : '%s : %s : Contact Id to be exported is missing',
+               missingId2              : '%s : %s : GroupId is missing',
+               is_missing              : '%s : %s : %s is missing',
+               is_invalid              : '%s : %s : %s is invalid'
+       };
+               
+
+}) ()
+
diff --git a/wrt/misc/rss/preview/script/lib/sapi/Landmarks.js b/wrt/misc/rss/preview/script/lib/sapi/Landmarks.js
new file mode 100644 (file)
index 0000000..991dea3
--- /dev/null
@@ -0,0 +1,556 @@
+/**\r
+ * Landmarks.js\r
+ * \r
+ * Nokia Web Runtime Service API emulation \r
+ * WRT v1.1\r
+ * \r
+ * Copyright 2009 Nokia Corporation. All rights reserved.\r
+*/\r
+\r
\r
+(function(){\r
+       \r
+       var provider = 'Service.Landmarks',\r
+               Interface = 'IDataSource';\r
+\r
+       /**\r
+        * Landmark service\r
+        */\r
+       var LandmarkService = function(){\r
+               this.New                = __New;\r
+               this.GetList    = __GetList;\r
+               this.Add                = __Add;\r
+               this.Delete             = __Delete;             \r
+               this.Import     = __Import;\r
+               this.Export             = __Export;\r
+               this.Organise   = __Organise;\r
+               this.Cancel             = __Cancel;                             \r
+       }\r
+\r
+       device.implementation.extend(provider, Interface, new LandmarkService() );\r
+\r
+\r
+       /******************************************************/        \r
+       /******************************************************/        \r
+       /******************************************************/        \r
+\r
+       var     context = device.implementation.context,\r
+               _t = context._t,\r
+               method = '',\r
+               result = false,\r
+               DBase = null;\r
+\r
+       /**\r
+        * Landmarks: New\r
+        * @param {Object} criteria\r
+        */\r
+       function __New(criteria){\r
+               if ((result = validator.apply('New', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (typeof criteria.Type == 'undefined') \r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);\r
+\r
+               if (!/^(Landmark|Category)$/i.test(criteria.Type)) \r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);          \r
+               \r
+               var returnValue;\r
+               \r
+               if(criteria.Type == 'Landmark')\r
+               {\r
+                       returnValue = {\r
+                               'LandmarkName'          : '',\r
+                               'id'                            : '',\r
+                               'CategoryInfo'          : '',\r
+                               'LandmarkDesc'          : '',\r
+                               'LandmarkPosition'      : {\r
+                                                                               'Latitude'      : '',\r
+                                                                               'Longitude' : '',\r
+                                                                               'Altitude'      : '',\r
+                                                                               'HAccuracy' : '',\r
+                                                                               'VAccuracy' : '',\r
+                                                                               'VAccuracy' : ''\r
+                                                                         },\r
+                               'CoverageRadius'        : '',\r
+                               'IconFile'                      : '',\r
+                               'IconIndex'                     : '',\r
+                               'IconMaskIndex'         : '',\r
+                               'LandmarkFields'        : {\r
+                                                                               'Street'                : '',\r
+                                                                               'BuildingName'  : '',\r
+                                                                               'District'              : '',\r
+                                                                               'City'                  : '',\r
+                                                                               'AreaCode'              : '',\r
+                                                                               'Telephone'             : '',\r
+                                                                               'Country'               : ''\r
+                                                                         }\r
+                       };\r
+               }\r
+               else //Category\r
+               {\r
+                       returnValue = {\r
+                               'CategoryName'  : '',\r
+                               'id'                    : '',\r
+                               'GlobalId'              : '',\r
+                               'IconFile'              : '',\r
+                               'IconIndex'             : '',\r
+                               'IconMaskIndex' : ''\r
+                       };\r
+               }\r
+\r
+               return context.Result(returnValue);\r
+       }\r
+       \r
+       /**\r
+        * Landmarks: GetList\r
+        * @param {Object} criteria\r
+        * @param {Function} [callback] function for async call (optional)\r
+        */\r
+       function __GetList(criteria, callback){\r
+               \r
+               if ((result = validator.apply('GetList', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (typeof criteria.Type == 'undefined') \r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);\r
+\r
+               if (!/^(Landmark|Category|Database)$/i.test(criteria.Type)) \r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);\r
+\r
+               if (criteria.Filter)\r
+                       context.notify(_t('%s:: GetList : filter not implemented in preview').arg(provider));\r
+\r
+               if(criteria.Sort)\r
+                       context.notify(_t('%s:: GetList : Sort is not implemented in preview').arg(provider));\r
+\r
+               if (typeof callback == 'function') {\r
+                       return context.callAsync(this, arguments.callee, criteria, callback);\r
+               }\r
+               \r
+               var returnValue = [], \r
+                       match = null,\r
+                       filter = criteria.Filter || null;\r
\r
+               DBase = context.getData(provider);\r
+\r
+\r
+               if (/Database/i.test(criteria.Type)) {                          // Type = Database\r
+                       \r
+                       returnValue = context.Iterator( DBase.Database || [] );\r
+                       \r
+               } else if (/Landmark/i.test(criteria.Type)){            // Type = Landmark\r
+                       \r
+                       returnValue = context.Iterator( DBase[criteria.Type] || [] );\r
+                       \r
+               } else {                                                                                        // Type = Category\r
+               \r
+                       // @todo: apply filter criteria\r
+                       returnValue = context.Iterator( DBase[criteria.Type] || [] );\r
+               }\r
+               return context.Result(returnValue);\r
+       }\r
+\r
+       /**\r
+        * Landmarks: Add\r
+        * @param {Object} criteria\r
+        */\r
+       function __Add(criteria){\r
+               \r
+               if ((result = validator.apply('Add', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (!/^(Landmark|Category)$/i.test(criteria.Type))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);\r
+\r
+\r
+               var Data = criteria.Data || false; \r
+               if(!Data){\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingData);\r
+               }\r
+\r
+               DBase = context.getData(provider);\r
+               \r
+               // unsupported!                 \r
+               if (Data.DatabaseURI) {\r
+                       context.notify(_t('%s:: Add : Data.DatabaseURI not implemented in preview').arg(provider));\r
+               }\r
+               \r
+               var item;\r
+               \r
+               // Type = Landmark\r
+               if (/Landmark/i.test(criteria.Type)){\r
+\r
+                        if (!Data.LandmarkName)\r
+                               Data.LandmarkName="";\r
+                       \r
+                       var landmarkPos = Data.LandmarkPosition;\r
+                       if (typeof landmarkPos != 'undefined') {\r
+                               if ((typeof landmarkPos.Latitude == 'undefined' || typeof landmarkPos.Latitude != 'number') &&\r
+                                       (typeof landmarkPos.Longitude == 'undefined' || typeof landmarkPos.Longitude != 'number') &&\r
+                                       (typeof landmarkPos.Altitude == 'undefined' || typeof landmarkPos.Altitude != 'number') &&\r
+                                       (typeof landmarkPos.HAccuracy == 'undefined' || typeof landmarkPos.HAccuracy != 'number') &&\r
+                                       (typeof landmarkPos.VAccuracy == 'undefined' || typeof landmarkPos.VAccuracy != 'number')) {\r
+                                               \r
+                                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType);\r
+                               }\r
+                       }\r
+                       // update\r
+                       if (typeof Data.id != 'undefined') {\r
+                               if(typeof Data.id != 'string')\r
+                                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.invalidId);\r
+                               \r
+                               var retIndex = findById(DBase.Landmark, Data.id); \r
+                               if (retIndex == -1)\r
+                                       return error(device.implementation.ERR_NOT_FOUND);\r
+                               DBase.Landmark[retIndex] = Data;\r
+                               item = Data;\r
+                       }\r
+                       // new\r
+                       else {\r
+                               item = context.extend({}, Data); \r
+                               item.id = String(context.getUniqueID());\r
+                               DBase.Landmark.push(item);\r
+                       }\r
+               } else { // Type = Category\r
+//                     alert(typeof Data.CategoryName);\r
+\r
+                       //alert("Data.id : "+Data.id);\r
+                       // update\r
+                       if (typeof Data.id != 'undefined') {\r
+                               if(typeof Data.id != 'string')\r
+                                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.invalidId);\r
+       \r
+                               var retIndex = findById(DBase.Category, Data.id); \r
+                               if (retIndex == -1)\r
+                                       return error(device.implementation.ERR_NOT_FOUND);\r
+\r
+                               DBase.Category[retIndex] = Data;                                        \r
+                               item = Data;\r
+                       }\r
+                       // new\r
+                       else {\r
+                               if (typeof Data.CategoryName == 'undefined')\r
+                                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingCategoryName);      \r
+       \r
+                               if(typeof Data.CategoryName != 'string' || Data.CategoryName.length <= 0)\r
+                                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType);\r
+\r
+                               var retIndex = findByName(DBase.Category, Data.CategoryName); \r
+                               if (retIndex !=  -1)\r
+                                       return error(device.implementation.ERR_ENTRY_EXISTS);\r
+                                       \r
+                               item = context.extend({}, Data); \r
+                               item.id = String(context.getUniqueID());\r
+                               DBase.Category.push(item);\r
+                       }\r
+               } \r
+               // return success\r
+               return context.Result(item.id, device.implementation.ERR_SUCCESS);\r
+       }\r
+                       \r
+       /**\r
+        * Landmarks: Delete\r
+        * @param {Object} criteria\r
+        */\r
+       function __Delete(criteria){\r
+\r
+               if ((result = validator.apply('Delete', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (!/^(Landmark|Category)$/i.test(criteria.Type))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);\r
+\r
+               var Data = criteria.Data || false; \r
+               if(!Data){\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.missingData);\r
+               }\r
+\r
+               if (typeof Data.id == 'undefined') {\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingId);\r
+                       }\r
+\r
+               if (typeof Data.id != 'undefined' && typeof Data.id != 'string') {\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.invalidId);\r
+               }\r
+               if(Data.id.length <= 0 )\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.invalidId);\r
+                       \r
+               DBase = context.getData(provider);\r
+               \r
+               var type = criteria.Type;\r
+\r
+               // unsupported!                 \r
+               if (Data.DBUri) {\r
+                       context.notify(_t('%s:: Delete : Data.DBUri not implemented in preview').arg(provider));\r
+               }\r
+\r
+               // for both Landmark & Category:\r
+               var i,item;\r
+\r
+               for (i in DBase[type]) {\r
+                       item = DBase[type][i];\r
+                       if (Data.id == item.id) {\r
+                               DBase[type].splice(i, 1);\r
+                       }\r
+               }\r
+\r
+               // return success\r
+               return error(device.implementation.ERR_SUCCESS);                                \r
+       }\r
+               \r
+       /**\r
+        * Landmarks: Import\r
+        * @param {Object} criteria\r
+        */\r
+       function __Import(criteria){\r
+               \r
+               if ((result = validator.apply('Import', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (!/^(Landmark)$/i.test(criteria.Type))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);\r
+\r
+               context.notify(_t('%s:: Import : not implemented in preview.').arg(provider));\r
+\r
+               var Data = criteria.Data || false; \r
+               if(!Data)\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.missingData);\r
+\r
+               if (!Data.SourceFile)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingSourceFile);\r
+\r
+               if (!Data.MimeType)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingMimeType);\r
+\r
+               if (!/^(application\/vnd.nokia.landmarkcollection\+xml|application\/vnd.nokia.landmark\+wbxml)$/i.test(Data.MimeType))\r
+                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.invalidMime);\r
+\r
+               return error(device.implementation.ERR_SUCCESS);                \r
+       }\r
+                       \r
+\r
+       /**\r
+        * Landmarks: Export\r
+        * @param {Object} criteria\r
+        */\r
+       function __Export(criteria){\r
+\r
+               if ((result = validator.apply('Export', arguments)) !== false)\r
+                       return result; \r
+\r
+               context.notify(_t('%s:: Export : not implemented in preview.').arg(provider));\r
+               if (!/^(Landmark)$/i.test(criteria.Type))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);\r
+\r
+               var Data = criteria.Data || false; \r
+               if(!Data){\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.missingData);\r
+               }\r
+\r
+               if (!Data.DestinationFile)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingDestFile);\r
+                       \r
+               if (!Data.MimeType)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingMimeType);\r
+\r
+               if (!Data.IdList)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingIdList);\r
+\r
+               return error(device.implementation.ERR_SUCCESS);                \r
+       }\r
+                       \r
+\r
+       /**\r
+        * Landmarks: Organise\r
+        * @param {Object} criteria\r
+        */\r
+       function __Organise(criteria){\r
+\r
+               if ((result = validator.apply('Organise', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (!/^(Landmark)$/i.test(criteria.Type))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);\r
+\r
+               var Data = criteria.Data || false; \r
+               if(!Data){\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.missingData);\r
+               }\r
+\r
+               if (!Data.id || Data.id == "")\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.invalidId);\r
+               \r
+               DBase = context.getData(provider);\r
+               var categories = DBase['Category'];\r
+               var landmarks  = DBase['Landmark'];\r
+               var found = false;\r
+               \r
+               \r
+               for(var i=0;i<categories.length;i++)\r
+               {\r
+                       var category = categories[i];\r
+                       if (category.id == Data.id) {\r
+                               found = true;\r
+                               break;\r
+                       }\r
+               }\r
+               if(!found)\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.invalidId);\r
+\r
+               try{\r
+                       if(!Data.IdList || Data.IdList.length <=0)\r
+                       {\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.invalidId);\r
+                       }\r
+               }catch(e){\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.invalidId);\r
+               }\r
+               \r
+               if (!/^(Associate|Disassociate)$/i.test(criteria.OperationType))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.invalidOpType);\r
+               \r
+               context.notify(_t('%s:: Organise : not implemented in preview.').arg(provider));\r
+               if(/^Associate$/i.test(criteria.OperationType))\r
+               {\r
+                       for(var i=0;i<landmarks.length;i++)\r
+                       {\r
+                               for(var j=0;j<Data.IdList.length;j++)\r
+                               {\r
+                                       if(landmarks[i] == Data.IdList[j])\r
+                                       {\r
+                                               if(!landmarks[i].CategoryInfo)\r
+                                               {\r
+                                                       landmarks[i].CategoryInfo = new Array();\r
+                                                       landmarks[i].CategoryInfo.push(Data.id);                                        \r
+                                               }\r
+                                               else{\r
+                                                       var landmark = landmarks[i];\r
+                                                       var found = false;\r
+                                                       for(var k=0;k<landmark.CategoryInfo.length;k++)\r
+                                                       {\r
+                                                               if(landmark.CategoryInfo[k] == Data.id)\r
+                                                                       found = true;\r
+                                                       }\r
+                                                       if(!found)\r
+                                                               landmark.CategoryInfo.push(Data.id);\r
+                                               }\r
+                                               \r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       for(var i=0;i<landmarks.length;i++)\r
+                       {\r
+                               for(var j=0;j<Data.IdList.length;j++)\r
+                               {\r
+                                       if(landmarks[i] == Data.IdList[j] && landmarks[i].CategoryInfo != undefined)\r
+                                       {\r
+                                               var landmark = landmarks[i];\r
+                                               for(var k=0;k<landmark.CategoryInfo.length;k++)\r
+                                               {\r
+                                                       if(landmark.CategoryInfo[k] == Data.id)\r
+                                                               landmark.CategoryInfo.splice(k,1);\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+               \r
+               return error(device.implementation.ERR_SUCCESS);                \r
+       }\r
+               \r
+\r
+       /**\r
+        * Landmarks: Cancel\r
+        * @param {Object} criteria\r
+        */\r
+       function __Cancel(criteria){\r
+               method = 'Cancel';\r
+               \r
+               if ((result = validator.apply('Cancel', arguments)) !== false)\r
+                       return result;          \r
+                       \r
+               if (!criteria.TransactionID)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingTID);\r
+               \r
+               clearTimeout(criteria.TransactionID);\r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);\r
+       }\r
+\r
+\r
+       \r
+       /*******************************\r
+        * helper functions\r
+        *******************************/\r
+       function error(code, msg /*, args...*/){\r
+\r
+               var args = ['Landmarks',method].concat([].slice.call(arguments,2));\r
+               msg = msg ? _t().arg.apply(msg,args) : undefined;\r
+               return context.ErrorResult(code, msg);\r
+       }\r
+\r
+       /**\r
+        * validate common input arguments\r
+        * 'this' is string (object) name of calling function\r
+        * \r
+        * @param {arguments} arguments of calling function\r
+        * @return {Result} Result object if error, false if no error.\r
+        */\r
+       function validator() {\r
+               method = ''+this;\r
+               var     failed = false,\r
+                       criteria = arguments[0] || false;\r
+                       \r
+               if (!criteria || typeof criteria != 'object')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);\r
+\r
+               return failed;\r
+       }\r
+       \r
+       function findById(dbase, id){\r
+               for (var i in dbase) {\r
+                       if (id == dbase[i]['id']) {\r
+                               return i;\r
+                       }\r
+               }\r
+               return -1;\r
+       }       \r
+\r
+       function findByName(dbase, name){\r
+               for (var i in dbase) {\r
+                       if (name == dbase[i]['CategoryName']) {\r
+                               return i;\r
+                       }\r
+               }\r
+               return -1;\r
+       }       \r
+\r
+\r
+       /** \r
+        * error messages\r
+        * order of %s args: Service name, method name, parameter name \r
+        */\r
+       var msg = {\r
+               missingType                     : '%s%s : Type is missing',\r
+               badType                         : '%s%s : Type is invalid',             \r
+               missingData                     : '%s%s : Type or Data is missing',\r
+               missingId                       : '%s%s : Id is missing',\r
+               invalidId                       : '%s%s : id is invalid',\r
+               missingLandmarkName     : '%s%s : Landmrak name Missing',\r
+               missingCategoryName     : '%s%s : CategoryName is missing',\r
+               missingSourceFile       : '%s%s : Import Source Filename is Missing',\r
+               missingMimeType         : '%s%s : MIME type for source file is Missing',\r
+               missingDestFile         : '%s%s : DestinationFile is missing',\r
+               invalidOpType           : '%s%s : OperationType is invalid',\r
+               missingIdList           : '%s%s : Id list is Missing',\r
+               missingTID                      : '%s%s : TransactionID is missing',\r
+               invalidMime                     : '%s%s : MimeType is missing',\r
+               msgNoMsg                        : '',\r
+               \r
+       };\r
+               \r
+\r
+}) ()\r
+\r
diff --git a/wrt/misc/rss/preview/script/lib/sapi/Location.js b/wrt/misc/rss/preview/script/lib/sapi/Location.js
new file mode 100644 (file)
index 0000000..99e1886
--- /dev/null
@@ -0,0 +1,523 @@
+/**\r
+ * Location.js\r
+ * \r
+ * Nokia Web Runtime Service API emulation \r
+ * WRT v1.1\r
+ * \r
+ * Copyright 2009 Nokia Corporation. All rights reserved.\r
+*/\r
+\r
\r
+(function(){\r
+       \r
+       var provider = 'Service.Location',\r
+               Interface = 'ILocation';\r
+\r
+       /**\r
+        * Landmark service\r
+        */\r
+       var LocationService = function(){\r
+               this.GetLocation                        = __GetLocation;\r
+               this.Trace                                      = __Trace;\r
+               this.Calculate                          = __Calculate;\r
+               this.CancelNotification         = __CancelNotification;         \r
+       }\r
+\r
+       device.implementation.extend(provider, Interface, new LocationService() );\r
+\r
+\r
+       /******************************************************/        \r
+       /******************************************************/        \r
+       /******************************************************/        \r
+\r
+       var     context = device.implementation.context,\r
+               _t = context._t,\r
+               method = '',\r
+               result = false,\r
+               DBase = null;\r
+\r
+\r
+       var transactionIds = new Array();\r
+       var tTransactionId = -1;\r
+       var isTraceInProgress = false;\r
+       var criteriaTrace;\r
+       var callbackTrace;\r
+\r
+       /**\r
+        * Landmarks: GetLocation\r
+        * @param {Object} criteria\r
+        */\r
+       function __GetLocation(criteria, callback, flag){       \r
+               method = "GetLocation";\r
+               //      Async call\r
+               flag = flag || false;\r
+\r
+               if (!criteria) {\r
+                       criteria = new Object();\r
+               }       \r
+               \r
+               if(typeof criteria.LocationInformationClass == "undefined")\r
+                       criteria.LocationInformationClass = "BasicLocationInformation"; // Default value of LocationInformationClass is "BasicLocationInformation" if not provided\r
+\r
+               var result = validateArgument('GetLocation',criteria);\r
+               if(result.ErrorCode != 0)\r
+                       return result;\r
+               \r
+               if (typeof callback == 'function') {\r
+                       \r
+                       var retVal = context.callAsync(this, arguments.callee, criteria, callback,true);\r
+                       transactionIds.push(retVal.TransactionID);  // all transaction ids are pushed on this variable, because CancelNotification function of SAPI doesn't take TransactioID as input\r
+                       return retVal;\r
+               }\r
+               \r
+               if(flag)\r
+               {\r
+                       transactionIds.shift();  // Remove oldest TransactionID(FIFO) (Async call)\r
+               }\r
+               \r
+               DBase = context.getData(provider);\r
+               var returnValue = DBase[criteria.LocationInformationClass];\r
+               locationNotify(criteria.Updateoptions);\r
+               return context.Result(returnValue);\r
+       }\r
+       \r
+       /**\r
+        * Location: Trace\r
+        * @param {Object} criteria\r
+        * @param {Function} callback function for async call\r
+        */\r
+       function __Trace(criteria, callback){\r
+               method = "Trace";\r
+\r
+               if (!criteria) {\r
+                       criteria = new Object();\r
+               }       \r
+               \r
+               if(typeof criteria.LocationInformationClass == "undefined")\r
+                       criteria.LocationInformationClass = "BasicLocationInformation"; // Default value of LocationInformationClass is "BasicLocationInformation" if not provided\r
+\r
+               if (typeof callback != 'function') { // callback should be valid function\r
+                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED,msg.msgCommandNotFound); \r
+               }\r
+               \r
+               var result = validateArgument('Trace',criteria);\r
+               if(result.ErrorCode != 0)\r
+                       return result;\r
+               \r
+               criteriaTrace = criteria;\r
+               callbackTrace = callback;\r
+               isTraceInProgress = true;\r
+               locationNotify(criteria.Updateoptions);\r
+\r
+               return traceCall(criteria,callback);\r
+       }\r
+\r
+       /**\r
+        * Location: Calculate\r
+        * @param {Object} criteria\r
+        */\r
+       function __Calculate(criteria){\r
+               method = "Calculate";\r
+               if(!criteria || !criteria.MathRequest)\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcMissingMathReq);\r
+                       \r
+               if(typeof criteria.MathRequest != "string" || (criteria.MathRequest != "FindDistance" && criteria.MathRequest != "FindBearingTo" && criteria.MathRequest != "MoveCoordinates")) // Error check for wrong MathRequest criteria\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcWrongTypeMathReq);\r
+                       \r
+               if(typeof criteria.DistanceParamSource != "object" || (typeof criteria.DistanceParamSource.Latitude != "number" || typeof criteria.DistanceParamSource.Longitude != "number" || typeof criteria.DistanceParamSource.Altitude != "number"))\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcMissingArgLocCord);\r
+\r
+               if(criteria.MathRequest == "FindDistance" || criteria.MathRequest == "FindBearingTo")\r
+               {\r
+                       if(typeof criteria.DistanceParamSource != "object" || (typeof criteria.DistanceParamDestination.Latitude != "number" || typeof criteria.DistanceParamDestination.Longitude != "number" || typeof criteria.DistanceParamDestination.Altitude != "number"))\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcMissingArgLocCord);\r
+                       if (criteria.MathRequest == "FindDistance") {\r
+                               var dist = LatLon.distHaversine(criteria.DistanceParamDestination.Latitude, criteria.DistanceParamDestination.Longitude, criteria.DistanceParamSource.Latitude, criteria.DistanceParamSource.Longitude)*1000;\r
+                               if (typeof criteria.DistanceParamDestination.Altitude == "number" && typeof criteria.DistanceParamSource.Altitude == "number") {\r
+                                       var delta = criteria.DistanceParamDestination.Altitude - criteria.DistanceParamSource.Altitude\r
+                                       dist = Math.sqrt(dist * dist + delta * delta);\r
+                               }\r
+                               return context.Result(dist);\r
+                       }\r
+                       else if (criteria.MathRequest == "FindBearingTo"){\r
+                               var bearing = LatLon.bearing( criteria.DistanceParamSource.Latitude, criteria.DistanceParamSource.Longitude,criteria.DistanceParamDestination.Latitude, criteria.DistanceParamDestination.Longitude);\r
+                               return context.Result(bearing);                         \r
+                       }\r
+               }\r
+               else if(criteria.MathRequest == "MoveCoordinates"){\r
+\r
+                       if(typeof criteria.MoveByThisDistance == "undefined")\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcMissingArgMoveDist);\r
+                       \r
+                       if(typeof criteria.MoveByThisBearing == "undefined")\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcMissingArgMoveBear);\r
+                       \r
+\r
+                       if(typeof criteria.MoveByThisDistance != "number")\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcWrongTypeMoveDist);\r
+                       \r
+                       if(typeof criteria.MoveByThisBearing != "number")\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcWrongTypeMoveBear);\r
+                       \r
+                       var latLon = new LatLon(criteria.DistanceParamSource.Latitude, criteria.DistanceParamSource.Longitude);\r
+                       var dlatLon = latLon.destPoint(criteria.MoveByThisBearing, criteria.MoveByThisDistance/1000);\r
+                       var retVal = new Object();\r
+                       retVal.Longitude = dlatLon.lon;\r
+                       retVal.Latitude = dlatLon.lat;\r
+                       retVal.Altitude = criteria.DistanceParamSource.Altitude;\r
+                       return context.Result(retVal);\r
+               }\r
+       }\r
+                       \r
+       /**\r
+        * Location: CancelNotification\r
+        * @param {Object} criteria\r
+        */\r
+       function __CancelNotification(criteria){\r
+               method = "Cancel";\r
+               if(!criteria)\r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT,msg.msgCancelMissingType);\r
+               \r
+               var arr = new Array();\r
+               var i = 0;\r
+               var key\r
+               for(key in criteria);\r
+                       arr[i++] = key;\r
+\r
+               if(!criteria.CancelRequestType && arr.length)\r
+                               return error(device.implementation.ERR_NOT_FOUND,msg.msgCancelMissingType);\r
+               \r
+               if(criteria.CancelRequestType != "GetLocCancel" && criteria.CancelRequestType != "TraceCancel")\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCancelWrongType);\r
+               \r
+               if (criteria.CancelRequestType == "GetLocCancel") {\r
+                       for (var i = 0; i < transactionIds.length; i++) {\r
+                               clearTimeout(transactionIds[i])\r
+                       }\r
+               }\r
+               \r
+               if (criteria.CancelRequestType == "TraceCancel")\r
+               {\r
+                       isTraceInProgress = false;\r
+                       tTransactionId = -1;\r
+               }\r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);\r
+       }\r
+               \r
+\r
+\r
+       \r
+       /*******************************\r
+        * helper functions\r
+        *******************************/\r
+\r
+       /**\r
+        * Location: traceCall\r
+        * @param {} \r
+        * This function emulates repetitive trace calls,It calls specified callback function after every UpdateInterval untill \r
+        * CancelNotification is called\r
+        */\r
+       function traceCall(){\r
+               var tid = setTimeout(function(){\r
+               if(!isTraceInProgress)\r
+                       return;\r
+                       \r
+               DBase = context.getData(provider);\r
+               var returnValue = DBase[criteriaTrace.LocationInformationClass];\r
+               var result,\r
+                       eventCode = {completed:2, error:4, progress:9},\r
+               code = eventCode.completed;\r
+\r
+               callbackTrace(tTransactionId,code,context.Result(returnValue,0));\r
+               traceCall();\r
+               }, criteriaTrace.Updateoptions.UpdateInterval/1000);\r
+               if(tTransactionId == -1)\r
+                       tTransactionId = tid;\r
+               return context.AsyncResult(tTransactionId);\r
+       }\r
+\r
+       /**\r
+        * Location: validateArgument\r
+        * @param {string,object} callingMethod and criteria\r
+        * Validates arguments\r
+        */\r
+       function validateArgument(fun,criteria)\r
+       {\r
+               method = fun;\r
+               if(typeof criteria.Updateoptions != "undefined")\r
+               {\r
+                       if(typeof criteria.Updateoptions != "object") // Checking for error in UpdateOptions criteria\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationBadArg);\r
+                       \r
+                       if(typeof criteria.Updateoptions.UpdateInterval != "undefined" && typeof criteria.Updateoptions.UpdateInterval != "number")\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationWrongType);\r
+                       \r
+                       if(typeof criteria.Updateoptions.UpdateTimeOut != "undefined" && typeof criteria.Updateoptions.UpdateTimeOut != "number")       \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationWrongType);\r
+\r
+                       if(typeof criteria.Updateoptions.UpdateMaxAge != "undefined" && typeof criteria.Updateoptions.UpdateMaxAge != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationWrongType);\r
+\r
+                       if(typeof criteria.Updateoptions.PartialUpdates != "undefined" && typeof criteria.Updateoptions.PartialUpdates != "boolean")    \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationWrongType);\r
+\r
+                       if((typeof criteria.Updateoptions.UpdateInterval != "undefined" && criteria.Updateoptions.UpdateInterval  < 0) || \r
+                                       (typeof criteria.Updateoptions.UpdateTimeOut != "undefined" && criteria.Updateoptions.UpdateTimeOut  < 0) ||\r
+                                       (typeof criteria.Updateoptions.UpdateMaxAge != "undefined" && criteria.Updateoptions.UpdateMaxAge  < 0))\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationNegInt);\r
+\r
+                       if(typeof criteria.Updateoptions.UpdateTimeOut != "undefined" && typeof criteria.Updateoptions.UpdateInterval != "undefined" && criteria.Updateoptions.UpdateInterval > criteria.Updateoptions.UpdateTimeOut)\r
+                       {\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgNone);\r
+                       }\r
+\r
+                       /*if((typeof criteria.Updateoptions.UpdateTimeOut != "undefined" && criteria.Updateoptions.UpdateTimeOut <= 1000000))// || (typeof criteria.Updateoptions.UpdateInterval != "undefined" && criteria.Updateoptions.UpdateInterval <= 1000000))\r
+                       {\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgNone);\r
+                       }*/                             \r
+               }\r
+\r
+               if(typeof criteria.LocationInformationClass != "undefined" && criteria.LocationInformationClass != "BasicLocationInformation" && criteria.LocationInformationClass != "GenericLocationInfo") // checking for errors in LocationInformationClass criteria\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationWrongCat);\r
+               \r
+               if (/^Trace$/i.test(fun)&&(!criteria.Updateoptions || typeof criteria.Updateoptions.UpdateInterval == "undefined")) {\r
+                       if(!criteria.Updateoptions)\r
+                       {\r
+                               criteria.Updateoptions = new Object();\r
+                       }\r
+                       criteria.Updateoptions.UpdateInterval = 1000000;  // Emulation only!! for convenience UpdateInterval is set to 1 second is not specified or if it less than 1 second\r
+                       context.notify("Using default UpdateInterval(1000000 micro seconds)"); \r
+               }\r
+               \r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS, "");\r
+               \r
+       }\r
+\r
+       /**\r
+        * Location: error\r
+        * @param {number,string} ErrorCode and ErrorString\r
+        * Replaces Error String with method name\r
+        */\r
+       function error(code, msg /*, args...*/){\r
+\r
+               var args = ['location',method].concat([].slice.call(arguments,2));\r
+               msg = msg ? _t().arg.apply(msg,args) : undefined;\r
+               return context.ErrorResult(code, msg);\r
+       }\r
+       \r
+       function locationNotify(updateoptions) {\r
+               if(!updateoptions)\r
+                       return;\r
+               if(typeof updateoptions.UpdateTimeOut != "undefined")\r
+                       context.notify(_t("%s:: %s : Updateoptions.UpdateTimeOut not implemented in preview").arg(provider, method));\r
+\r
+               if(typeof updateoptions.UpdateMaxAge != "undefined")\r
+                       context.notify(_t("%s:: %s : Updateoptions.UpdateMaxAge not implemented in preview").arg(provider, method));\r
+\r
+               if(typeof updateoptions.PartialUpdates != "undefined")\r
+                       context.notify(_t("%s:: %s : Updateoptions.PartialUpdates not implemented in preview").arg(provider, method));\r
+       }\r
+\r
+       /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */\r
+       /*  Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2009            */\r
+       /*      http://www.movable-type.co.uk/scripts/latlong.html                                                                                        */  \r
+       /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */\r
+       \r
+       /*\r
+        * Use Haversine formula to Calculate distance (in km) between two points specified by \r
+        * latitude/longitude (in numeric degrees)\r
+        *\r
+        * example usage from form:\r
+        *   result.value = LatLon.distHaversine(lat1.value.parseDeg(), long1.value.parseDeg(), \r
+        *                                       lat2.value.parseDeg(), long2.value.parseDeg());\r
+        * where lat1, long1, lat2, long2, and result are form fields\r
+        */\r
+       \r
+       \r
+       LatLon.distHaversine = function(lat1, lon1, lat2, lon2) {\r
+         var R = 6371; // earth's mean radius in km\r
+         var dLat = toRad(lat2-lat1);\r
+         var dLon = toRad(lon2-lon1);\r
+         lat1 = toRad(lat1), lat2 = toRad(lat2);\r
+       \r
+         var a = Math.sin(dLat/2) * Math.sin(dLat/2) +\r
+                 Math.cos(lat1) * Math.cos(lat2) * \r
+                 Math.sin(dLon/2) * Math.sin(dLon/2);\r
+         var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\r
+         var d = R * c;\r
+         return d;\r
+       }\r
+       \r
+       \r
+       /*\r
+        * ditto using Law of Cosines\r
+        */\r
+       LatLon.distCosineLaw = function(lat1, lon1, lat2, lon2) {\r
+         var R = 6371; // earth's mean radius in km\r
+         var d = Math.acos(Math.sin(toRad(lat1))*Math.sin(toRad(lat2)) +\r
+                           Math.cos(toRad(lat1))*Math.cos(toRad(lat2))*Math.cos(toRad(lon2-lon1))) * R;\r
+         return d;\r
+       }\r
+       \r
+       \r
+       /*\r
+        * calculate (initial) bearing between two points\r
+        *   see http://williams.best.vwh.net/avform.htm#Crs\r
+        */\r
+       LatLon.bearing = function(lat1, lon1, lat2, lon2) {\r
+         lat1 = toRad(lat1); lat2 = toRad(lat2);\r
+         var dLon = toRad(lon2-lon1);\r
+\r
+         var y = Math.sin(dLon) * Math.cos(lat2);\r
+         var x = Math.cos(lat1)*Math.sin(lat2) -\r
+                 Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon);\r
+         return toBrng(Math.atan2(y, x));\r
+       }\r
+       \r
+       \r
+       /*\r
+        * calculate destination point given start point, initial bearing (deg) and distance (km)\r
+        *   see http://williams.best.vwh.net/avform.htm#LL\r
+        */\r
+       LatLon.prototype.destPoint = function(brng, d) {\r
+         var R = 6371; // earth's mean radius in km\r
+         var lat1 = toRad(this.lat), lon1 = toRad(this.lon);\r
+         brng = toRad(brng);\r
+       \r
+         var lat2 = Math.asin( Math.sin(lat1)*Math.cos(d/R) + \r
+                               Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng) );\r
+         var lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1), \r
+                                      Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2));\r
+         lon2 = (lon2+Math.PI)%(2*Math.PI) - Math.PI;  // normalise to -180...+180\r
+       \r
+         if (isNaN(lat2) || isNaN(lon2)) return null;\r
+         return new LatLon(toDeg(lat2), toDeg(lon2));\r
+       }\r
+       \r
+       \r
+       /*\r
+        * construct a LatLon object: arguments in numeric degrees\r
+        *\r
+        * note all LatLong methods expect & return numeric degrees (for lat/long & for bearings)\r
+        */\r
+       function LatLon(lat, lon) {\r
+         this.lat = lat;\r
+         this.lon = lon;\r
+       }\r
+       \r
+       \r
+       /*\r
+        * represent point {lat, lon} in standard representation\r
+        */\r
+       LatLon.prototype.toString = function() {\r
+         return this.lat.toLat() + ', ' + this.lon.toLon();\r
+       }\r
+       \r
+       /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */\r
+       \r
+       // extend String object with method for parsing degrees or lat/long values to numeric degrees\r
+       //\r
+       // this is very flexible on formats, allowing signed decimal degrees, or deg-min-sec suffixed by \r
+       // compass direction (NSEW). A variety of separators are accepted (eg 3º 37' 09"W) or fixed-width \r
+       // format without separators (eg 0033709W). Seconds and minutes may be omitted. (Minimal validation \r
+       // is done).\r
+       \r
+       function parseDeg (str) {\r
+         if (!isNaN(str)) return Number(str);                 // signed decimal degrees without NSEW\r
+       \r
+         var degLL = str.replace(/^-/,'').replace(/[NSEW]/i,'');  // strip off any sign or compass dir'n\r
+         var dms = degLL.split(/[^0-9.]+/);                     // split out separate d/m/s\r
+         for (var i in dms) if (dms[i]=='') dms.splice(i,1);    // remove empty elements (see note below)\r
+         switch (dms.length) {                                  // convert to decimal degrees...\r
+           case 3:                                              // interpret 3-part result as d/m/s\r
+             var deg = dms[0]/1 + dms[1]/60 + dms[2]/3600; break;\r
+           case 2:                                              // interpret 2-part result as d/m\r
+             var deg = dms[0]/1 + dms[1]/60; break;\r
+           case 1:                                              // decimal or non-separated dddmmss\r
+             if (/[NS]/i.test(str)) degLL = '0' + degLL;       // - normalise N/S to 3-digit degrees\r
+             var deg = dms[0].slice(0,3)/1 + dms[0].slice(3,5)/60 + dms[0].slice(5)/3600; break;\r
+           default: return NaN;\r
+         }\r
+         if (/^-/.test(str) || /[WS]/i.test(str)) deg = -deg; // take '-', west and south as -ve\r
+         return deg;\r
+       }\r
+       // note: whitespace at start/end will split() into empty elements (except in IE)\r
+       \r
+       \r
+       /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */\r
+       \r
+       // extend Number object with methods for converting degrees/radians\r
+       \r
+       function toRad (deg) {  // convert degrees to radians\r
+         return deg * Math.PI / 180;\r
+       }\r
+       \r
+       function toDeg (rad) {  // convert radians to degrees (signed)\r
+         return rad * 180 / Math.PI;\r
+       }\r
+       \r
+       function toBrng (rad) {  // convert radians to degrees (as bearing: 0...360)\r
+         return (toDeg(rad)+360) % 360;\r
+       }\r
+       \r
+       \r
+       /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */\r
+       \r
+       // extend Number object with methods for presenting bearings & lat/longs\r
+       \r
+       function toDMS (num) {  // convert numeric degrees to deg/min/sec\r
+         var d = Math.abs(num);  // (unsigned result ready for appending compass dir'n)\r
+         d += 1/7200;  // add ½ second for rounding\r
+         var deg = Math.floor(d);\r
+         var min = Math.floor((d-deg)*60);\r
+         var sec = Math.floor((d-deg-min/60)*3600);\r
+         // add leading zeros if required\r
+         if (deg<100) deg = '0' + deg; if (deg<10) deg = '0' + deg;\r
+         if (min<10) min = '0' + min;\r
+         if (sec<10) sec = '0' + sec;\r
+         return deg + '\u00B0' + min + '\u2032' + sec + '\u2033';\r
+       }\r
+       \r
+       function toLat (deg) {  // convert numeric degrees to deg/min/sec latitude\r
+         return toDMS(deg).slice(1) + (deg<0 ? 'S' : 'N');  // knock off initial '0' for lat!\r
+       }\r
+       \r
+       function toLon (deg) {  // convert numeric degrees to deg/min/sec longitude\r
+         return toDMS(deg) + (deg>0 ? 'E' : 'W');\r
+       }\r
+       \r
+       function toPrecision (num,fig) {  // override toPrecision method with one which displays \r
+         if (num == 0) return 0;                      // trailing zeros in place of exponential notation\r
+         var scale = Math.ceil(Math.log(num)*Math.LOG10E);\r
+         var mult = Math.pow(10, fig-scale);\r
+         return Math.round(num*mult)/mult;\r
+       }\r
+\r
+\r
+       /** \r
+        * error messages\r
+        * order of %s args: Service name, method name, parameter name \r
+        */\r
+       var msg = {\r
+               msgCommandNotFound                      : '%s : Command Not found',\r
+               msgGetLocationWrongCat          : '%s : %s : wrong category info should be BasicLocationInformation/GenericLocationInfo ',\r
+               msgGetLocationBadArg            : '%s : %s : BadArgument - Updateoptions',\r
+               msgGetLocationNegInt            : '%s : %s : Negative Time Interval',\r
+               msgGetLocationWrongType         : '%s : %s : UpdateOptions Type mismatch',\r
+               msgTraceWrongCat                        : '%s : %s : Invalid LocationInformationClass',\r
+               msgCalcMissingMathReq           : '%s : %s : Missing argument - MathRequest',\r
+               msgCalcWrongTypeMathReq         : '%s : %s : Wrong argument - MathRequest',\r
+               msgCalcMissingArgLocCord        : '%s : %s : Missing argument - locationcoordinate',\r
+               msgCalcMissingArgMoveDist       : '%s : %s : Missing argument - MoveByThisDistance',\r
+               msgCalcMissingArgMoveBear       : '%s : %s : Missing argument - MoveByThisBearing',\r
+               msgCalcWrongTypeMoveDist        : '%s : %s : TypeMismatch - MoveByThisDistance',\r
+               msgCalcWrongTypeMoveBear        : '%s : %s : TypeMismatch - MoveByThisBearing',\r
+               msgCancelBadArg                         : '%s : %s : BadArgument – cancel type',\r
+               msgCancelMissingType            : '%s : %s : Missing cancel type',\r
+               msgCancelWrongType                      : '%s : %s : Wrong cancel type' ,\r
+               msgNone                                         : ''    \r
+       };\r
+               \r
+\r
+}) ()\r
+\r
diff --git a/wrt/misc/rss/preview/script/lib/sapi/Logging.js b/wrt/misc/rss/preview/script/lib/sapi/Logging.js
new file mode 100644 (file)
index 0000000..d3589e8
--- /dev/null
@@ -0,0 +1,535 @@
+/**\r
+ * Logging.js\r
+ * \r
+ * Nokia Web Runtime Service API emulation \r
+ * WRT v1.1\r
+ * \r
+ * Copyright 2009 Nokia Corporation. All rights reserved.\r
+*/\r
+\r
\r
+(function(){\r
+       \r
+       var provider = 'Service.Logging',\r
+               Interface = 'IDataSource';\r
+\r
+       /**\r
+        * Landmark service\r
+        */\r
+       var LoggingService = function(){\r
+               this.Add                                        = __Add;\r
+               this.GetList                            = __GetList;\r
+               this.Delete                                     = __Delete;\r
+               this.RequestNotification        = __RequestNotification;                \r
+               this.Cancel                                     = __Cancel;             \r
+\r
+       }\r
+\r
+       device.implementation.extend(provider, Interface, new LoggingService() );\r
+\r
+\r
+       /******************************************************/        \r
+       /******************************************************/        \r
+       /******************************************************/        \r
+\r
+       var     context = device.implementation.context,\r
+               _t = context._t,\r
+               method = '',\r
+               result = false,\r
+               DBase = null;\r
+\r
+       var transactionIds = new Array();\r
+       var tTransactionId = -1;\r
+       var isTraceInProgress = false;\r
+       var criteriaReq;\r
+       var callbackReq;\r
+\r
+       /**\r
+        * Logging: Add\r
+        * @param {Object} criteria\r
+        * @param (function) callback\r
+        */\r
+       function __Add(criteria, callback, flag){\r
+               method = "Add";\r
+               //      Async call\r
+               flag = flag || false;\r
+\r
+               if (!flag) {\r
+                       var result = ValidateAdd(criteria, callback);\r
+                       if (result.ErrorCode != 0) \r
+                               return result;\r
+               }                       \r
+               \r
+               \r
+               if(typeof callback == 'function')\r
+               {\r
+                       return context.callAsync(this, arguments.callee, criteria, callback);\r
+               }\r
+               DBase = context.getData(provider);\r
+               var returnValue = DBase[criteria.Type];\r
+               criteria.Item.id =      GenerateRandomNumber()+'';\r
+               criteria.Item["EventTime"] = GetCurrDate();\r
+               returnValue.push(criteria.Item);\r
+               return context.Result(criteria.Item.id,0);\r
+       }\r
+\r
+       /**\r
+        * Logging: GetList\r
+        * @param {Object} criteria\r
+        * @param (function) callback\r
+        */\r
+       function __GetList(criteria, callback, flag){   \r
+               method = "GetList";\r
+               //      Async call\r
+               flag = flag || false;\r
+\r
+               if (!flag) {\r
+                       var result = ValidateGetList(criteria, callback);\r
+                       if (result.ErrorCode != 0) \r
+                               return result;\r
+               }                       \r
+               \r
+               \r
+               if(typeof callback == 'function')\r
+               {\r
+                       return context.callAsync(this, arguments.callee, criteria, callback);\r
+               }\r
+               if(criteria.Filter){\r
+                       context.notify(_t('%s:: GetList : filter not implemented in preview').arg(provider));\r
+               }\r
+                               \r
+               DBase = context.getData(provider);\r
+               var returnValue;\r
+               // @todo: apply filter criteria\r
+               returnValue = context.Iterator( DBase[criteria.Type] || [] );\r
+               \r
+               return context.Result(returnValue,0);\r
+       }\r
+\r
+       /**\r
+        * Logging: Delete\r
+        * @param {Object} criteria\r
+        * @param (function) callback\r
+        */\r
+       function __Delete(criteria, callback, flag){\r
+               method = "Delete";\r
+               //      Async call\r
+               flag = flag || false;           \r
+               if (!flag) {\r
+                       if (!criteria || !criteria.Type) \r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgTypeMissing);\r
+\r
+                       if (typeof criteria.Type != 'string') \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgTypeInvalid);\r
+                       \r
+                       if (criteria.Type != 'Log') \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgTypeInvalid);\r
+                       \r
+                       if (!criteria.Data) \r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgDataMissing);\r
+                       \r
+                       if(typeof criteria.Data != 'object')\r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgDataInvalid);\r
+\r
+                       if(typeof criteria.Data.id == 'undefined')\r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgid);\r
+                       \r
+                       if (typeof criteria.Data.id != "string") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgidInvalid);\r
+                               \r
+                       if(criteria.Data.id == '')\r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgidInvalid);\r
+               }\r
+               DBase = context.getData(provider);\r
+               var returnValue,found = false;\r
+               returnValue = DBase[criteria.Type];\r
+               for(var i=0; i<returnValue.length; i++){\r
+                       if(returnValue[i].id == criteria.Data.id)\r
+                       {\r
+                               found = true;\r
+                               returnValue.splice(i,1);\r
+                       }                       \r
+               }\r
+               if(!found)\r
+                       return error(device.implementation.ERR_NOT_FOUND, msg.msgidInvalid);\r
+               \r
+               return context.Result(undefined,0);\r
+       }\r
+\r
+       /**\r
+        * Logging: RequestNotification\r
+        * @param {Object} criteria\r
+        * @param (function) callback\r
+        */\r
+       function __RequestNotification(criteria, callback, flag){\r
+               method = "RequestNotification";\r
+               \r
+               //      Async call\r
+               flag = flag || false;           \r
+               if (!flag) {\r
+                       if (!criteria || !criteria.Type) \r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgTypeMissing);\r
+\r
+                       if (typeof criteria.Type != 'string') \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgTypeInvalid);\r
+                       \r
+                       if (criteria.Type != 'Log') \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgTypeInvalid);\r
+                       \r
+                       if (!criteria.Filter)\r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgFilterMissing);\r
+\r
+                       if(typeof criteria.Filter != 'object') \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgFilterInvalid);\r
+                       \r
+                       if(typeof criteria.Filter.DelayTime == 'undefined') \r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgDelayTimeMissing);\r
+                       \r
+                       if(typeof criteria.Filter.DelayTime != 'number')\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgDelayTimeInvalid);\r
+                       if(criteria.Filter.DelayTime <= 0)\r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgDelayTimeInvalid);\r
+                       \r
+                       if(criteria.Filter.DelayTime < 1000000 )\r
+                       {\r
+                               criteria.Filter.DelayTime = 1000000;\r
+                               context.notify(_t('%s:: RequestNotification : Using DelayTime = 1000000').arg(provider));\r
+                       }\r
+               }\r
+               if(typeof callback != 'function')\r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgMissingCallback);\r
+\r
+               criteriaReq = criteria;\r
+               callbackReq = callback;\r
+               isTraceInProgress = true;\r
+\r
+               return notificationCall(criteria,callback);\r
+       }\r
+\r
+       /**\r
+        * Logging: Cancel\r
+        * @param {Object} criteria\r
+        * @param (function) callback\r
+        */\r
+       function __Cancel(criteria){\r
+                       method = "Cancel";\r
+                       if (!criteria || typeof criteria.TransactionID == 'undefined') \r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgTransactionIdMissing);\r
+                       \r
+                       if (typeof criteria.TransactionID != 'number') \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgTransactionIdInvalid);\r
+                       \r
+                       clearTimeout(criteria.TransactionID);\r
+                       if (criteria.TransactionID == tTransactionId) {\r
+                               isTraceInProgress = false;\r
+                               tTransactionId = -1;\r
+                       }\r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);\r
+\r
+       }\r
+       \r
+\r
+       /**\r
+        * Location: error\r
+        * @param {number,string} ErrorCode and ErrorString\r
+        * Replaces Error String with method name\r
+        */\r
+       function error(code, msg /*, args...*/){\r
+\r
+               var args = ['Logging',method].concat([].slice.call(arguments,2));\r
+               msg = msg ? _t().arg.apply(msg,args) : undefined;\r
+               return context.ErrorResult(code, msg);\r
+       }\r
+       \r
+       /**\r
+        * Logging: notificationCall\r
+        * @param {} \r
+        * This function Calls callback function after given delay\r
+        */\r
+       function notificationCall(){\r
+               var tid = setTimeout(function(){\r
+               if(!isTraceInProgress)\r
+                       return;\r
+                       \r
+               DBase = context.getData(provider);\r
+               var returnValue;\r
+               returnValue = context.Iterator( DBase[criteriaReq.Type] || [] );\r
+\r
+               var result,\r
+                       eventCode = {completed:2, error:4, progress:9},\r
+               code = eventCode.completed;\r
+\r
+               callbackReq(tTransactionId,code,context.Result(returnValue,0));\r
+               //notificationCall();\r
+               }, criteriaReq.Filter.DelayTime/1000);\r
+               if(tTransactionId == -1)\r
+                       tTransactionId = tid;\r
+               return context.AsyncResult(tTransactionId);\r
+       }\r
+       \r
+       /**\r
+        * Helper functions\r
+        */\r
+\r
+       /**\r
+        * GenerateRandomNumber\r
+        * @param {}array of log data for getting unique ID \r
+        * \r
+        */\r
+       function GenerateRandomNumber(arr)\r
+       {\r
+               var randomnumber = Math.floor(Math.random() * 10001);\r
+               randomnumber +=200;\r
+               return randomnumber;\r
+       }\r
+\r
+       /**\r
+        * GetCurrDate\r
+        * @param {}Gets date in internet format\r
+        * \r
+        */\r
+       function GetCurrDate()\r
+       {\r
+               var d_names = new Array("Sunday", "Monday", "Tuesday",\r
+               "Wednesday", "Thursday", "Friday", "Saturday");\r
+               \r
+               var m_names = new Array("January", "February", "March", \r
+               "April", "May", "June", "July", "August", "September", \r
+               "October", "November", "December");\r
+               \r
+               var ampm = "am";\r
+               \r
+               var d = new Date();\r
+               var curr_day = d.getDay();\r
+               var curr_date = d.getDate();\r
+               if(curr_date <10)\r
+                       curr_date = "0"+curr_date;\r
+               var curr_month = d.getMonth();\r
+               var curr_year = d.getFullYear();\r
+               var curr_hour = d.getHours();\r
+               if(curr_hour > 11)\r
+               {\r
+                       ampm = "pm";\r
+               }\r
+               else if(curr_hour <10)\r
+               {\r
+                       curr_hour = "0"+curr_hour;\r
+               }       \r
+               var curr_min = d.getMinutes();\r
+               if(curr_min <10)\r
+                       curr_min = "0"+curr_min;\r
+       \r
+               var curr_sec = d.getSeconds();\r
+               if(curr_sec <10)\r
+                       curr_sec = "0"+curr_sec;\r
+               \r
+               var strDate = d_names[curr_day]+', '+curr_date+' '+m_names[curr_month]+', '+curr_year+' '+curr_hour+':'+curr_min+':'+curr_sec+' '+ampm;\r
+               return strDate;\r
+       }       \r
+\r
+       /**\r
+        * ValidateAdd\r
+        * @param {object,function}\r
+        * Validates ADD arguments\r
+        */     \r
+       function ValidateAdd(criteria,callback)\r
+       {\r
+               var type;\r
+               if(!criteria || !criteria.Type)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT,msg.msgTypeMissing);\r
+\r
+               if (typeof criteria.Type != 'string') \r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgTypeInvalid);\r
+               \r
+               if(criteria.Type != 'Log')\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT,msg.msgTypeInvalid);\r
+               \r
+               if (!criteria.Item)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgItemMissing);\r
+\r
+               if(typeof criteria.Item != 'object') \r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgItemInvalid);\r
+               \r
+               \r
+               if(typeof criteria.Item.EventType == "undefined")\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT,msg.msgEventTypeMissing);\r
+\r
+               if(typeof criteria.Item.EventType != "number" )\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgEventTypeInvalid);\r
+               \r
+               if(typeof criteria.Item.EventType == "number" && !(criteria.Item.EventType >=0 && criteria.Item.EventType <=4))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT,msg.msgEventTypeInvalid);\r
+               \r
+               type = typeof criteria.Item.RemoteParty;\r
+               if(type != 'undefined' &&  type != "string")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgRemotePartyInvalid);\r
+               \r
+               type = typeof criteria.Item.Direction;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgDirectionInvalid);\r
+                       \r
+                       if (type == "number" && (criteria.Item.Direction < 0 || criteria.Item.Direction > 6)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgDirectionInvalid);\r
+               }\r
+\r
+               type = typeof criteria.Item.EventDuration;\r
+               if(type != 'undefined' &&  type != "number")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgEventDurationInvalid);\r
+                       \r
+               type = typeof criteria.Item.DeliveryStatus;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgDeliveryStatusInvalid);\r
+                       \r
+                       if (type == "number" && (criteria.Item.DeliveryStatus < 0 || criteria.Item.DeliveryStatus > 6)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgDeliveryStatusInvalid);\r
+               }\r
+               \r
+               type = typeof criteria.Item.Subject;\r
+               if(type != 'undefined' &&  type != "string")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgSubjectInvalid);\r
+\r
+               type = typeof criteria.Item.PhoneNumber;\r
+               if(type != 'undefined' &&  type != "string")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgPhoneNumberInvalid);\r
+\r
+               type = typeof criteria.Item.Link;\r
+               if(type != 'undefined' &&  type != "number")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgLinkInvalid);\r
+\r
+               type = typeof criteria.Item.LogFlags;\r
+               if(type != 'undefined' && (type != "number" || (criteria.Item.LogFlags != 1 && criteria.Item.LogFlags != 0)))\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgLogFlagsInvalid);\r
+\r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS, "");\r
+       }       \r
+\r
+       /**\r
+        * ValidateGetList\r
+        * @param {object,function}\r
+        * Validates GetList function\r
+        */     \r
+       function ValidateGetList(criteria,callback)\r
+       {\r
+               var type;\r
+               if(!criteria || !criteria.Type)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT,msg.msgTypeMissing);\r
+\r
+               if (typeof criteria.Type != 'string') \r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgTypeInvalid);\r
+               \r
+               if(criteria.Type != 'Log')\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT,msg.msgTypeInvalid);\r
+\r
+               type = typeof criteria.Filter;\r
+               if(type != 'undefined' &&  type != "object")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgFilterInvalid);\r
+               \r
+               if(type == 'undefined')\r
+                       return context.ErrorResult(device.implementation.ERR_SUCCESS, "");              \r
+               \r
+               type = typeof criteria.Filter.id;\r
+               if(type != 'undefined' &&  type != "string")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgid);\r
+               \r
+               if(type != 'undefined')\r
+                       return context.ErrorResult(device.implementation.ERR_SUCCESS, "");  // if id is given all other filters will be ignored\r
+\r
+               type = typeof criteria.Filter.EventType;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgEventTypeInvalid);\r
+               \r
+                       if (type != "number" || !(criteria.Filter.EventType >= 0 && criteria.Filter.EventType <= 4)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgEventTypeInvalid);\r
+               }               \r
+               type = typeof criteria.Filter.RecentList;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgRecentListInvalid);\r
+                       if (type == "number" && (criteria.Filter.RecentList < -1 || criteria.Filter.RecentList > 3)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgRecentListInvalid);\r
+               }\r
+               \r
+               type = typeof criteria.Filter.RemoteParty;\r
+               if(type != 'undefined' &&  type != "string")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgRemotePartyInvalid);\r
+               \r
+               type = typeof criteria.Filter.Direction;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgDirectionInvalid);\r
+                       if (type == "number" && (criteria.Filter.Direction < 0 || criteria.Filter.Direction > 6)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgDirectionInvalid);\r
+               }\r
+               \r
+               type = typeof criteria.Filter.DeliveryStatus;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgDeliveryStatusInvalid);\r
+                       if (type == "number" && (criteria.Filter.DeliveryStatus < 0 || criteria.Filter.DeliveryStatus > 6)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgDeliveryStatusInvalid);\r
+               }\r
+\r
+               type = typeof criteria.Filter.EndTime;\r
+               if(type != 'undefined' && (type != "object" ||  typeof criteria.Filter.EndTime.getTime != "function"))\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgEndTimeInvalid);\r
+\r
+               type = typeof criteria.Filter.PhoneNumber;\r
+               if(type != 'undefined' &&  type != "string")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgPhoneNumberInvalid);\r
+\r
+\r
+               type = typeof criteria.Filter.LogFlags;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgLogFlagsInvalid);\r
+                       if (type == "number" && (criteria.Filter.LogFlags != 1 && criteria.Filter.LogFlags != 0)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgLogFlagsInvalid);\r
+               }\r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS, "");\r
+       }       \r
+\r
+\r
+       /** \r
+        * error messages\r
+        * order of %s args: Service name, method name, parameter name \r
+        */\r
+       var msg = {\r
+               msgTypeInvalid                          : '%s:%s:TypeInvalid',\r
+               msgTypeMissing                          : '%s:%s:Type Missing',\r
+               msgFilterInvalid                        : '%s:%s:FilterInvalid',\r
+               msgidInvalid                            : '%s:%s:idInvalid',\r
+               msgRecentListInvalid            : '%s:%s:RecentListInvalid',\r
+               msgPhoneNumberInvalid           : '%s:%s:PhoneNumberInvalid',\r
+               msgDirectionInvalid                     : '%s:%s:DirectionInvalid',\r
+               msgDeliveryStatusInvalid        : '%s:%s:DeliveryStatusInvalid',\r
+               msgLogFlagsInvalid                      : '%s:%s:LogFlagsInvalid',\r
+               msgEndTimeInvalid                       : '%s:%s:EndTimeInvalid',\r
+               msgRemotePartyInvalid           : '%s:%s:RemotePartyInvalid',\r
+               msgEventTypeInvalid                     : '%s:%s:EventTypeInvalid',\r
+               msgItemInvalid                          : '%s:%s:ItemInvalid',\r
+               msgItemMissing                          : '%s:%s:ItemMissing',\r
+               msgEventTypeInvalid                     : '%s:%s:EventTypeInvalid',\r
+               msgEventTypeMissing                     : '%s:%s:EventType Missing',\r
+               msgEventDurationInvalid         : '%s:%s:EventDurationInvalid',\r
+               msgSubjectInvalid                       : '%s:%s:SubjectInvalid',\r
+               msgEventDataInvalid                     : '%s:%s:EventDataInvalid',\r
+               msgLinkInvalid                          : '%s:%s:LinkInvalid',\r
+               msgDataInvalid                          : '%s:%s:DataInvalid',\r
+               msgDataMissing                          : '%s:%s:Data Missing',\r
+               msgid                                           : '%s:%s:id',\r
+               msgFilterInvalid                        : '%s:%s:FilterInvalid',\r
+               msgFilterMissing                        : '%s:%s:Filter Missing',\r
+               msgDelayTimeInvalid                     : '%s:%s:DelayTimeInvalid',\r
+               msgDelayTimerMissing            : '%s:%s:DelayTimerMissing',\r
+               msgTransactionIdInvalid         : '%s:%s:TransactionIdInvalid',\r
+               msgTransactionIdMissing         : '%s:%s:TransactionID Missing',\r
+               msgMissingCallback                      : '%s:%s:Missing Callback',\r
+               msgNoMsg                                        : '%s:%s:'\r
+       };\r
+               \r
+\r
+}) ()\r
+\r
diff --git a/wrt/misc/rss/preview/script/lib/sapi/MediaManagement.js b/wrt/misc/rss/preview/script/lib/sapi/MediaManagement.js
new file mode 100644 (file)
index 0000000..fe1639b
--- /dev/null
@@ -0,0 +1,157 @@
+/**
+ * MediaManagement.js
+ * 
+ * Nokia Web Runtime Service API emulation 
+ * WRT v1.1
+ * 
+ * Copyright 2009 Nokia Corporation. All rights reserved.
+*/
+
+(function(){
+       
+       var provider = 'Service.MediaManagement' ,
+               Interface = 'IDataSource';
+
+       /**
+        * MediaManagement service
+        */
+       var MediaManagementService = function(){
+               this.GetList    = __GetList;
+               this.Cancel     = __Cancel;
+       }
+
+       device.implementation.extend(provider, Interface, new MediaManagementService() );
+
+
+       /******************************************************/        
+       /******************************************************/        
+       /******************************************************/        
+
+       var     context = device.implementation.context,
+               _t = context._t,
+               method = '',
+               result = false,
+               DBase = null;
+       
+       /**
+        * MediaManagement: GetList
+        * @param {Object} criteria
+        * @param {Function} callback function for async call (mandatory)
+        */
+       function __GetList(criteria, callback, _flag){
+
+               if ((result = validator.apply('GetList', arguments)) !== false)
+                       return result; 
+
+               // _flag=true indicates re-called state
+               _flag = _flag || false;
+               if (!_flag) {
+
+                       // callback is mandatory
+                       if (typeof callback != 'function')
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.badAsync);
+                       
+                       // continue validation after callback check             
+                       if (!criteria.Filter) 
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.is_missing, 'Filter');
+                       
+                       if (!criteria.Filter.FileType) 
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.is_missing, 'FileType');
+                       
+                       if (!/^(Music|Sound|Image|Video|StreamingURL)$/i.test(criteria.Filter.FileType)) 
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);
+                       
+                       // process callback
+                       _flag = true;
+                       return context.callAsync(this, arguments.callee, criteria, callback, _flag);
+               }
+               
+               var returnValue = [], 
+                       match = null,
+                       fileType = criteria.Filter.FileType,
+                       filter = criteria.Filter;
+               // normalize filetype
+               fileType = fileType[0].toUpperCase() + fileType.substr(1).toLowerCase();
+               fileType = fileType.replace(/url/i, 'URL');
+               
+               DBase = context.getData(provider);
+
+               // unsupported filters 
+               if (filter 
+                       && (match = context.keys(filter).join().match(/Key|StartRange|EndRange/ig)) ) {
+                       context.notify(_t('%s:: GetList : filter %s not implemented in preview').arg(provider, match.join()));
+               }
+               // unsupported sort                     
+               if (criteria.Sort) { 
+                       context.notify(_t('%s:: GetList : sort not implemented in preview').arg(provider));
+               }
+
+               returnValue = DBase[fileType];
+               return context.Result(context.Iterator(returnValue));
+       }
+                       
+                       
+       /**
+        * MediaManagement: Cancel
+        * @param {Object} criteria
+        */
+       function __Cancel(criteria){
+               method = 'Cancel';
+               if (!criteria || !criteria.TransactionID)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingTID);
+               
+               clearTimeout(criteria.TransactionID);
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);
+       }
+
+
+       
+       /*******************************
+        * helper functions
+        *******************************/
+       
+       function error(code, msg /*, args...*/){
+
+               var args = ['MediaMgmt',method].concat([].slice.call(arguments,2));
+               msg = msg ? _t().arg.apply(msg,args) : undefined;
+               return context.ErrorResult(code, msg);
+       }
+
+       /**
+        * validate common input arguments
+        * 'this' is string (object) name of calling function
+        * 
+        * @param {arguments} arguments of calling function
+        * @return {Result} Result object if error, false if no error.
+        */
+       function validator() {
+               method = ''+this;
+               var     failed = false,
+                       criteria = arguments[0] || false;
+                       
+               if (!criteria || typeof criteria != 'object' || typeof criteria.Type == 'undefined')
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.is_missing, 'Type');
+               
+               if (!/^FileInfo$/i.test(criteria.Type)) 
+                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.badType);
+
+               return failed;
+       }
+
+       /** 
+        * error messages
+        * order of %s args: Service name, method name, parameter name 
+        */
+       var msg = {
+               badType                 : '%s : %s : Type not supported',
+               missingTID              : '%s : %s : TransactionID is missing',
+               badAsync                : '%s : %s : Insufficient arguments for async request',
+               is_missing              : '%s : %s : %s is missing',
+               is_invalid              : '%s : %s : %s is invalid'
+       };
+               
+
+}) ()
+
diff --git a/wrt/misc/rss/preview/script/lib/sapi/Messaging.js b/wrt/misc/rss/preview/script/lib/sapi/Messaging.js
new file mode 100644 (file)
index 0000000..1b49ef0
--- /dev/null
@@ -0,0 +1,366 @@
+/**
+ * Messaging.js
+ * 
+ * Nokia Web Runtime Service API emulation 
+ * WRT v1.1
+ * 
+ * Copyright 2009 Nokia Corporation. All rights reserved.
+*/
+  
+(function(){
+       
+       var provider = 'Service.Messaging' ,
+               Interface = 'IMessaging';
+               
+       /**
+        * Messaging service
+        */
+       var MessagingService = function(){
+               this.GetList                            = __GetList;
+               this.Send                                       = __Send;
+               this.RegisterNotification       = __RegisterNotification;
+               this.CancelNotification         = __CancelNotification;
+               this.ChangeStatus                       = __ChangeStatus;
+               this.Delete                                     = __Delete;
+               this.Cancel                             = __Cancel;
+       }
+
+       device.implementation.extend(provider, Interface, new MessagingService() );
+
+
+       /******************************************************/        
+       /******************************************************/        
+       /******************************************************/        
+
+       var     context = device.implementation.context,
+               _t = context._t,
+               method = '',
+               result = false,
+               DBase = null;
+       
+       /**
+        * Messaging: GetList
+        * @param {Object} criteria
+        */
+       function __GetList(criteria){
+
+               if ((result = validator.apply('GetList', arguments)) !== false)
+                       return result; 
+       
+               if (!criteria.Type)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);
+
+               if (!/^Inbox$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);
+       
+               var returnValue = [], 
+                       match = null,
+                       filter = criteria.Filter || null;
+               DBase = context.getData(provider);
+
+               // filter by MessageId
+               if (filter && filter.MessageId) {
+                       returnValue = findByKey(DBase.Inbox, filter.MessageId, 'MessageId'); 
+                       if (returnValue.length == 0)
+                               return error(device.implementation.ERR_NOT_FOUND);
+               }
+               // return all messages
+               else {
+                       returnValue = DBase.Inbox;
+               }
+
+               // unsupported filters 
+               if (filter 
+                       && (match = context.keys(filter).join().match(/MessageTypeList|SenderList|Subject|StartDate|EndDate/ig)) ) {
+                       context.notify(_t('%s:: GetList : filter %s not implemented in preview').arg(provider, match.join()));
+               }
+               // unsupported sort                     
+               if (criteria.Sort) { 
+                       context.notify(_t('%s:: GetList : sort not implemented in preview').arg(provider));
+               }
+               return context.Result(context.Iterator(returnValue));
+       }
+                       
+       /**
+        * Messaging: Send
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __Send(criteria, callback){
+
+               if ((result = validator.apply('Send', arguments)) !== false)
+                       return result; 
+
+               if (!criteria.MessageType)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.missingMessageType);
+                       
+               if (!/^(SMS|MMS)$/i.test(criteria.MessageType))
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badMessageType);
+
+               if (!criteria.To)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingTo);
+               
+               // async call?
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               context.notify(_t('%s:: Send : message sent!').arg(provider));
+
+               // return success
+               return error(device.implementation.ERR_SUCCESS);
+       }
+                       
+
+       /**
+        * Messaging: RegisterNotification
+        * @param {Object} criteria
+        * @param {function} callback function for async call (mandatory)
+        */
+       function __RegisterNotification(criteria, callback){
+
+               if ((result = validator.apply('RegisterNotification', arguments)) !== false)
+                       return result; 
+
+               // callback is mandatory
+               if (typeof callback != 'function')
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badAsync);
+               
+               // continue validation after callback check             
+               if (typeof criteria.Type == 'undefined') 
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);
+               
+               if (!/^NewMessage$/i.test(criteria.Type)) 
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);
+
+               var eventType =  'NewMessage';
+
+               // check for multiple registration
+               if (context.hasListener(provider, eventType))
+                       return error(device.implementation.ERR_ENTRY_EXISTS);
+                               
+               // process notify
+               return context.addListener(provider, eventType, criteria, callback, notifyHandler);
+       }
+                       
+       function notifyHandler(transactionID, criteria, callback, data){
+               
+               var result,
+                       eventCode = {completed:2, error:4, progress:9},
+                       code = eventCode.progress;
+               try{
+                       DBase = context.getData(provider);
+                       
+                       // make new message
+                       var now = new Date();
+                       var message = {
+                               "MessageType": "SMS",
+                               "Sender": "0435445454",
+                               "Subject": "new message",
+                               "Time": _t("%s, %s").arg(now.toString().substr(0,3), now.toLocaleString()),
+                               "Priority": "Medium",
+                               "Attachment": false,
+                               "Unread": true,
+                               "MessageId": context.getUniqueID(),
+                               "BodyText": "My hovercraft is full of eels!"
+                       };
+                       
+                       // extend with optional data
+                       data = typeof data=='object' && !(data instanceof Array) ? data : {};
+                       var returnValue = context.extend(message, data);
+
+                       result = context.Result(returnValue);
+                       
+                       /// add to top of inbox
+                       DBase.Inbox.unshift(message);
+               } 
+               catch(e){
+                       code = eventCode.error;
+               }
+               callback(transactionID, code, result);
+       }
+       
+       /**
+        * Messaging: CancelNotification
+        * @param {Object} criteria
+        */
+       function __CancelNotification(criteria){
+
+               if ((result = validator.apply('CancelNotification', arguments)) !== false)
+                       return result; 
+
+               if (typeof criteria.Type == 'undefined') 
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);
+
+               if (!/^NewMessage$/i.test(criteria.Type)) 
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);
+
+               var eventType = 'NewMessage';
+               context.removeListener(provider, eventType);
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);
+       }
+                       
+                       
+       /**
+        * Messaging: ChangeStatus
+        * @param {Object} criteria
+        */
+       function __ChangeStatus(criteria){
+
+               if ((result = validator.apply('ChangeStatus', arguments)) !== false)
+                       return result; 
+
+               if (!criteria.MessageId)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.is_missing ,'MessageId');
+                       
+               if (typeof criteria.MessageId != 'number')
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badMessageIdType);
+                       
+               if (!criteria.Status)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.is_missing ,'Status');
+
+               if (!/^(Read|Unread|Replied|Forwarded)$/i.test(criteria.Status))
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badStatus);
+       
+               // check if a callback was provided
+               if (arguments.length > 1)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badAsync2);
+                       
+               DBase = context.getData(provider);
+
+               var i,item, found = false;
+               for (i in DBase.Inbox) {
+                       item = DBase.Inbox[i];
+                       if (criteria.MessageId == item.MessageId) {
+                               item.Unread = /Unread/i.test(criteria.Status);
+                               found = true;
+                       }
+               }
+               if (!found)
+                       return error(device.implementation.ERR_NOT_FOUND);
+
+               // return success
+               return error(device.implementation.ERR_SUCCESS);                                
+       }
+                                               
+       /**
+        * Messaging: Delete
+        * @param {Object} criteria
+        */
+       function __Delete(criteria){
+               
+               if ((result = validator.apply('Delete', arguments)) !== false)
+                       return result; 
+
+               if (typeof criteria.MessageId == 'undefined')
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingMessageId);
+
+               if (typeof criteria.MessageId != 'number')
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badMessageIdType);
+                                       
+               if (criteria.MessageId < 0)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badMessageId);
+                       
+               DBase = context.getData(provider);
+
+               var i,item, found = false;
+               for (i in DBase.Inbox) {
+                       item = DBase.Inbox[i];
+                       if (criteria.MessageId == item.MessageId) {
+                               DBase.Inbox.splice(i, 1);
+                               found = true;
+                       }
+               }
+               if (!found)
+                       return error(device.implementation.ERR_NOT_FOUND);
+                       
+               // return success
+               return error(device.implementation.ERR_SUCCESS);                                
+       }
+                       
+
+       /**
+        * Messaging: Cancel
+        * @param {Object} criteria
+        */
+       function __Cancel(criteria){
+               method = 'Cancel';
+               if (!criteria || !criteria.TransactionID)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.is_missing, 'TransactionID');
+               
+               clearTimeout(criteria.TransactionID);
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);
+       }
+
+       
+       /*******************************
+        * helper functions
+        *******************************/
+       
+       function error(code, msg /*, args...*/){
+
+               var args = ['Messaging',method].concat([].slice.call(arguments,2));
+               msg = msg ? _t().arg.apply(msg,args) : undefined;
+               return context.ErrorResult(code, msg);
+       }
+
+       /**
+        * validate common input arguments
+        * 'this' is string (object) name of calling function
+        * 
+        * @param {arguments} arguments of calling function
+        * @return {Result} Result object if error, false if no error.
+        */
+       function validator() {
+               method = ''+this;
+               var     failed = false,
+                       criteria = arguments[0] || false;
+
+               if (!criteria || typeof criteria != 'object')
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, 
+                               method == 'Send' 
+                               ? msg.missingMessageType 
+                               : (/ChangeStatus|Delete/.test(method) 
+                                       ? msg.missingMessageId 
+                                       : msg.missingType) );
+                       
+               return failed;
+       }
+
+
+       function findByKey(dbase, value, key){
+               var result = [];
+               for (var i in dbase) {
+                       if (value == dbase[i][key]) {
+                               result.push(dbase[i]);
+                       }
+               }
+               return result;
+       }
+
+       /** 
+        * error messages
+        * order of %s args: Service name, method name, parameter name 
+        */
+       var msg = {
+               missingType             : '%s:%s:Type Missing',
+               badType                 : '%s:%s:Type Value Incorrect',
+               missingTo               : '%s:%s:To Missing',
+               badTo                   : '%s:%s:To Value Incorrect',
+               missingMessageType      : '%s:%s:MessageType Missing',
+               badMessageType  : '%s:%s:MessageType Value Incorrect',
+               badAsync                : '%s:%s:Synchronous Operation not supported',
+               badAsync2               : '%s:%s:Asynchronous Operation not supported',
+               missingMessageId        : '%s:%s:MessageId Missing',
+               badMessageIdType: '%s:%s:MessageId Type Invalid',
+               badMessageId    : '%s:%s:MessageId Value Incorrect',
+               badStatus               : '%s:%s:Status Value Incorrect',
+
+               is_missing              : '%s:%s:%s Missing',
+               is_invalid              : '%s:%s:%s Value Incorrect'
+       };
+               
+
+}) ()
+
diff --git a/wrt/misc/rss/preview/script/lib/sapi/Sensor.js b/wrt/misc/rss/preview/script/lib/sapi/Sensor.js
new file mode 100644 (file)
index 0000000..b1bb4e4
--- /dev/null
@@ -0,0 +1,250 @@
+/**\r
+ * Sensor.js\r
+ * \r
+ * Nokia Web Runtime Service API emulation \r
+ * WRT v1.1\r
+ * \r
+ * Copyright 2009 Nokia Corporation. All rights reserved.\r
+*/\r
+\r
+(function(){\r
+\r
+       var provider = 'Service.Sensor',\r
+               Interface = 'ISensor';\r
+       var transID = new Array();\r
+       /**\r
+        * Sensor service\r
+        */\r
+       var SensorService = function(){\r
+               this.FindSensorChannel                  = __FindSensorChannel;\r
+               this.RegisterForNotification    = __RegisterForNotification;\r
+               this.Cancel                                             = __Cancel;\r
+               this.GetChannelProperty                 = __GetChannelProperty;         \r
+       }\r
+\r
+       device.implementation.extend(provider, Interface, new SensorService() );\r
+\r
+       /******************************************************/        \r
+       /******************************************************/        \r
+       /******************************************************/        \r
+\r
+       var     context = device.implementation.context,\r
+               _t = context._t,\r
+               method = '',\r
+               result = false,\r
+               DBase = null;\r
+\r
+\r
+       /**\r
+        * Sensor: FindSensorChannel\r
+        * @param {Object} criteria\r
+        */\r
+       function __FindSensorChannel(criteria){\r
+               method = 'FindSensorChannel';\r
+               if(!criteria)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgCriteriaMissing);\r
+                       \r
+               if(typeof criteria != 'object')\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgCriteriaMissing);\r
+                                               \r
+               if(typeof criteria.SearchCriterion == 'undefined')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgDataMissing);\r
+\r
+               if(typeof criteria.SearchCriterion != 'string')\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgidInvalid);\r
+\r
+               if(!(criteria.SearchCriterion== "All" || criteria.SearchCriterion== "AccelerometerAxis" || criteria.SearchCriterion=="AccelerometerDoubleTapping" || criteria.SearchCriterion=="Orientation" || criteria.SearchCriterion=="Rotation"))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgSearchParamInvalid);\r
+\r
+               if(arguments.length > 1)\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgCriteriaMissing);                       \r
+\r
+               DBase = context.getData(provider);\r
+               var returnValue;\r
+               returnValue = DBase[criteria.SearchCriterion] || [] ;\r
+               \r
+               return context.Result(returnValue,0);                   \r
+       }\r
+\r
+\r
+\r
+       /**\r
+        * Sensor: RegisterForNotification\r
+        * @param {Object} criteria, callback\r
+        */\r
+       function __RegisterForNotification(criteria, callback, flag){\r
+               flag = flag || false;\r
+               method = 'RegisterForNotification';\r
+               context.notify(_t('%s:: RegisterForNotification not implemented in preview').arg(provider));\r
+               \r
+               if(arguments.length >2 && (typeof flag != "undefined" && typeof flag != "boolean"))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgCriteriaMissing);\r
+\r
+               if(typeof callback != 'function')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgInsufficentArgument);\r
+               \r
+               \r
+               if(!criteria)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgIncompleteInput);\r
+                       \r
+               if(typeof criteria != 'object')\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgIncompleteInput);\r
+                                               \r
+               if(typeof criteria.ListeningType == 'undefined' || typeof criteria.ChannelInfoMap == 'undefined')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgIncompleteInput);\r
+\r
+               if(typeof criteria.ListeningType != 'string')\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgListenTypeInvalid);\r
+                       \r
+               if(typeof criteria.ChannelInfoMap != 'object')\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgChannelInfoMapInvalid);\r
+               \r
+               if(!(criteria.ListeningType== "ChannelData" ))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgOutofRange);\r
+\r
+               if(typeof callback == 'function')\r
+               {\r
+                       var result = context.callAsync(this, arguments.callee, criteria, callback);\r
+                       transID.push(result.TransactionID);\r
+                       return result;\r
+               }\r
+               if(flag)\r
+                       transID.shift();\r
+                               \r
+               return context.ErrorResult();\r
+       }\r
+\r
+\r
+       /**\r
+        * Sensor: Cancel\r
+        * @param {Object} criteria\r
+        */\r
+       function __Cancel(criteria){\r
+               method = 'Cancel';\r
+\r
+               if(arguments.length > 1 && typeof criteria != "object" && typeof criteria.TransactionID != "number" && arguments[1])\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgCriteriaMissing);\r
+\r
+               if (!criteria || typeof criteria.TransactionID == 'undefined') \r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgTransIDMissing);\r
+\r
+               if (criteria.TransactionID == Infinity || criteria.TransactionID == -Infinity) \r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgTransIDMissing);\r
+               \r
+               if (typeof criteria.TransactionID != 'number') \r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgIncorrectTransID);             \r
+\r
+               for (var i=0; i<transID.length; i++) {
+                       if (criteria.TransactionID == transID[i]){\r
+                               clearTimeout(criteria.TransactionID);\r
+                               return context.ErrorResult();\r
+                       }
+               };\r
+               \r
+               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgInvalidTransID);\r
+\r
+       }\r
+\r
+\r
+       /**\r
+        * Sensor: GetChannelProperty\r
+        * @param {Object} criteria\r
+        */\r
+       function __GetChannelProperty(criteria){\r
+               method = 'GetChannelProperty';\r
+\r
+               if(!criteria)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgIncompleteInput);\r
+                       \r
+               if(typeof criteria != 'object')\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgIncompleteInput);\r
+\r
+               if(typeof criteria.ChannelInfoMap == 'undefined' || typeof criteria.PropertyId == 'undefined')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgIncompleteInput);\r
+               \r
+               if(typeof criteria.ChannelInfoMap != 'object')\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgChannelInfoMapInvalid);\r
+               \r
+               if(typeof criteria.PropertyId != 'string')\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgInvalidPropertyID);\r
+               \r
+               if(criteria.PropertyId != 'Availability' && criteria.PropertyId != "ChannelAccuracy" && criteria.PropertyId != "ChannelDataFormat" && criteria.PropertyId != "ChannelScale" && criteria.PropertyId != "ChannelUnit" && criteria.PropertyId != "ConnectionType" && criteria.PropertyId != "DataRate" && criteria.PropertyId != "Description" && criteria.PropertyId != "MeasureRange" && criteria.PropertyId != "ScaledRange" && criteria.PropertyId != "SensorModel")\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgInvalidPropertyID);\r
+\r
+               if(arguments.length > 1)\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgCriteriaMissing);                       \r
+\r
+               DBase = context.getData(provider);\r
+               var property = DBase['SensorProperty'];\r
+               if(typeof criteria.ChannelInfoMap['ChannelId'] == 'undefined' || typeof criteria.ChannelInfoMap['ChannelId'] != 'number')\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgChannelInfoMapInvalid);\r
+\r
+               var channel = null;\r
+               if(criteria.ChannelInfoMap['ChannelId'] == 7)\r
+               {\r
+                       channel = 'AccelerometerAxis';\r
+               }\r
+               else if(criteria.ChannelInfoMap['ChannelId'] == 8)\r
+               {\r
+                       channel = 'AccelerometerDoubleTapping';\r
+               }\r
+               else if(criteria.ChannelInfoMap['ChannelId'] == 10)\r
+               {\r
+                       channel = 'Orientation';\r
+               }\r
+               else if(criteria.ChannelInfoMap['ChannelId'] == 11)\r
+               {\r
+                       channel = 'Rotation';\r
+               }\r
+       \r
+               if(channel == null)\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgChannelInfoMapInvalid);\r
+               \r
+               var returnValue = property[channel][criteria.PropertyId];\r
+               if(typeof returnValue == 'undefined')\r
+                       return context.ErrorResult(device.implementation.ERR_NOT_FOUND);\r
+               return context.Result(returnValue,0)\r
+       }\r
+\r
+       /**\r
+        * Sensor: error\r
+        * @param {number,string} ErrorCode and ErrorString\r
+        * Replaces Error String with method name\r
+        */\r
+       function error(code, msg /*, args...*/){\r
+\r
+               var args = ['Sensors',method].concat([].slice.call(arguments,2));\r
+               msg = msg ? _t().arg.apply(msg,args) : undefined;\r
+               return context.ErrorResult(code, msg);\r
+       }\r
+\r
+\r
+       /** \r
+        * error messages\r
+        * order of %s args: Service name, method name, parameter name \r
+        */\r
+       var msg = {     \r
+               msgInterfaceNotSupported        : '%s:Requested interface not supported by the provider',\r
+               msgInterfaceMissing             : '%s:Interface name missing',\r
+               msgInsufficentArgument          : '%s:%s:Insufficent argument for asynchronous request',\r
+               msgListenTypeMissing            : '%s:%s:Listening type missing',\r
+               msgListenTypeInvalid            : '%s:%s:Listening type is invalid',\r
+               msgChannelInfoMissing           : '%s:%s:ChannelInfoMap missing',\r
+               msgIncompleteInput                      : '%s:%s:Incomplete input param list',\r
+               msgOutofRange                           : '%s:%s:Listening type is out of allowed range',\r
+               msgCallbackMissing                      : '%s:%s:Callback missing',\r
+               msgAlreadyRegistered            : '%s:%s:Notification is already registered on this channel',\r
+               msgCriteriaMissing                      : '%s:%s:Search criterion is missing',\r
+               msgInvalidSearchCriteria        : '%s:%s:Invalid Search Criterion',\r
+               msgChannelSearchInvalid         : '%s:%s:Channel search param type invalid',\r
+               msgSearchParamInvalid           : '%s:%s:Invalid channel search param',\r
+               msgTransIDMissing                       : '%s:%s:Transaction id is missing',\r
+               msgIncorrectTransID                     : '%s:%s:Incorrect TransactionID',\r
+               msgInvalidTransID                       : '%s:%s:Invalid TransactionID',\r
+               msgPropertyIDMissing            : '%s:%s:Property id missing',\r
+               msgInvalidPropertyID            : '%s:%s:Property id is invalid',\r
+               msgChannelNotSupported          : '%s:%s:Channel property not supported',\r
+               msgChannelInfoMapInvalid        : '%s:%s:ChannelInfoMap Type Invalid'\r
+       };\r
+\r
+}) ()
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/script/lib/sapi/SysInfo.js b/wrt/misc/rss/preview/script/lib/sapi/SysInfo.js
new file mode 100644 (file)
index 0000000..bc04a87
--- /dev/null
@@ -0,0 +1,398 @@
+/**
+ * SysInfo.js
+ * 
+ * Nokia Web Runtime Service API emulation 
+ * WRT v1.1
+ * 
+ * Copyright 2009 Nokia Corporation. All rights reserved.
+*/
+
+(function(){
+       
+       var provider = 'Service.SysInfo' ,
+               Interface = 'ISysInfo';
+
+       var supportedEntitiesAndKeys = {
+               "battery":{
+                       "batterystrength":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "chargingstatus":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true}
+               },
+               "connectivity":{
+                       "bluetooth":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       "infrared":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       "activeconnections":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":false},
+                       "connectionstatus":{"GetInfo":false,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "wlanmacaddress":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true}
+               },
+       "device":{
+                       "firmwareversion":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "platformversion":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "producttype":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "manufacturer":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "machineid":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "phonemodel":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "imei":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true}
+               },
+       "display":{
+                       "brightness":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "screensavertimeout":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "userinactivity":{"GetInfo":false,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "keyguardtime":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "autolocktime":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "autolockstatus":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       "wallpaper":{"GetInfo":false,"SetInfo":true,"GetNotification":false,"GetInfoModeSync":false,"InputDataType":"string"},
+                       "lighttimeout":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "displayresolution":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "displayorientation":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true}
+               },
+       "features":{
+                       "bluetooth":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "infrared":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "camera":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "memorycard":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "fmradio":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "qwerty":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "wlan":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "usb":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "pen":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "led":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "coverui":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "sidevolumekeys":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "vibra":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true}
+               },
+       "general":{
+                       "accessorystatus":{"GetInfo":false,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "connectedaccessories":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "inputlanguage":{"GetInfo":true,"SetInfo":true,"GetNotification":true,"GetInfoModeSync":true},
+                       "supportedlanguages":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "predictivetext":{"GetInfo":true,"SetInfo":true,"GetNotification":true,"GetInfoModeSync":true},
+                       "vibraactive":{"GetInfo":true,"SetInfo":true,"GetNotification":true,"GetInfoModeSync":true},
+                       "availableusbmodes":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "activeusbmode":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "flipstatus":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       "gripstatus":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       
+               },
+       "memory":{
+                       "driveinfo":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "listdrives":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "criticalmemory":{"GetInfo":false,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "memorycard":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true}
+               },
+       "network":{
+                       "signalstrength":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "registrationstatus":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       "networkmode":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       "currentnetwork":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "locationarea":{"GetInfo":false,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "cellid":{"GetInfo":false,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false}
+               }
+         };
+         
+       /**
+        * SysInfo service
+        */
+       var SysInfoService = function(){
+               this.GetInfo                    = __GetInfo;
+               this.SetInfo                    = __SetInfo;
+               this.GetNotification    = __GetNotification;
+               this.Cancel                     = __Cancel;
+       }
+
+       device.implementation.extend(provider, Interface, new SysInfoService() );
+
+       var     context = device.implementation.context,
+               _t = context._t,
+               method = '',
+               result = false,
+               DBase = null,
+               default_device = 'default';
+               
+       /**
+        * SysInfo: GetInfo
+        * @param {Object} criteria
+        * @param {function} callback function for async call (optional)
+        */
+       function __GetInfo(criteria, callback){
+               var retVal = ValidateArguments("GetInfo",criteria,callback);
+               if(retVal.ErrorCode != 0)
+               {
+                       return retVal;
+               }
+               //      Async call
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               DBase = context.getData(provider);
+               var returnValue = DBase;
+               returnValue = returnValue[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()];
+               returnValue.Key = criteria.Key;
+               returnValue.Entity = criteria.Entity;
+
+               if(/^Connectivity$/i.test(criteria.Entity)&& /^ActiveConnections$/i.test(criteria.Key))
+               {
+                       var temp = returnValue.ConnectionList;
+                       returnValue.ConnectionList = context.Iterator(temp);
+               }
+               else if(/^General$/i.test(criteria.Entity)&& /^ConnectedAccessories$/i.test(criteria.Key))
+               {
+                       var temp = returnValue.AccessoryList;
+                       returnValue.AccessoryList = context.Iterator(temp);                     
+               }
+               else if(/^Memory$/i.test(criteria.Entity)&& /^DriveInfo$/i.test(criteria.Key))
+               {
+                       try {
+                               var temp = criteria.SystemData.Drive;
+                               if(temp.length > 3)
+                               {
+                                       temp = temp.substring(0,3);
+                               }
+                               temp= returnValue.Drive[temp.toUpperCase()];
+                               if (!temp) {
+                                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.no_msg);
+                               }
+                               var driveInfo = new Object();
+                               driveInfo.Key = returnValue.Key;
+                               driveInfo.Entity = returnValue.Entity;
+                               driveInfo.DriveInfo = temp;
+                               return context.Result(driveInfo);
+                       }
+                       catch(err)
+                       {
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.no_msg);
+                       }
+                       
+               }
+               return context.Result(returnValue);
+       }
+                       
+
+       /**
+        * SysInfo: SetInfo
+        * @param {Object} criteria
+        * @param {function} callback function for async call (optional)
+        */
+       function __SetInfo(criteria, callback){
+               var retVal = ValidateArguments("SetInfo",criteria,callback);
+               if(retVal.ErrorCode != 0)
+               {
+                       return retVal;
+               }
+
+               //      Current implementation support only for 'General' -> 'InputLanguage' || 'PredictiveText'
+               if (/^General$/i.test(criteria.Entity) && ( /^InputLanguage$/i.test(criteria.Key) || /^PredictiveText/i.test(criteria.Key) || /^VibraActive/i.test(criteria.Key))) {
+                       //      get the DBase data
+                       DBase = context.getData(provider);
+                       var returnValue = DBase;
+                       
+                       //      Check the 'SupportedLanguages' entries for Setting the new Status
+                       if (/^InputLanguage$/i.test(criteria.Key)) {
+                               var found = false;
+                               var languageList = returnValue['general']['supportedlanguages']['LanguageList'];
+                               for (var key in languageList) {
+                                       if (languageList[key] == criteria.SystemData.Status) {
+                                               found = true;
+                                       }
+                               }
+                               //      Update the 'InputLanguage' if the value value found in the ['SupportedLanguages']
+                               if (found) 
+                                       returnValue[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()]['Status'] = criteria.SystemData.Status;
+                               else 
+                                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.not_supported);
+                       }
+                       else if (/^PredictiveText$/i.test(criteria.Key)) {
+                               if (criteria.SystemData.Status == 0 || criteria.SystemData.Status == 1) 
+                                       returnValue[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()]['Status'] = criteria.SystemData.Status;
+                               else 
+                                       return error(device.implementation.ERR_NOT_FOUND, msg.badType);
+                       }
+                       else if (/^VibraActive$/i.test(criteria.Key)) {
+                               if (criteria.SystemData.Status == 0 || criteria.SystemData.Status == 1) 
+                                       returnValue[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()]['Status'] = criteria.SystemData.Status;
+                       }
+                       else {
+                               return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.not_supported);
+                       }
+               }
+               else if(/^Display/i.test(criteria.Entity) && /^Wallpaper/i.test(criteria.Key)) {
+                       if(typeof criteria.SystemData.StringData == 'undefined')
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingArgs);
+                       returnValue[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()]['StringData'] = criteria.SystemData.StringData;
+                       return context.ErrorResult(device.implementation.ERR_SUCCESS);
+               }
+               return context.Result(result);
+       }
+                       
+
+       /**
+        * SysInfo: GetNotification
+        * @param {Object} criteria
+        * @param {function} callback function for async call
+        */
+       function __GetNotification(criteria, callback){
+               var retVal = ValidateArguments("GetNotification",criteria,callback);
+               if(retVal.ErrorCode != 0)
+               {
+                       return retVal;
+               }
+               
+               // unsupported
+               if (!/^(Battery|Memory)$/i.test(criteria.Entity) ||
+                       !/^(BatteryStrength|ChargingStatus|MemoryCard)$/i.test(criteria.Key)) {
+                       context.notify(_t('%s:: GetNotification : entity %s, key %s not implemented in preview.').arg(provider, criteria.Entity, criteria.Key));
+                       // register callback anyway so Cancel works. 
+               }
+
+               // evenType = 'entity.key'
+               var eventType = criteria.Entity+'.'+criteria.Key;
+                                               
+               // process notify
+               return context.addListener(provider, eventType, criteria, callback, notifyHandler);
+       }
+                       
+       function notifyHandler(transactionID, criteria, callback, data){
+               
+               var result,
+                       eventCode = {completed:2, error:4, progress:9},
+                       code = eventCode.progress;
+               try{
+                       DBase = context.getData(provider);
+                       var entity = criteria.Entity.toLowerCase(),
+                               key = criteria.Key.toLowerCase();
+                                               
+                       // make a copy of return value
+                       var returnValue = context.extend({},DBase[entity][key]);
+                       
+                       // augment with data
+                       context.extend(returnValue, data);
+
+                       result = context.Result(returnValue);
+               } 
+               catch(e){
+                       code = eventCode.error;
+               }
+               callback(transactionID, code, result);
+       }
+               
+                       
+
+       /**
+        * SysInfo: Cancel
+        * @param {Object} criteria
+        */
+       function __Cancel(criteria){
+               method = 'Cancel';
+
+               if (!criteria || !criteria.TransactionID)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingTID);
+
+               var found = context.removeListener(provider, null, criteria.TransactionID);
+               if (!found)
+                       return error(device.implementation.ERR_NOT_FOUND);
+               else
+                       return context.ErrorResult(device.implementation.ERR_SUCCESS);
+       }
+
+
+       
+       /*******************************
+        * helper functions
+        *******************************/
+       
+       function error(code, msg /*, args...*/){
+
+               var args = ['SysInfo',method].concat([].slice.call(arguments,2));
+               msg = msg ? _t().arg.apply(msg,args) : undefined;
+               return context.ErrorResult(code, msg);
+       }
+
+       function cancelRegisteredNotify(result)
+       {
+               __Cancel({'TransactionID':result.TransactionID});
+               method = 'GetNotification';
+       }
+
+       /** 
+        * error messages
+        * order of %s args: Service name, method name, parameter name 
+        */
+       var msg = {
+               badType                         : '%s: %s: Type is invalid',
+               badSysInfo                      : '%s: %s: SysInfoName is invalid',
+               missingSysInfo          : '%s: %s: SysInfoName is missing',
+               missingTID                      : '%s: %s: Transaction ID missing',
+               not_supported           : '%s: %s: Not Supported',
+               is_invalid                      : '%s: %s: Is invalid',
+               missingArgs                     : '%s: %s: SystemData Argument Missing',
+               inSufficientArgs        : '%s: %s: Insufficient Arguments to process',
+               missingInputParam       : '%s: %s: Input Parameter Missing',
+               not_supportedSyncVer: '%s: %s: Sync Version Not Supported',
+               noEntity                        : '%s: %s: Entity: Input Parameter Missing',
+               noKey                           : '%s: %s: Key: Input Parameter Missing',
+               IncorrectSytemData      : '%s: %s: Incorrect SystemData Type, SystemData Must be a Map',
+               callbackNotFound        : '%s: %s: Callback object not found',
+               commandNotFound         : '%s: %s: Command Not Supported',
+               unsupInterface          : 'SysInfo:Requested interface not supported by the provider',
+               no_msg                          : '%s: %s: '
+       };
+
+       /**
+        * Common validator for all functions
+        *       
+        *  
+        * @param {arguments} function name and arguments of calling function
+        * @return {Result} Error object
+        */             
+         function ValidateArguments(funName,criteria,callback)
+         {
+               method = funName;
+
+               try {
+                       if (/^GetNotification$/i.test(funName) && typeof callback != "function") {
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.not_supportedSyncVer);
+                       }
+                       
+                       if (typeof criteria == "undefined" || typeof criteria.Entity == "undefined" || typeof criteria.Key == "undefined") {
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.inSufficientArgs);
+                       }
+                       
+                       if (criteria.Entity == "") {
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.noEntity);
+                       }
+                       
+                       if (criteria.Key == "") {
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.noKey);
+                       }
+                       
+                       if (/^SetInfo$/i.test(funName)) {
+                               if (typeof criteria.SystemData == "undefined" || criteria.SystemData == '') {
+                                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingArgs);
+                               }
+                               if (typeof criteria.SystemData.StringData == "undefined" && typeof criteria.SystemData.Status == "undefined") {
+                                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingArgs);
+                               }
+                       }
+                       
+                       if (typeof supportedEntitiesAndKeys[criteria.Entity.toLowerCase()] == 'undefined' || typeof supportedEntitiesAndKeys[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()] == 'undefined') {
+                               return error(device.implementation.ERR_NOT_FOUND, msg.no_msg);
+                       }
+                       
+                       if (!supportedEntitiesAndKeys[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()][funName]) {
+                               return error(device.implementation.ERR_NOT_FOUND, msg.no_msg);
+                       }
+                       
+                       if (funName == "GetInfo" && !supportedEntitiesAndKeys[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()]["GetInfoModeSync"] && typeof callback != "function") {
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.not_supportedSyncVer);
+                       }
+                       
+                       return context.ErrorResult(device.implementation.ERR_SUCCESS, "");
+               }
+               catch(err){
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType);
+               }
+               
+         }
+
+}) ()
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/script/lib/systeminfo.js b/wrt/misc/rss/preview/script/lib/systeminfo.js
new file mode 100644 (file)
index 0000000..1e5a61a
--- /dev/null
@@ -0,0 +1,107 @@
+/**\r
+       This API is used to provide system related data.\r
+       It takes the sysObject as an argument that is the embeded API in the main HTML file.\r
+       While using this API outside mobile environment, User or developer need not to take any extara action in oprder to support SYSAPI.\r
+*/\r
+\r
+function systemAPI(sysObject)\r
+{\r
+       /*\r
+        *      System Language information services\r
+        */\r
+       sysObject.language = 'EN';\r
+\r
+\r
+\r
+\r
+       /*\r
+        *      Power information services\r
+        */\r
+       \r
+       //      Properties\r
+       sysObject.chargelevel = 5;\r
+       sysObject.chargerconnected = 0;\r
+\r
+       //      Event triggers\r
+       sysObject.onchargelevel = null;\r
+       sysObject.onchargerconnected = null;\r
+\r
+\r
+\r
+       /*\r
+        *      Beep tone control services\r
+        */     \r
+       sysObject.beep = function(frequency, duration){ }\r
+\r
+\r
+\r
+       /*\r
+        *      Network Information services\r
+        */\r
+       \r
+       //      value range between: {0-7}\r
+       sysObject.signalbars = 7;\r
+\r
+       sysObject.networkname = 'No network';\r
+\r
+       //      value range between: {0-7}\r
+       sysObject.networkregistrationstatus = 0;\r
+       \r
+\r
+\r
+       /*\r
+        *      Display and keypad illumination information and control services\r
+        */\r
+\r
+       //      Properties\r
+       sysObject.lightminintensity = 1;\r
+       sysObject.lightmaxintensity = 100;\r
+       sysObject.lightdefaultintensity = 0;\r
+       \r
+       sysObject.lightinfiniteduration = 0;\r
+       sysObject.lightmaxduration = 1;\r
+       sysObject.lightdefaultcycletime = 0;\r
+\r
+       sysObject.lighttargetprimarydisplayandkeyboard = 0x3;\r
+       sysObject.lighttargetsystem = 1;\r
+\r
+       //      functions\r
+       sysObject.lighton       = function(lighttarget, duration, intensity, fadein){   }\r
+       sysObject.lightblink    = function(lighttarget, duration, onduration, offduration, intensity){  }\r
+       sysObject.lightoff      = function(lighttarget, duration, fadeout){     }\r
+\r
+\r
+\r
+       /*\r
+        *      Vibration information and control services\r
+        */\r
+       sysObject.vibraminintensity = 1;\r
+       sysObject.vibramaxintensity = 10;\r
+       sysObject.vibramaxduration = 100;\r
+       \r
+       //      Vibration setting in the user profile is off.\r
+       sysObject.vibrasettings = 2; \r
+\r
+       sysObject.startvibra    = function(duration, intensity){        }\r
+\r
+       sysObject.stopvibra     = function(){   }\r
+\r
+\r
+\r
+\r
+       /*\r
+        *      Memory and file system information services\r
+        */\r
+       sysObject.totalram = 32;        \r
+       sysObject.freeram = 10; \r
+       sysObject.drivelist = 'C';      \r
+\r
+       sysObject.drivesize     = function(drive){      return 64;      }\r
+       \r
+       sysObject.drivefree     = function(drive){      return 32;      }\r
+\r
+}\r
+\r
+\r
+//     make TRUE systeminfo.js script loaded\r
+window.parent.NOKIA.scriptsLoaded.systeminfo = true;
\ No newline at end of file
diff --git a/wrt/misc/rss/preview/script/lib/widget.js b/wrt/misc/rss/preview/script/lib/widget.js
new file mode 100644 (file)
index 0000000..995b147
--- /dev/null
@@ -0,0 +1,301 @@
+/**\r
+ * widget object constructor\r
+ * @param {void}\r
+ *     widget()\r
+ * @return {void}\r
+ */ \r
+\r
+if (typeof window.widget == "undefined" || !window.widget) {\r
+       window.widget = {\r
+               author : 'Nokia WRT Emulation Library',\r
+               //      widget identifier, dummy value\r
+               identifier: 14021981,\r
+               isrotationsupported: true,\r
+               \r
+               //      widget event triggers\r
+               onshow: null,\r
+               onhide: null,\r
+               \r
+               sysInfo: [],\r
+               onload: null,\r
+               opacity: 50,\r
+               interval: 20,\r
+               isFront: false,\r
+               preferenceArray: [],\r
+               preferenceKey: 0\r
+       };\r
+       \r
+       \r
+       /**\r
+        * Launches the browser with the specified url\r
+        * @param {String} url\r
+        *     openURL()\r
+        * @return {Void}\r
+        */\r
+       widget.openURL = function(url){\r
+               if (url) {\r
+                       window.open(url, "New Widget Window", 'height=200 width=250');\r
+               }\r
+       }\r
+       \r
+       \r
+       /**\r
+        * Returns previously stored preference associated with the specified key\r
+        * @param {String} Key preference value to be fetch\r
+        *     preferenceForKey()\r
+        * @return {String} Value\r
+        */\r
+       widget.preferenceForKey = function(key){\r
+\r
+               var name = key; //"Nokia_WRT#" + this.path + "#" + key;\r
+\r
+               var result = _BRIDGE_REF.helper.readCookie(name);\r
+               return result;\r
+       }\r
+       \r
+       \r
+       /**\r
+        * Stores the key associated with the specified preference\r
+        * @param {String} Preference value to be stored\r
+        * @param {String} Key Preference value associated to\r
+        *     setPreferenceForKey()\r
+        * @return {Void}\r
+        */\r
+       widget.setPreferenceForKey = function(preference, key){\r
+               var value;\r
+               //Specifying null for the preference parameter removes the specified key from the preferences\r
+               if (key == null) {\r
+                       if (this.preferenceKey > 0) {\r
+                               this.preferenceKey--;\r
+                       }\r
+                       //delete from cookies\r
+               }\r
+               value = key;//"Nokia_WRT#" + this.path + "#" + key;\r
+               this.preferenceArray[this.preferenceKey] = value;\r
+               \r
+               _BRIDGE_REF.helper.createCookie(value, preference, 240000);\r
+               this.preferenceKey++;\r
+               \r
+               //save cookie for cookies\r
+               _BRIDGE_REF.helper.updateMainCookie(document);\r
+       }\r
+       \r
+       \r
+       \r
+       /**\r
+        * Toggle between Tabbed navigation mode or Cursor mode\r
+        * @param {Boolean} Value\r
+        *     setNavigationEnabled()\r
+        * @return {Void}\r
+        */\r
+       widget.setNavigationEnabled = function(bool){\r
+               //This function can not be used on preview browser\r
+       }\r
+       \r
+       \r
+       \r
+       /**\r
+        * Open S0-Application identified by UID along with the specified params\r
+        * @param {Integer} Uid hexadecimal value to a specified application\r
+        * @param {String} Value\r
+        *     openApplication()\r
+        * @return {Void}\r
+        */\r
+       widget.openApplication = function(Uid, param){\r
+               alert("openApplication function won't be simulated in this application");\r
+       }\r
+       \r
+       \r
+       \r
+       /**\r
+        * Prepares the Widget.to do transition to specified transitionState\r
+        * @param {String} Value Transition state\r
+        *     prepareForTransition()\r
+        * @return {Void}\r
+        */\r
+       widget.prepareForTransition = function(transitionState){\r
+               this.isFront = ("" + transitionState).toLowerCase() != "toback";\r
+               window.document.getElementsByTagName("body")[0].style.opacity = "0.3";\r
+       }\r
+       \r
+       \r
+       \r
+       \r
+       /**\r
+        * Does the animation to make the transition between the specified transitionState\r
+        * @param {Void}\r
+        *     performTransition()\r
+        * @return {Void}\r
+        */\r
+       widget.performTransition = function(){\r
+               var _self = this;\r
+               this.opacity = 0;\r
+               this.interval = window.setInterval(function(){\r
+                       _self.opacity += 0.2;\r
+                       if (_self.opacity > 1) {\r
+                               _self.opacity = 1;\r
+                       }\r
+                       window.document.getElementsByTagName("body")[0].style.opacity = _self.opacity + "";\r
+                       if (_self.opacity >= 1) {\r
+                               window.clearInterval(_self.interval);\r
+                               window.document.getElementsByTagName("body")[0].style.opacity = "1";\r
+                       }\r
+                       //do nothing\r
+               }, 50);\r
+               //do nothing\r
+       }\r
+       \r
+       \r
+       \r
+       \r
+       \r
+       /**\r
+        * Set the preferred screen orientation to landscape.\r
+        * The display will flip if the phone display orientation\r
+        * is portrait and the phone supports landscape mode.\r
+        * @param {Void}\r
+        *     setDisplayLandscape()\r
+        * @return {Void}\r
+        */\r
+       widget.setDisplayLandscape = function(){\r
+               try {\r
+                       if (this.isrotationsupported && _BRIDGE_REF.nokia.emulator.orientationSupports()) {\r
+                               _BRIDGE_REF.nokia.emulator.setMode('landscape');\r
+                       }\r
+               } \r
+               catch (e) {\r
+               }\r
+       }\r
+       \r
+       \r
+       \r
+       \r
+       /**\r
+        * Set the preferred screen orientation to portrait.\r
+        * The display will flip if the phone display orientation\r
+        * is landscape and the phone supports portrait mode.\r
+        * @param {Void}\r
+        *     setDisplayPortrait()\r
+        * @return {Void}\r
+        */\r
+       widget.setDisplayPortrait = function(){\r
+               try {\r
+                       if (this.isrotationsupported && _BRIDGE_REF.nokia.emulator.orientationSupports()) {\r
+                               _BRIDGE_REF.nokia.emulator.setMode('portrait');\r
+                       }\r
+               } \r
+               catch (e) {\r
+               }\r
+       }\r
+       \r
+       /**\r
+        * Allows the definition of a function to be called\r
+        * when a Widget.is displayed\r
+        * @param {Void}\r
+        *     onshow()\r
+        * @return {Void}\r
+        */\r
+       widget.onshow = function(){\r
+               // to be implemented\r
+       }\r
+       \r
+       \r
+       \r
+       \r
+       /**\r
+        * Allows the definition of a function to be called\r
+        * when a Widget.sent into the background (hidden)\r
+        * @param {Void}\r
+        *     onhide()\r
+        * @return {Void}\r
+        */\r
+       widget.onhide = function(){\r
+               // to be implemented\r
+       }\r
+       \r
+       \r
+       \r
+       /**\r
+        * This function returns the System API if sysinfo is included in document embed\r
+        */\r
+       widget.enableSystemApi = function(){\r
+       \r
+               //      Identify, and Attach System-Info-Object properties\r
+               try {\r
+                       var parentIframeRef = window.parent.frames[0];\r
+                       if (typeof parentIframeRef == 'object') {\r
+                               if (parentIframeRef.document.embeds.length > 0) {\r
+                                       for (var i = 0; i < parentIframeRef.document.embeds.length; i++) {\r
+                                               //match the system Info API embed tag\r
+                                               if (parentIframeRef.document.embeds[i].type == 'application/x-systeminfo-widget') {\r
+                                                       new systemAPI(parentIframeRef.document.embeds[i]);\r
+//                                                     widget.sysInfo = parentIframeRef.document.embeds[i];\r
+                                                       \r
+                                                       // hide the <embed> object\r
+                                                       parentIframeRef.document.embeds[i].style.display='none';\r
+                                                       \r
+                                                       // push the reference object into widget\r
+                                                       widget.sysInfo.push(parentIframeRef.document.embeds[i]);\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+               } \r
+               catch (e) {\r
+                       alert('Error in attachSysInfo: ' + e);\r
+               }\r
+       }\r
+       \r
+       /**\r
+        * \r
+        */\r
+       \r
+       widget.triggerListener = function(provider, eventType, data){\r
+               if(widget.sysInfo.length){\r
+                       for(var i=0; i<widget.sysInfo.length; i++){\r
+                               if(provider == "power"){\r
+                                       switch(eventType){\r
+                                               case "chargerconnected" : \r
+                                                                                                 widget.sysInfo[i].chargerconnected = data;\r
+                                                                                                 if(typeof widget.sysInfo[i].onchargerconnected != 'undefined'){\r
+                                                                                                       // widget.sysInfo[i].onchargerconnected();\r
+                                                                                                       setTimeout(widget.sysInfo[i].onchargerconnected, 0);\r
+                                                                                                 }\r
+                                                                                                 break;\r
+\r
+                                               case "chargelevel"              :\r
+                                                                                                 widget.sysInfo[i].chargelevel = data;\r
+                                                                                                 if(typeof widget.sysInfo[i].onchargelevel != 'undefined'){\r
+                                                                                                       // widget.sysInfo[i].onchargelevel();\r
+                                                                                                       setTimeout(widget.sysInfo[i].onchargelevel, 0);\r
+                                                                                                 }\r
+                                                                                                break;\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+       \r
+       //      make TRUE widget.js script loaded\r
+       window.parent.NOKIA.scriptsLoaded.widget = true;\r
+}\r
+\r
+(function(){\r
+\r
+       //      attach the System-Info api specific functionality\r
+       _BRIDGE_REF.helper.addEvent(window, 'load', function(){\r
+               widget.enableSystemApi();\r
+               \r
+       });\r
+\r
+       if (_BRIDGE_REF.nokia) {\r
+               _BRIDGE_REF.nokia.menu.lsk_event = function(){\r
+                       _BRIDGE_REF.nokia.emulator.child.menu.show();\r
+               };\r
+               \r
+               //      Add THIS window Reference on FRAME WINDOW\r
+               //      NOKIA.emulator.child object reference\r
+               _BRIDGE_REF.nokia.emulator.child = window;\r
+               _BRIDGE_REF.nokia.menu.init();\r
+       }       \r
+})()\r
diff --git a/wrt/misc/rss/preview/script/nokia.js b/wrt/misc/rss/preview/script/nokia.js
new file mode 100644 (file)
index 0000000..3dfb9b6
--- /dev/null
@@ -0,0 +1,1490 @@
+/*
+       @chinnapp
+*/
+
+if(typeof NOKIA == "undefined" || !NOKIA) 
+{
+       var NOKIA = {
+               version : 'WRT 1.1',
+               currentDevice : '240x320',
+               mode : 'portrait',
+               resolution : ['240x320', '320x240', '360x640', '800x352'],
+               scriptsLoaded : {
+                       loader : false,
+                       widget : false,
+                       systeminfo : false,
+                       menu   : false,
+                       menuItem : false,
+                       console : false
+               }
+       };
+       NOKIA.namespace = function(name)
+       {
+               var parts = name.split('.');
+               var current = NOKIA;
+               for(var key in parts){
+                       if(!current[parts[key]]){
+                               current[parts[key]] = {};
+                       }
+                       current = current[parts[key]];
+               }  
+       };
+       
+       NOKIA.init = function()
+       {
+               // Not-Supported Browser check
+               NOKIA.emulator.is_browserReady = (/MSIE/i.test(navigator.userAgent));
+               if(NOKIA.emulator.is_browserReady)
+               {
+                       var notSupportedBrowser = NOKIA.helper.readCookie('NOKIA_NOT_SUPPORTED_BROWSER');
+                       if (notSupportedBrowser != 1) {
+                               $("#NotificationDiv")[0].className = 'show';
+                               $("#NotificationDiv").dialog({
+                                       width: 550,
+                                       minWidth: 550,
+                                       minHeight: 350,
+                                       height: 150,
+                                       autoOpen: true,
+                                       position: top,
+                                       title: 'Notification window',
+                                       buttons: {
+                                               Cancel: function(){
+                                                       $("#NotificationDiv").dialog('close');
+                                               },
+                                               Continue: function(){
+                                                       $("#NotificationDiv").dialog('close');
+                                                       NOKIA.helper.createCookie('NOKIA_NOT_SUPPORTED_BROWSER', 1);
+                                                       NOKIA.init();
+                                               }
+                                       }
+                               });
+                               return false;
+                       }else{
+                               $("#BrowserNotificationBar").css({display:'block'});
+                               $("#BrowserNotificationBar > p > a").click(function(){ $("#BrowserNotificationBar").hide(); });
+                       }
+               }
+       
+               $('iframe')[0].src = "wrt_preview_main.html";
+
+               NOKIA.data.load(deviceResolutionList);
+               
+               var url = window.location.toString();                   
+               url = url.split('/');
+               
+               var pointer = 3;
+               if(url[0] == 'http:')
+                       pointer = 2;
+
+               var t = ''; 
+               for(var i=pointer; i<url.length-1; i++){        t = t + url[i] + '/';   }
+               if(url[0] == 'file:')
+                       NOKIA.emulator.url = 'file:///' + t;
+               else
+                       NOKIA.emulator.url = 'http://' + t;
+
+               //      Common Error/Notification Dialog
+               NOKIA.helper.errorDailog = $("#Dialog").dialog({
+                       bgiframe: true, minHeight: 150, width: 450, modal: true, autoOpen: false,
+                       buttons: {      
+                                       Cancel: function(){ $(this).dialog('close');    },                      
+                                       Reload: function(){ 
+                                               $(this).dialog('close');
+                                               $("#loaderDiv").html("Widget is reloading. Please wait...");
+                                               $("#loaderDiv")[0].className = 'green';
+                                               $("#loaderDiv").show();
+                                               window.setTimeout(function(){
+                                                       document.location = document.location;
+                                               }, 3000);
+                                       }                       
+                               }
+               });
+
+               //      validating Info.plist
+               this.helper.getInfo('Info.plist', NOKIA.helper.getInfoCallback);        
+
+               //      For getting Icon.png
+               this.helper.getInfo('Icon.png', NOKIA.helper.getIconCallback);  
+       };
+
+       /*
+        * NOKIA.data
+        */
+       NOKIA.namespace('data.load');
+
+       NOKIA.data.load = function(data){
+               NOKIA.deviceList = data;
+       }
+
+
+
+       /*
+        * NOKIA.emulator
+        */
+       NOKIA.namespace('menu');
+       NOKIA.menu = {
+               is_menu_visible : false,                // true/false
+               is_softkeys_visible : false,    // true : only when MenuItem's are displayed
+               softkeys_visibility : true,             // true/false : for hide/show SFK's
+               is_dimmed : false,
+               is_rsk_overridden : false,
+               log_counter : 1,
+               enable_log : false,
+               rsk_label : '',
+               rsk_event : false,
+               highlighted_item : null,
+               
+               hide : function()
+               {
+                       $("#MenuItemsArea").fadeIn("slow");
+
+                       //      Hide the SFK's If user hidden them from his code
+                       if(NOKIA.menu.softkeys_visibility)
+                               $("#SoftKeysArea").fadeIn("slow");
+                       
+                       NOKIA.menu.is_softkeys_visible = false;
+               },
+
+               log : function(str)
+               {
+                       if(!this.enable_log)
+                               return false;
+                       NOKIA.layout.log("log", NOKIA.menu.log_counter + ' ' +str);
+                       NOKIA.layout.log("log", 'is_rsk_overridden: '+NOKIA.menu.is_rsk_overridden);
+                       NOKIA.layout.log("log", 'rsk_label: '+NOKIA.menu.rsk_label);
+                       NOKIA.layout.log("log", 'rsk_event: '+NOKIA.menu.rsk_event);
+                       
+                       NOKIA.menu.log_counter++;
+               },
+
+               show : function()
+               {
+                       if(NOKIA.menu.is_dimmed)
+                               return false;
+                               
+                       NOKIA.menu.showSoftKeys();
+                       
+                       NOKIA.menu.is_menu_visible = true;
+                       $("#MenuItemsArea").show();
+                       
+                       NOKIA.menu.highlighted_item = $("#MenuItemsArea > ul > li")[0];
+                       NOKIA.menu.highlighted_item.className = 'active';
+
+
+                       $("#MenuItemsArea > ul > li").mouseover(function(){
+                               if(NOKIA.menu.highlighted_item != null)
+                               {
+                                       NOKIA.menu.highlighted_item.className = '';
+                                       NOKIA.menu.highlighted_item = null;
+                               }
+
+                               NOKIA.menu.highlighted_item = this;
+                               NOKIA.menu.highlighted_item.className = 'active';
+                       });
+
+                       $("#SoftKeysArea").mouseout(function(){
+                               if (!NOKIA.menu.is_menu_visible) {
+                                       return false;
+                               }
+                               
+                               if (NOKIA.helper.intervalId) {
+                                       clearInterval(NOKIA.helper.intervalId);
+                               }
+                               NOKIA.helper.intervalId = setTimeout(function(){
+                                       NOKIA.menu.cancel()
+                               }, 500);
+                       });
+
+
+                       //      Change the label "Options" to "Select" to LSK
+                       $("#LskLabel > a")[0].innerHTML = "Select";
+                       NOKIA.menu.setLsk(NOKIA.menu.selectMenu);
+                       
+                       //      Change the label "Exit" to "Cancel" to RSK
+                       $("#RskLabel > a")[0].innerHTML = 'Cancel';
+                       NOKIA.menu.setRsk(NOKIA.menu.cancel);
+                       
+
+                       NOKIA.emulator.setMenuItemsStyle();
+                       
+               },
+               
+               selectMenu : function(){
+                       try {
+                               if(typeof NOKIA.menu.highlighted_item.onclick != 'undefined'){
+                                       eval(NOKIA.menu.highlighted_item.onclick)();
+                               }
+                       } catch (e) {
+                               
+                       }
+//                     NOKIA.menu.cancel();
+               },
+
+               
+               cancel : function()
+               {
+                       if(NOKIA.menu.is_dimmed)
+                               return false;
+                               
+                       NOKIA.menu.hideSoftKeys();
+
+                       NOKIA.menu.is_menu_visible = false;
+                       $("#MenuItemsArea").hide();
+
+                       //      Reset the "OPTION" label to LSK
+                       $("#LskLabel > a")[0].innerHTML = 'Options';
+                       NOKIA.menu.setLsk(NOKIA.emulator.child.menu.show);
+
+                       //      Change the label "CANCEL" to "EXIT" to RSK
+                       if(!NOKIA.menu.is_rsk_overridden)
+                       {
+                               $("#RskLabel > a")[0].innerHTML = 'Exit';
+                               NOKIA.menu.setRsk(NOKIA.menu.exit);     
+                       }
+                       else
+                       {
+                               $("#RskLabel > a")[0].innerHTML = NOKIA.menu.rsk_label;
+                               NOKIA.menu.setRsk(NOKIA.menu.rsk_event);        
+                       }
+                       
+               },
+
+               exit : function()
+               {
+                       if(NOKIA.menu.is_dimmed)
+                               return false;
+                               
+                       if(NOKIA.helper.setHomeScreen())
+                               return false;
+
+                       //      clear the Menu Settings
+                       NOKIA.menu.cancel();
+                       NOKIA.emulator.child.menu.setRightSoftkeyLabel('', null);
+                       NOKIA.emulator.child.menu.items = [];
+                       NOKIA.menu.softkeys_visibility = false;
+                       
+                       // Hide Widget DIV
+                       NOKIA.menu.hideSoftKeys();
+                       NOKIA.menu.setLsk(function(){});
+                       NOKIA.menu.setRsk(function(){});
+                       
+                       $("#WidgetArea").hide();
+
+                       //      Show Icon
+                       var style = NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode]['style'];
+                       $('#IconArea').css({
+                               'width'         :       '100%',
+                               'height'        :       style['widget']['height']+'px',
+                               'float'         :       style['widget']['float']
+                       });
+                       
+                       $('#IconArea')[0].className = NOKIA.mode+NOKIA.currentDevice;
+                       
+                       var img = document.createElement('img');
+                       img.src = NOKIA.emulator.iconFile;
+                       img.border = 0;
+                       
+                       var div = document.createElement('div');
+                       var p = document.createElement('p');
+                       
+                       if(NOKIA.emulator.plist.DisplayName.length <= 12)
+                               p.innerHTML = NOKIA.emulator.plist.DisplayName; 
+                       else
+                               p.innerHTML = NOKIA.emulator.plist.DisplayName.substr(0, 11) + '...' 
+
+                       div.className = 'IconFile';
+                       div.style.marginTop = parseInt(parseInt(style['widget']['height']/2)-80) + 'px';
+                       div.appendChild(img);
+                       img.onclick = function(){
+                               
+                               //      close the console DIV
+                               NOKIA.layout._console_enabled = false;
+                               NOKIA.layout.render();
+                               
+                               $("#loaderDiv").html("Widget is loading. Please wait...");
+                               $("#loaderDiv")[0].className = 'green';
+                               $("#loaderDiv").show();
+                               window.setTimeout(function(){
+                                       document.location = document.location;
+                               }, 3000);
+                               
+                       };
+                       
+                       div.appendChild(p);
+
+                       $("#loaderDiv").html("Click on Icon to Launch Widget");
+                       $("#loaderDiv").show();
+                       $("#loaderDiv")[0].className = 'yellow';
+
+                       $('#IconArea').append(div);
+                       $('#IconArea').show();
+
+                       NOKIA.menu.is_dimmed = true;
+                       
+                       $("#PreferencesBtn").hide();
+                       $("#PreferencesTab").dialog('close');
+                       
+               },
+               
+               setLsk : function(func)
+               {
+                       //      for RSK
+                       $('#LskArea')[0].onclick = function(){
+                               if(!NOKIA.menu.is_dimmed)
+                                       func();
+                       };
+               
+                       $('#LskLabel > a')[0].onclick = function(){
+                               if(!NOKIA.menu.is_dimmed)
+                                       func();
+                       };
+
+                       return true;
+               },
+               
+               setRsk : function(func)
+               {
+                       //      for RSK
+                       $('#RskArea')[0].onclick = function(){
+                               if(!NOKIA.menu.is_dimmed)
+                                       func();
+                       };
+                       
+                       $('#RskLabel > a')[0].onclick = function(){
+                               if(!NOKIA.menu.is_dimmed)
+                                       func();
+                       };
+                       
+                       return true;
+               },
+
+
+               triggerLsk : function(event)
+               {
+                       var callback;
+                       if(NOKIA.mode == 'portrait')
+                               callback = NOKIA.menu.lsk_event;
+                       else if( (NOKIA.mode == 'landscape') && (event.id =='LskLabel') )
+                               callback = NOKIA.menu.lsk_event;
+                       else
+                               callback = NOKIA.menu.rsk_event;
+                       
+                       if(typeof callback == 'function' && !NOKIA.menu.is_dimmed)
+                       {
+                               callback();
+                       }
+               },
+
+               triggerRsk : function(event)
+               {
+                       var callback;
+                       if(NOKIA.mode == 'portrait')
+                               callback = NOKIA.menu.rsk_event;
+                       else if( (NOKIA.mode == 'landscape') && (event.id =='RskLabel') )
+                               callback = NOKIA.menu.rsk_event;
+                       else
+                               callback = NOKIA.menu.lsk_event;
+                       
+                       if(typeof callback == 'function')
+                       {
+                               if(!NOKIA.menu.is_dimmed)
+                               {
+                                       callback();
+                                       NOKIA.menu.cancel();
+                               }
+                       }
+               },
+               
+               render : function()
+               {
+                       if(!NOKIA.menu.softkeys_visibility)
+                               NOKIA.menu.hideSoftKeys();
+                       else
+                               NOKIA.menu.showSoftKeys();
+                       
+                       NOKIA.emulator.setWidgetStyle();
+               },
+               
+
+               init : function()
+               {
+                       NOKIA.menu.render();
+               },
+               
+               createSFKArea : function()
+               {
+                       var a = $('#SoftKeys > a');
+                       a.html('');
+                       
+                       var preferences = NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode];
+                       
+                       var lsk = document.createElement('img');
+                       lsk.border="0";
+                       lsk.id = "LskArea";
+                       lsk.name ="LskArea";
+                       lsk.src = "preview/images/TransperantImage.png";
+                       lsk.style.width = preferences.style.softkeysImg.width; 
+                       lsk.style.height = preferences.style.softkeysImg.height;
+                       
+                       var rsk = document.createElement('img');
+                       rsk.border = 0;
+                       rsk.id = "RskArea";
+                       rsk.name = "RskArea";
+                       rsk.src = "preview/images/TransperantImage.png";
+                       rsk.style.width = preferences.style.softkeysImg.width; 
+                       rsk.style.height = preferences.style.softkeysImg.height;
+
+                       if(NOKIA.mode == 'portrait')
+                       {       
+                               lsk.onclick = function(){
+                                       $("#LskLabel > a").trigger('click');
+                               }
+                               a[0].appendChild(lsk);
+
+                               rsk.onclick = function(){
+                                       $("#RskLabel > a").trigger('click');
+                               }
+                               a[1].appendChild(rsk);
+
+                       }else{
+
+                               rsk.onclick = function(){
+                                       $("#RskLabel > a").trigger('click');
+                               }
+                               a[0].appendChild(rsk);
+
+                               lsk.onclick = function(){
+                                       $("#LskLabel > a").trigger('click');
+                               }
+                               a[1].appendChild(lsk);
+                       }
+                       
+                       
+               },
+
+               showSoftKeys : function()
+               {
+                       NOKIA.menu.is_softkeys_visible = true;
+
+                       NOKIA.emulator.setWidgetStyle();
+                       $("#SoftKeysArea").show();
+               },
+               
+               hideSoftKeys : function()
+               {
+                       //      Hide the SFK's If user hidden them from his code
+                       if(!NOKIA.menu.softkeys_visibility)
+                               $("#SoftKeysArea").hide();
+                       
+                       NOKIA.menu.is_softkeys_visible = false;
+
+                       NOKIA.emulator.setWidgetStyle();
+               }
+       };
+
+
+
+       /*
+        * NOKIA.emulator
+        */
+       NOKIA.namespace('emulator');
+       NOKIA.emulator = {
+               child : false,
+               iconFile : 'preview/images/default-Icon.png',
+               loaded : false,
+               plist : {
+                       DisplayName     :       '',
+                       Identifier      :       '',
+                       MainHTML        :       '',
+                       AllowNetworkAccess      :       "false",
+                       Version         :       '',
+                       MiniViewEnabled         :       "false",
+                       is_browserReady : false
+               },
+               
+               load : function()
+               {
+                       if(this.loaded)
+                               return false;
+                               
+                       //      load the saved device Info
+                       var device = NOKIA.helper.readCookie('NOKIA_EMULATOR_DEVICE');
+                       NOKIA.currentDevice = device || NOKIA.currentDevice;
+
+
+                       //      load the saved device mode
+                       var mode = NOKIA.helper.readCookie('NOKIA_EMULATOR_DEVICE_MODE');
+                       if(mode != null)
+                               NOKIA.mode = mode;
+
+                       //      SAVE the device DATA
+                       NOKIA.helper.createCookie('NOKIA_EMULATOR_DEVICE', NOKIA.currentDevice);
+                       NOKIA.helper.createCookie('NOKIA_EMULATOR_DEVICE_MODE', NOKIA.mode);
+                       
+                       this.loaded = true;
+                       
+               },
+       
+               render : function()
+               {
+                       this.load();
+                       
+                       if(!NOKIA.emulator.orientationSupports())
+                               NOKIA.mode = NOKIA.deviceList[NOKIA.currentDevice]['default'];
+                       
+                       if(typeof NOKIA.deviceList == 'undefined' || typeof NOKIA.deviceList[NOKIA.currentDevice] == 'undefined' || typeof NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode] == 'undefined')
+                       {
+                               alert('Deive resolution: '+NOKIA.currentDevice+' or the mode: '+NOKIA.mode+' not found');
+                               return false;
+                       }
+                       
+                       this.setStyle();
+               },
+               
+               setMode : function(mode)
+               {
+                       NOKIA.mode = mode;
+
+                       //      SAVE the device DATA
+                       NOKIA.helper.createCookie('NOKIA_EMULATOR_DEVICE_MODE', NOKIA.mode);
+
+                       NOKIA.emulator.render();
+               },
+               
+               orientationSupports : function()
+               {
+                       return NOKIA.deviceList[NOKIA.currentDevice]['orientation'];
+               },
+               
+               setStyle:function()
+               {
+                       if(!NOKIA.helper.checkDependencies())
+                       {
+                               setTimeout(NOKIA.emulator.setStyle, 1000);
+                       }
+                       
+                       var deviceProperties = NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode];
+                       var style = deviceProperties['style'];
+
+                       //      Apply Style and propertis to Device layers
+                       $("#DeviceDisplayLayout").css(style['layout']);
+                       $('#DisplayArea').css(style['display']);
+                       
+                       NOKIA.emulator.setWidgetStyle();
+                       
+                       $('#SoftKeysArea').css({
+                               'width' :       style['menu']['width']+'px',
+                               'height'        :       style['menu']['height']+'px',
+                               'float'         :       style['menu']['float']
+                       });
+                       
+                       $('#SoftKeysArea > ul > li').css('width', parseInt(style['menu']['width']/2)-10);
+
+                       
+                       NOKIA.emulator.setMenuItemsStyle();
+                       
+                       $('#SoftKeys').css(style['softkeys']);
+//                     $('#SoftKeys > a > img').css(style['softkeysImg']);
+
+                       NOKIA.menu.createSFKArea();
+                       
+                       $("#DeviceDisplayLayout").show();
+                       $("#PreferencesTab").show();
+                       
+                       if(!NOKIA.menu.is_dimmed)
+                               $("#PreferencesBtn").show();
+               },
+               
+               setWidgetStyle : function()
+               {
+                       var style = NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode]['style'];
+                       var height;
+                       if(NOKIA.menu.softkeys_visibility || NOKIA.menu.is_softkeys_visible)
+                               height = parseInt(style['widget']['height'] - style['menu']['height']);
+                       else
+                               height = style['widget']['height'];
+
+                       $('#WidgetArea').css({
+                               'width'         :       style['widget']['width']+'px',
+                               'height'        :       height+'px',
+                               'float'         :       style['widget']['float']
+                       });
+               },
+               
+               setMenuItemsStyle : function()
+               {
+                       var style       = NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode]['style'];
+                       var count;
+                       try {
+                               count = parseInt(NOKIA.helper.getElementsLengthInObject(NOKIA.emulator.child.menu.items))+1;
+                       } catch (e) {
+                               count = 1;
+                       }
+                       var height      = parseInt(count*style['menu']['optionKeysheight']) + 10;
+                       var top         = parseInt(style['widget']['height'] - height); 
+
+                       $('#MenuItemsArea').css({
+                               'width'         :       style['widget']['width']+'px',
+                               'height'        :       height+'px',
+                               'marginTop'     :       '-2px',
+                               'top'           :       (style['widget']['height']-height-style['menu']['height']+2)+'px',
+                               'position'      :       'relative'
+                       });
+               }
+       };
+
+       /*
+        * NOKIA.helper functions
+        */
+       NOKIA.namespace('helper.loadScript');
+       NOKIA.helper = {
+               path : document.location.pathname,
+               errorDailog     : null,
+               prefDailog : null,
+               intervalId : null,
+               infoPlistCounter : false,
+               IconFileCounter  : false,
+               loadScript : function(path)
+               {
+                       var head = document.getElementsByTagName("head")[0] || document.documentElement;
+                       var script = document.createElement("script");
+       
+                       script.type = "text/javascript";
+                       script.src = src;
+                       head.appendChild( script );
+               },
+
+               loadPreferences : function()
+               {
+                       //      Selecting Resoltion
+                       var resOptions = $("#resOptions")[0];
+                       for(var i=0; i<NOKIA.resolution.length; i++)
+                       {
+                               if(NOKIA.resolution[i] == NOKIA.currentDevice)
+                               {
+                                       resOptions.options[i].selected = true;
+                                       $("#resSupportLink")[0].href = resOptions.options[i].value;
+                                       break;
+                               }                               
+                       }
+                       
+                       //      Selecting Orientation
+                       if(NOKIA.mode == 'portrait')
+                               $('#input_portrait')[0].checked = true;
+                       else
+                               $('#input_landscape')[0].checked = true;
+
+                       if (!NOKIA.emulator.orientationSupports()) {
+                               if (NOKIA.mode == 'portrait') 
+                                       $("#input_landscape")[0].disabled = true;
+                               else 
+                                       $("#input_portrait")[0].disabled = true;
+                                       
+                               $("#Orientation_Info").html("Not supported");
+                               $("#Orientation_Info").show();
+                               $("#Orientation_Controls").hide();
+                       }
+                       else {
+                               $("#input_landscape")[0].disabled = false;
+                               $("#input_portrait")[0].disabled = false;
+
+                               $("#Orientation_Info").hide();
+                               $("#Orientation_Controls").show();
+                       }
+                       
+                       //      Selecting Version
+                       if(NOKIA.version == 'WRT 1.0')
+                               $('#wrt_version_1_0')[0].checked = true;
+                       else
+                               $('#wrt_version_1_1')[0].checked = true;
+                               
+                       //      HomeScreen Support
+                       if(NOKIA.deviceList[NOKIA.currentDevice].homeScreenSupport)
+                       {
+                               if (typeof NOKIA.emulator.plist.MiniViewEnabled != 'undefined') {
+                                       if (NOKIA.emulator.plist.MiniViewEnabled == 'false') 
+                                               $('#HS_Control_Info').html("<span id='wrt-help' onclick='javascipt:NOKIA.helper.showMiniviewHelp();'></span><strong>Not Enabled</strong><br/><small>Click on help to read more about enabling Mini view support</small>");
+                                       else 
+                                               $('#HS_Control_Info').html("Supported");
+                               }
+                               else
+                                       $('#HS_Control_Info').html("<span id='wrt-help'></span>Not Supported");
+
+                               $('#HS_Control_Info').show();
+
+                       }
+                       else
+                       {
+                               $('#HS_Control_Info').html("Not Supported for the selected Device resolution");
+                               $('#HS_Control_Info').show();
+                       }
+               },
+
+               getInfo : function(url, callback)
+               {
+                       try {
+                               var xhr = this.ajax();
+                               
+                               if ((/AppleWebKit/i.test(navigator.userAgent)))
+                                       xhr.open("GET", url, false);
+                               else
+                                       xhr.open("GET", url, true);
+                               
+                               
+                               xhr.onreadystatechange = function() 
+                               {
+                                               // readyState = 4 ; "complete"
+                                               if (xhr.readyState==4)
+                                               {
+                                                       // status = 200 ; "ok"
+                                                       if( (xhr.status == 200) || (!xhr.status) )
+                                                       {
+                                                               callback(true, xhr);
+                                                       }
+                                                       else
+                                                       { 
+                                                               callback(false, xhr);
+                                                       }
+                                               }
+       
+                               }
+                               xhr.send(null);
+                       } catch (e) {
+                               if (e.name == 'NS_ERROR_FILE_NOT_FOUND') {
+                                       callback(false, xhr);
+                               }                       
+                       }
+               },
+
+               getInfoCallback : function(flag, xhr)
+               {
+                       //      If Info.plis NOT FOUND / FAILED LOAD
+                       //      an ERROR!, unable to proceed further
+                       //      STOP there
+                       if(!flag)
+                       {
+                               if(!NOKIA.helper.infoPlistCounter)
+                               {
+                                       NOKIA.helper.infoPlistCounter = true;
+                                       NOKIA.helper.getInfo('info.plist', NOKIA.helper.getInfoCallback);
+                                       return false;
+                               }
+
+                               NOKIA.helper.error('Unable to intialize the widget, failed to process Info.plist file. <br/>Please ensure <strong style="color:#efe352;">Info.plist</strong> file exists on the widget root folder <br/>or check the filename of <strong style="color:#efe352;">Info.plist</strong> It is case-sensitive');
+                               return false;
+                       }
+                       else{
+                               
+                               var xmlString = xhr.responseText;
+                               
+                               // do some cheating here
+                               xmlString = xmlString.replace(/<\s*true\s*\/>/gi, "<string>true</string>");
+                               xmlString = xmlString.replace(/<\s*false\s*\/>/gi, "<string>false</string>");
+       
+                       /*
+                        *      DomParser Logic
+                               var appXml = new DOMParser();
+                               var xmlobject = appXml.parseFromString(xmlString, "text/xml");
+                        */
+                       
+                               //      return the JSON Object
+                               NOKIA.helper.validate(xml2json.parser(xmlString));
+                       }
+                       
+               },
+               
+               getIconCallback : function(flag, xhr)
+               {
+                       
+                       if(!flag)
+                       {
+                               if(!NOKIA.helper.IconFileCounter)
+                               {
+                                       NOKIA.helper.IconFileCounter = true;
+                                       NOKIA.helper.getInfo('icon.png', NOKIA.helper.getIconCallback);
+                                       return false;   
+                               }
+                       }
+                       else
+                               NOKIA.emulator.iconFile =  (NOKIA.helper.IconFileCounter) ? "icon.png" : "Icon.png";
+               },
+               
+
+               validate : function(xmlObject)
+               {
+                       window.xmlObject = xmlObject;
+                       
+                       //      <plist>
+                       if(typeof xmlObject.plist != 'object' || xmlObject.plist == 'undefined')
+                       {
+                               NOKIA.helper.error('Corrupted Info.plist file');
+                               return false;
+                       }
+                       //      <dict>
+                       xmlObject = xmlObject.plist;
+                       if(typeof xmlObject.dict != 'object' || xmlObject.dict == 'undefined')
+                       {
+                               NOKIA.helper.error('Corrupted Info.plist file');
+                               return false;
+                       }
+
+                       //      <key>
+                       xmlObject = xmlObject.dict;
+                       if(typeof xmlObject.key != 'object' || xmlObject.key == 'undefined')
+                       {
+                               NOKIA.helper.error('Corrupted Info.plist file');
+                               return false;
+                       }
+
+                       //      <string>
+                       if(typeof xmlObject.string != 'object' || xmlObject.string == 'undefined')
+                       {
+                               NOKIA.helper.error('Corrupted Info.plist file');
+                               return false;
+                       }
+
+                       //      num of <key> = num of <string>
+                       if(xmlObject.key.length != xmlObject.string.length)
+                       {
+                               NOKIA.helper.error('Corrupted Info.plist file');
+                               return false;
+                       }
+
+                       for(var val in xmlObject.key)
+                       {
+                               if(NOKIA.emulator.plist[xmlObject.key[val]] != 'undefined'){
+                                       NOKIA.emulator.plist[xmlObject.key[val]] = xmlObject.string[val].toString(); 
+                               }
+                       }
+
+                       try {
+                               if(typeof NOKIA.emulator.plist.DisplayName != 'undefined'){
+                                       document.title = NOKIA.emulator.plist.DisplayName + ' - ' + document.title;
+                               }
+                       } catch (e) {}
+
+                       //      Add UI-Event listeners
+                       NOKIA.helper.addListeners();
+                       NOKIA.layout.init();
+                       NOKIA.emulator.render();
+               },
+
+
+               ajax : function() 
+               {
+                       //      xmlHttpRequest object   
+                       var request = null;
+               
+                   // branch for native XMLHttpRequest object
+                   if(window.XMLHttpRequest && !(window.ActiveXObject)) {
+                       try 
+                               {
+                                       request = new XMLHttpRequest();
+                                       try
+                                       {
+                                               //      attach the Bypass code, if the browser is firefox
+                                               if(netscape.security.PrivilegeManager.enablePrivilege)
+                                               {
+                                                       //      duplicate the function
+                                                       request._open = request.open;
+                                                       
+                                                       //      redefine the function definition
+                                                       request.open = function(method, url, flag)
+                                                       {
+                                                               try
+                                                               {
+                                                                       // Enable Universal Browser Read
+                                                                       netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
+               
+                                                                       //      call the native XmlHttpRequest.open method
+                                                                       this._open(method, url, flag);
+                                                               }catch(e)
+                                                               {
+                                                                       //      call the native XmlHttpRequest.open method
+                                                                       this._open(method, url, flag);
+                                                               }
+                                                       }
+                                               }
+                                       }
+                                       catch(e)
+                                       {
+                                               //      eatup all exceptions
+                                       }
+                               } 
+                               catch(e) {
+                                       request = null;
+                       }
+                   // branch for IE/Windows ActiveX version
+                   } else if(window.ActiveXObject) {
+                       try {
+                               request = new ActiveXObject("Msxml2.XMLHTTP");
+                       } catch(e) {
+                               try {
+                                       request = new ActiveXObject("Microsoft.XMLHTTP");
+                               } catch(e) {
+                                       alert('Failed to create XmlHttprequest');
+                                               return null;
+                               }
+                               }
+                   }
+                       
+                       return (request);
+               },
+
+               error : function(msg)
+               {
+                       if(NOKIA.menu.enable_log)
+                               NOKIA.layout.log("log", msg);
+                       
+                       $("#Dialog").html(msg);
+                       $("#Dialog").dialog('open');
+               },
+
+               createCookie : function(name,value) 
+               {
+                       var days = 240000;
+                   if (days) {
+                               var date = new Date();
+                               date.setTime(date.getTime()+(days*24*60*60*1000));
+                               var expires = "; expires="+date.toGMTString();
+                       }
+                       else var expires = "";
+                       var value = "Nokia_WRT#"+NOKIA.helper.path+"#"+name+"="+value;
+                       document.cookie = value+expires+"; Emulator.path=/"
+               },
+               
+               readCookie : function(name) 
+               {
+                       name = "Nokia_WRT#" + NOKIA.helper.path + "#" + name;           
+                       var nameEQ = name + "=";
+                       var ca = document.cookie.split(';');
+                       for(var i=0;i < ca.length;i++) {
+                               var c = ca[i];
+                               while (c.charAt(0)==' ') c = c.substring(1,c.length);
+                               if (c.indexOf(nameEQ) == 0) {
+                                       return c.substring(nameEQ.length,c.length);
+                               }
+                       }
+                       return undefined;
+               },
+
+               toggle : function(ele)
+               {
+                       if (NOKIA.emulator.orientationSupports()) {
+//                             var mode = (NOKIA.mode == 'portrait') ? 'landscape' : 'portrait';
+                               NOKIA.emulator.setMode(ele.value);
+                       }
+                       else
+                       {       
+                               ele.checked = false;
+                               if(ele.value == 'portrait')
+                                       $("#input_landscape")[0].checked = true;
+                               else
+                                       $("#input_portrait")[0].checked = true;
+                       }
+               },
+
+               version : function(ele)
+               {
+                       if (confirm('Would you like to reload the widget to apply the changes on the Version settings?')) 
+                       {
+                               NOKIA.helper.createCookie('_WRT_VERSION', ele.value);
+                               $("#loaderDiv").html("Applying the " + ele.value + ", please wait...");
+                               $("#loaderDiv").show();
+                               $("#loaderDiv")[0].className = 'green';
+                               
+                               $("#PreferencesTab").dialog('close');
+                               
+                               window.setTimeout(function(){
+                                       document.location = document.location;
+                               }, 3000);
+                       }
+                       else
+                       {
+                               ele.checked = false;
+                               if(ele.value != 'WRT 1.0')
+                                       $("#wrt_version_1_0")[0].checked = true;
+                               else
+                                       $("#wrt_version_1_1")[0].checked = true;
+                       }
+               },
+
+               addListeners : function()
+               {
+                       /*
+                        * Render Emulator for Interaction
+                        */
+                       NOKIA.helper.prefDailog = $("#PreferencesTab").dialog({
+                                       width: 550,     minWidth: 550, minHeight: 350, height: 350, autoOpen: false, position : top, title : '&nbsp;',
+                                       buttons : {
+                                               Close : function(){
+                                                       $("#PreferencesTab").dialog('close');
+
+                                                       //      Hack for Mac firefox
+                                                       if(/Mac/i.test(navigator.userAgent))
+                                                       {
+                                                               $("#WidgetArea iframe").css({overflow:'auto'});
+                                                       }
+                                                       
+                                                       //      select index : 0 tab selected
+                                                       $('#tabs').tabs( 'select' , 0);
+                                               }
+                                       }
+                               });
+                               
+                       $('#PreferencesBtn').click(function(){
+                               //      Load preferences
+                               NOKIA.helper.loadPreferences();
+                               $('#PreferencesTab').dialog('open');
+
+                               //      Hack for Mac firefox
+                               if(/Mac/i.test(navigator.userAgent))
+                               {
+                                       $("#WidgetArea iframe").css({overflow:'hidden'});
+                               }
+                       });
+                       
+                       $('#input_portrait').change(function(){
+                               NOKIA.helper.toggle(this);
+                       });
+
+                       $('#input_landscape').change(function(){
+                               NOKIA.helper.toggle(this);
+                       });
+
+                       $('#resOptions').change(function(ele){
+                               ele = ele.target || this;
+                               
+                               NOKIA.currentDevice = ele.options[ele.selectedIndex].text;
+                               $("#resSupportLink")[0].href = ele.value;
+               
+                               //      SAVE the device DATA
+                               NOKIA.helper.createCookie('NOKIA_EMULATOR_DEVICE', NOKIA.currentDevice);
+               
+                               NOKIA.emulator.render();
+                               NOKIA.helper.loadPreferences();
+                       });
+
+                       //      Hack for Mac firefox
+                       if (/Mac/i.test(navigator.userAgent)) {
+                               if (!(/AppleWebKit/i.test(navigator.userAgent))) {
+                                       $("#resOptions")[0].size = '4';
+                               }
+                       }
+
+
+                       //      WRT Version controls
+                       $('#wrt_version_1_0').change(function(){
+                               NOKIA.helper.version(this);
+                       });
+                       
+                       $('#wrt_version_1_1').change(function(){
+                               NOKIA.helper.version(this);
+                       });
+
+
+                       $("#orientationIcon").click(function(){
+                               var mode = (NOKIA.mode == 'portrait') ? 'landscape' : 'portrait';
+                               NOKIA.emulator.setMode(mode);
+                               $("#WidgetArea")[0].className = 'hs_'+NOKIA.mode;
+                       });
+
+
+                       $("#iframeMask").click(function(){
+
+                               $("#PreferencesBtn").show();
+                               $("#orientationIcon").hide();
+                               $("#iframeMask").hide();
+                               $("#loaderDiv").hide();
+
+                               NOKIA.menu.is_dimmed = false;
+                               
+                               $("#WidgetArea")[0].className = '';
+                               
+                               NOKIA.menu.softkeys_visibility = true;
+                               NOKIA.menu.showSoftKeys();
+
+                       });
+
+
+                       //      MenuItems DIV events
+                       $("#MenuItemsArea").mouseover(function(){
+                               if(NOKIA.helper.intervalId)
+                                       clearInterval(NOKIA.helper.intervalId);
+
+                               $("#MenuItemsArea").show();
+                       });
+
+                       $("#MenuItemsArea").mouseout(function(){
+                               if(NOKIA.helper.intervalId)
+                                       clearInterval(NOKIA.helper.intervalId);
+
+                               NOKIA.helper.intervalId = setTimeout(function(){
+                                       NOKIA.menu.cancel()
+                               }, 500);
+                       });
+
+
+                       // Tabs
+                       $('#tabs').tabs({
+                               select : function(event, ui){
+                                       if(parseInt(ui.index) == 1)
+                                       {
+                                               $("#event-icons").show();
+                                               $("#event-battery-info").hide();
+                                               $("#event-messaging-info").hide();
+                                               $("#event-memory-info").hide();
+                                               
+                                               //      WRT versionn check
+                                               if(NOKIA.version == 'WRT 1.1')
+                                               {
+                                                       $("#event-messaging")[0].className = 'active';
+                                                       $("#event-memory")[0].className = 'active';
+                                               }else
+                                               {
+                                                       $("#event-messaging")[0].className = 'inactive';
+                                                       $("#event-memory")[0].className = 'inactive';
+                                               }
+                                               $("#event-battery")[0].className = 'active';
+                                       }else if(parseInt(ui.index) == 0)
+                                       {
+                                               $("#settings-view").show();
+                                               $("#mini-view-info").hide();
+                                       }
+                               }
+                       });
+
+                       
+                       /*      
+                        *      Event triggering
+                        */
+                       
+                       //      for battery
+                       $("#event-battery").click(function(event){
+                               if(event.target.className == 'active')
+                               {
+                                       $("#event-icons").hide();
+                                       $("#event-battery-info").show();
+
+/*
+                               $('#slider').slider('option', 'value', NOKIA.emulator.child._BRIDGE_REF.helper.getBatteryStrength());
+                               NOKIA.emulator.child._BRIDGE_REF.helper.getBatteryStrength()
+                               $('#slider').slider('option', 'value', 10);
+                               $('#slider').slider();
+*/
+                               }
+                       });
+
+                       $("#event-battery-back").click(function(event){
+                               $("#event-icons").show();
+                               $("#event-battery-info").hide();
+                       });
+
+
+                       //      for messaging
+                       $("#event-messaging").click(function(event){
+                               if(event.target.className == 'active')
+                               {
+                                       $("#event-icons").hide();
+                                       $("#event-messaging-info").show();
+                               }
+                       });
+
+                       $("#event-messaging-back").click(function(event){
+                               $("#event-icons").show();
+                               $("#event-messaging-info").hide();
+                       });
+
+
+                       //      for memory
+                       $("#event-memory").click(function(event){
+                               if(event.target.className == 'active')
+                               {
+                                       $("#event-icons").hide();
+                                       $("#event-memory-info").show();
+                               }
+                       });
+
+                       $("#event-memory-back").click(function(event){
+                               $("#event-icons").show();
+                               $("#event-memory-info").hide();
+                       });
+
+
+                       //      for minView more info
+                       $("#mini-view-back").click(function(event){
+                               $("#settings-view").show();
+                               $("#mini-view-info").hide();
+                       });
+
+
+                       // Slider
+                       $('#slider').slider({
+                               range: true,
+                               min : 0,
+                               max : 100,
+                               step : 1,
+                               value : 10,
+                               animate: true,
+                               slide: function(event, ui) {
+                                       $("#slider-value-panel > span").html(ui.value.toString());
+                               }
+                               });
+
+                       //      Bind Buttons to trigger values to WRT 1.0 / 1.1 bindings
+                       
+                       $("#connect-charger").click(NOKIA.helper.triggerEvents);
+                       $("#disconnect-charger").click(NOKIA.helper.triggerEvents);
+                       $("#update-batter-strength").click(NOKIA.helper.triggerEvents);
+
+                       $("#send-sms").click(NOKIA.helper.triggerEvents);
+                       $("#send-mms").click(NOKIA.helper.triggerEvents);
+
+                       $("#connect-memory-card").click(NOKIA.helper.triggerEvents);
+                       $("#disconnect-memory-card").click(NOKIA.helper.triggerEvents);
+                       
+               },
+               
+               setHomeScreen : function()
+               {
+                       //      HomeScreen Support
+                       if (NOKIA.deviceList[NOKIA.currentDevice].homeScreenSupport) {
+
+                               if (typeof NOKIA.emulator.plist.MiniViewEnabled != 'undefined') {
+                                       if (NOKIA.emulator.plist.MiniViewEnabled != 'false') 
+                                       {
+                                               $("#WidgetArea")[0].className = 'hs_' + NOKIA.mode;
+                                               
+                                               //      menu handlining
+                                               NOKIA.menu.softkeys_visibility = false;
+                                               NOKIA.menu.cancel();
+                                               NOKIA.menu.is_dimmed = true;
+                                               
+
+                                               $("#loaderDiv").html("Click on widget for Return to Full view");
+                                               $("#loaderDiv")[0].className = 'green';
+                                               $("#loaderDiv").show();
+
+                                               $("#iframeMask").show();
+                                               $("#orientationIcon").show();
+                                               $("#PreferencesBtn").hide();
+
+                                               $("#PreferencesTab").dialog('close');
+                                               return true;
+                                       }
+                               }
+                       }
+                       return false;                   
+               },
+               
+               getElementsLengthInObject : function(items){
+                       var count = 0;
+                       for (var i in items) 
+                       {
+                               if(!items[i].isDimmed)
+                                       count++;
+                       }
+                       
+                       return count;
+               },
+               
+               triggerEvents : function(event)
+               {
+                       if(typeof event.target.id == 'undefined')
+                       return false;
+                       
+                       switch(event.target.id)
+                       {
+                               //      for battery
+                               case 'connect-charger': 
+                                                                               NOKIA.helper.trigger("power", "chargerconnected", 1);
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.SysInfo", "Battery.ChargingStatus", {Status: 1});
+                                                                               break;
+
+                               case 'disconnect-charger': 
+                                                                               NOKIA.helper.trigger("power", "chargerconnected", 0);
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.SysInfo", "Battery.ChargingStatus", {Status: 0});
+                                                                               break;
+
+                               case 'update-batter-strength': 
+                                                                               var chargeValue = parseInt($('#slider').slider('value'));
+                                                                               NOKIA.helper.trigger("power", "chargelevel", chargeValue);
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.SysInfo", "Battery.BatteryStrength", {Status: chargeValue});
+                                                                               break;
+
+                               //      for messaging
+                               case 'send-sms': 
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.Messaging", "NewMessage", {MessageType: 'SMS'});
+                                                                               break;
+                               case 'send-mms': 
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.Messaging", "NewMessage", {MessageType: 'MMS'});
+                                                                               break;
+
+                               //      for memory
+                               case 'connect-memory-card': 
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.SysInfo", "Memory.MemoryCard", {Status: 1});
+                                                                               break;
+                               case 'disconnect-memory-card': 
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.SysInfo", "Memory.MemoryCard", {Status: 0});
+                                                                               break;
+                       }
+               },      
+
+               triggerSapi : function(provider, eventType, data){
+                       NOKIA.emulator.child.device.implementation.triggerListener(provider, eventType, data);
+               },      
+
+               trigger : function(provider, eventType, data){
+                       NOKIA.emulator.child.widget.triggerListener(provider, eventType, data);
+               },
+               
+               showMiniviewHelp : function(){
+                       $("#settings-view").hide();
+                       $("#mini-view-info").show();
+               },
+               
+               checkDependencies : function(){
+                       
+                       for(var key in NOKIA.scriptsLoaded)
+                       {
+                               if(!NOKIA.scriptsLoaded[key])
+                                       return false;
+                       }
+
+                       //      for LSK
+                       NOKIA.menu.setLsk(NOKIA.emulator.child.menu.show);
+               
+                       //      for RSK
+                       NOKIA.menu.setRsk(NOKIA.menu.exit);
+
+                       return true;
+               }
+       };
+       
+
+       /*
+        * NOKIA.layout functions
+        */
+       NOKIA.namespace('layout');
+       NOKIA.layout = {
+               _console_minimized : true,
+               _console_enabled : false,
+               _consoleWindowHeight : 200,
+               _consoleHeaderHeight : 31,
+
+               init : function(){
+                       
+                       //      Toggle console window
+                       $('#Console-Toggle-Button').click(function(){
+                               
+                               NOKIA.layout._console_minimized = (NOKIA.layout._console_minimized) ? false : true;
+                               NOKIA.layout.render();
+                       });
+                       
+                       // clear Log
+                       $("#Console-Clear-Button").click(function(){
+                               $("#preview-ui-bottom-body")[0].innerHTML = '';
+                       });
+
+
+                       $('#preview-ui-bottom').show();
+                       NOKIA.layout.render();
+               },
+               
+               log : function(type, msg){
+                       var p = document.createElement('p');
+                       p.className = type;
+                       p.innerHTML = msg;
+                       var divBody = $('#preview-ui-bottom-body')
+                       divBody.append(p);
+                       divBody[0].scrollTop = divBody[0].scrollHeight;
+               },
+               
+               
+               render : function(){
+                       var _width = parseInt(window.innerWidth);
+                       var _height = parseInt(window.innerHeight);
+                       
+                       if(!NOKIA.layout._console_enabled)
+                       {
+                               $('#preview-ui-bottom').css({
+                                       display: 'none'
+                               });
+                               
+                               $('#preview-ui-top').css({
+                                       height: _height+'px'
+                               });
+
+                               return false;
+                       }
+                       
+                       
+                       if(!NOKIA.layout._console_minimized)
+                       {
+                               $('#Console-Toggle-Button')[0].className = 'open';
+                               
+                               //      set STYLE details for TOP window
+                               $('#preview-ui-top').css({
+                                       height: parseInt(_height - NOKIA.layout._consoleWindowHeight) + 'px'
+                               });
+                               
+                               //      set STYLE details for Bottom window
+                               $('#preview-ui-bottom').css({
+                                       height: NOKIA.layout._consoleWindowHeight + 'px',
+                                       display : 'block'
+                               });
+
+                               $('#preview-ui-bottom-header').css({
+                                       height: NOKIA.layout._consoleHeaderHeight + 'px'
+                               });
+
+                               $('#preview-ui-bottom-body').css({
+                                       height: parseInt(NOKIA.layout._consoleWindowHeight - NOKIA.layout._consoleHeaderHeight) + 'px',
+                                       display : 'block'
+                               });
+                               
+                               // Auto scroll when console window opened from MINIMIZED => MAXIMIZED state
+                               window.setTimeout(function(){
+                                       $('#preview-ui-bottom-body')[0].scrollTop = $('#preview-ui-bottom-body')[0].scrollHeight;
+                               }, 100);
+                               
+                       }else{
+                               $('#Console-Toggle-Button')[0].className = 'close';
+
+                               //      set STYLE details for TOP window
+                               $('#preview-ui-top').css({
+                                       height: parseInt(_height - NOKIA.layout._consoleHeaderHeight) + 'px'
+                               });
+                               
+                               //      set STYLE details for Bottom window
+                               $('#preview-ui-bottom').css({
+                                       height: NOKIA.layout._consoleHeaderHeight + 'px',
+                                       display : 'block'
+                               });
+
+                               $('#preview-ui-bottom-header').css({
+                                       height: NOKIA.layout._consoleHeaderHeight + 'px',
+                                       display : 'block'
+                               });
+
+                               $('#preview-ui-bottom-body').css({
+                                       display : 'none'
+                               });
+                       }
+               }
+               
+       };
+}
+
+$(document).ready(function () {
+       NOKIA.init();   
+});
+
+window.onresize = NOKIA.layout.render;
diff --git a/wrt/misc/rss/preview/script/resolution.js b/wrt/misc/rss/preview/script/resolution.js
new file mode 100644 (file)
index 0000000..0f91f61
--- /dev/null
@@ -0,0 +1,303 @@
+/*\r
+ * Device Resolution details\r
+ */\r
+var deviceResolutionList = {\r
+       '240x320'       :       {\r
+               'default'                       :       'portrait',\r
+               'orientation'           :       true,\r
+               'homeScreenSupport'     :       false,\r
+               'fontSize'                      :       '12px',\r
+               'portrait'      :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/240x320/Portrait.png)',\r
+                                       'width'                         : '600px',\r
+                                       'height'                        : '536px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '240px',\r
+                                       'height'        :       '320px',\r
+                                       'paddingTop':   '108px',\r
+                                       'marginLeft':   'auto'                          \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       240,\r
+                                       'height'        :       320,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       240,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '240px',\r
+                                       'height':       '50px',\r
+                                       'left'  :       '0px',\r
+                                       'top'   :       '0px',\r
+                                       'position':     'relative'\r
+                               },\r
+                               'softkeysImg' : {\r
+                                       'width' :       "50%",\r
+                                       'height':       "100%"\r
+                               }\r
+                       }\r
+               },\r
+               'landscape'     :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/240x320/Landscape.png)',\r
+                                       'width'                         : '848px',\r
+                                       'height'                        : '408px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '320px',\r
+                                       'height'        :       '240px',\r
+                                       'paddingTop':   '84px',\r
+                                       'marginLeft':   'auto'                          \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       320,\r
+                                       'height'        :       240,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       320,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '50px',\r
+                                       'height':       '240px',\r
+                                       'left'  :       '200px',\r
+                                       'top'   :       '-250px',\r
+                                       'position':     'relative'\r
+                               },      \r
+                               'softkeysImg' : {\r
+                                       'width' :       "100%",\r
+                                       'height':       "50%"\r
+                               }\r
+                       }\r
+               }\r
+       },\r
+\r
+       '320x240'       :       {\r
+               'default'                       :       'portrait',\r
+               'orientation'           :       true,\r
+               'homeScreenSupport'     :       false,\r
+               'fontSize'                      :       '12px',\r
+               'portrait'      :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/320x240/Portrait.png)',\r
+                                       'width'                         : '640px',\r
+                                       'height'                        : '472px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '320px',\r
+                                       'height'        :       '240px',\r
+                                       'paddingTop':   '113px',\r
+                                       'marginLeft':   '163px'                         \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       320,\r
+                                       'height'        :       240,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       320,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '320px',\r
+                                       'height':       '38px',\r
+                                       'left'  :       '0px',\r
+                                       'top'   :       '0px',\r
+                                       'position':     'relative'\r
+                               },\r
+                               'softkeysImg' : {\r
+                                       'width' :       "50%",\r
+                                       'height':       "100%"\r
+                               }\r
+                       }\r
+               },\r
+               'landscape'     :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/320x240/Landscape.png)',\r
+                                       'width'                         : '680px',\r
+                                       'height'                        : '472px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '240px',\r
+                                       'height'        :       '320px',\r
+                                       'paddingTop':   '76px',\r
+                                       'marginLeft':   '223px'                         \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       240,\r
+                                       'height'        :       320,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       240,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '30px',\r
+                                       'height':       '320px',\r
+                                       'left'  :       '150px',\r
+                                       'top'   :       '-330px',\r
+                                       'position':     'relative'\r
+                               },      \r
+                               'softkeysImg' : {\r
+                                       'width' :       "100%",\r
+                                       'height':       "50%"\r
+                               }\r
+                       }\r
+               }\r
+       },\r
+\r
+       '360x640'       :       {\r
+               'default'                       :       'portrait',\r
+               'orientation'           :       true,\r
+               'homeScreenSupport'     :       true,\r
+               'fontSize'                      :       '12px',\r
+               'portrait'      :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/360x640/Portrait.png)',\r
+                                       'width'                         : '678px',\r
+                                       'height'                        : '838px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '360px',\r
+                                       'height'        :       '640px',\r
+                                       'paddingTop':   '89px',\r
+                                       'marginLeft':   '158px'                         \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       360,\r
+                                       'height'        :       640,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       360,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '360px',\r
+                                       'height':       '50px',\r
+                                       'left'  :       '0px',\r
+                                       'top'   :       '0px',\r
+                                       'position':     'relative',\r
+                                       'marginLeft' : '159px'\r
+                               },\r
+                               'softkeysImg' : {\r
+                                       'width' :       "50%",\r
+                                       'height':       "100%"\r
+                               },\r
+                               'homeScreenDisplay':    {\r
+                                       'width'         :       '306px',\r
+                                       'height'        :       '76px'\r
+                               }\r
+                       }\r
+               },\r
+               'landscape'     :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/360x640/Landscape.png)',\r
+                                       'width'                         : '1054px',\r
+                                       'height'                        : '572px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '640px',\r
+                                       'height'        :       '360px',\r
+                                       'paddingTop':   '104px',\r
+                                       'marginLeft':   '206px'                         \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       640,\r
+                                       'height'        :       360,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       640,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '50px',\r
+                                       'height':       '360px',\r
+                                       'left'  :       '350px',\r
+                                       'top'   :       '-370px',\r
+                                       'position':     'relative',\r
+                                       'marginLeft':   'auto'  \r
+                               },      \r
+                               'softkeysImg' : {\r
+                                       'width' :       "100%",\r
+                                       'height':       "50%"\r
+                               },\r
+                               'homeScreenDisplay':    {\r
+                                       'width'         :       '306px',\r
+                                       'height'        :       '76px'\r
+                               }\r
+                       }\r
+               }\r
+       },\r
+\r
+       '800x352'       :       {\r
+               'default'                       :       'landscape',\r
+               'orientation'           :       false,\r
+               'homeScreenSupport'     :       false,\r
+               'fontSize'                      :       '12px',\r
+               'landscape'     :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/800x352/Landscape.png)',\r
+                                       'width'                         : '1180px',\r
+                                       'height'                        : '572px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '800px',\r
+                                       'height'        :       '352px',\r
+                                       'paddingTop':   '108px',\r
+                                       'marginLeft':   '190px'                         \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       800,\r
+                                       'height'        :       352,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       800,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '50px',\r
+                                       'height':       '352px',\r
+                                       'left'  :       '432px',\r
+                                       'top'   :       '-364px',\r
+                                       'position':     'relative',\r
+                                       'marginLeft':   'auto'  \r
+                               },      \r
+                               'softkeysImg' : {\r
+                                       'width' :       "100%",\r
+                                       'height':       "50%"\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+\r
+};\r
diff --git a/wrt/misc/rss/preview/script/xml2json.js b/wrt/misc/rss/preview/script/xml2json.js
new file mode 100644 (file)
index 0000000..750548f
--- /dev/null
@@ -0,0 +1,172 @@
+/*\r
+xml2json v 1.1\r
+copyright 2005-2007 Thomas Frank\r
+\r
+This program is free software under the terms of the \r
+GNU General Public License version 2 as published by the Free \r
+Software Foundation. It is distributed without any warranty.\r
+*/\r
+\r
+var xml2json={ \r
+       parser:function(xmlcode,ignoretags,debug){\r
+               if(!ignoretags){ignoretags=""};\r
+               xmlcode=xmlcode.replace(/\s*\/>/g,'/>');\r
+               xmlcode=xmlcode.replace(/<\?[^>]*>/g,"").replace(/<\![^>]*>/g,"");\r
+               if (!ignoretags.sort){ignoretags=ignoretags.split(",")};\r
+               var x=this.no_fast_endings(xmlcode);\r
+               x=this.attris_to_tags(x);\r
+               x=escape(x);\r
+               x=x.split("%3C").join("<").split("%3E").join(">").split("%3D").join("=").split("%22").join("\"");\r
+               for (var i=0;i<ignoretags.length;i++){\r
+                       x=x.replace(new RegExp("<"+ignoretags[i]+">","g"),"*$**"+ignoretags[i]+"**$*");\r
+                       x=x.replace(new RegExp("</"+ignoretags[i]+">","g"),"*$***"+ignoretags[i]+"**$*")\r
+               };\r
+               x='<JSONTAGWRAPPER>'+x+'</JSONTAGWRAPPER>';\r
+               this.xmlobject={};\r
+               var y=this.xml_to_object(x).jsontagwrapper;\r
+               if(debug){y=this.show_json_structure(y,debug)};\r
+               return y\r
+       },\r
+       xml_to_object:function(xmlcode){\r
+               var x=xmlcode.replace(/<\//g,"§");\r
+               x=x.split("<");\r
+               var y=[];\r
+               var level=0;\r
+               var opentags=[];\r
+               for (var i=1;i<x.length;i++){\r
+                       var tagname=x[i].split(">")[0];\r
+                       opentags.push(tagname);\r
+                       level++\r
+                       y.push(level+"<"+x[i].split("§")[0]);\r
+                       while(x[i].indexOf("§"+opentags[opentags.length-1]+">")>=0){level--;opentags.pop()}\r
+               };\r
+               var oldniva=-1;\r
+               var objname="this.xmlobject";\r
+               for (var i=0;i<y.length;i++){\r
+                       var preeval="";\r
+                       var niva=y[i].split("<")[0];\r
+                       var tagnamn=y[i].split("<")[1].split(">")[0];\r
+                       tagnamn=tagnamn.toLowerCase();\r
+                       var rest=y[i].split(">")[1];\r
+                       if(niva<=oldniva){\r
+                               var tabort=oldniva-niva+1;\r
+                               for (var j=0;j<tabort;j++){objname=objname.substring(0,objname.lastIndexOf("."))}\r
+                       };\r
+                       objname+="."+tagnamn;\r
+                       var pobject=objname.substring(0,objname.lastIndexOf("."));\r
+                       if (eval("typeof "+pobject) != "object"){preeval+=pobject+"={value:"+pobject+"};\n"};\r
+                       var objlast=objname.substring(objname.lastIndexOf(".")+1);\r
+                       var already=false;\r
+                       for (k in eval(pobject)){if(k==objlast){already=true}};\r
+                       var onlywhites=true;\r
+                       for(var s=0;s<rest.length;s+=3){\r
+                               if(rest.charAt(s)!="%"){onlywhites=false}\r
+                       };\r
+                       if (rest!="" && !onlywhites){\r
+                               if(rest/1!=rest){\r
+                                       rest="'"+rest.replace(/\'/g,"\\'")+"'";\r
+                                       rest=rest.replace(/\*\$\*\*\*/g,"</");\r
+                                       rest=rest.replace(/\*\$\*\*/g,"<");\r
+                                       rest=rest.replace(/\*\*\$\*/g,">")\r
+                               }\r
+                       } \r
+                       else {rest="{}"};\r
+                       if(rest.charAt(0)=="'"){rest='unescape('+rest+')'};\r
+                       if (already && !eval(objname+".sort")){preeval+=objname+"=["+objname+"];\n"};\r
+                       var before="=";after="";\r
+                       if (already){before=".push(";after=")"};\r
+                       var toeval=preeval+objname+before+rest+after;\r
+                       eval(toeval);\r
+                       if(eval(objname+".sort")){objname+="["+eval(objname+".length-1")+"]"};\r
+                       oldniva=niva\r
+               };\r
+               return this.xmlobject\r
+       },\r
+       show_json_structure:function(obj,debug,l){\r
+               var x='';\r
+               if (obj.sort){x+="[\n"} else {x+="{\n"};\r
+               for (var i in obj){\r
+                       if (!obj.sort){x+=i+":"};\r
+                       if (typeof obj[i] == "object"){\r
+                               x+=this.show_json_structure(obj[i],false,1)\r
+                       }\r
+                       else {\r
+                               if(typeof obj[i]=="function"){\r
+                                       var v=obj[i]+"";\r
+                                       //v=v.replace(/\t/g,"");\r
+                                       x+=v\r
+                               }\r
+                               else if(typeof obj[i]!="string"){x+=obj[i]+",\n"}\r
+                               else {x+="'"+obj[i].replace(/\'/g,"\\'").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")+"',\n"}\r
+                       }\r
+               };\r
+               if (obj.sort){x+="],\n"} else {x+="},\n"};\r
+               if (!l){\r
+                       x=x.substring(0,x.lastIndexOf(","));\r
+                       x=x.replace(new RegExp(",\n}","g"),"\n}");\r
+                       x=x.replace(new RegExp(",\n]","g"),"\n]");\r
+                       var y=x.split("\n");x="";\r
+                       var lvl=0;\r
+                       for (var i=0;i<y.length;i++){\r
+                               if(y[i].indexOf("}")>=0 || y[i].indexOf("]")>=0){lvl--};\r
+                               tabs="";for(var j=0;j<lvl;j++){tabs+="\t"};\r
+                               x+=tabs+y[i]+"\n";\r
+                               if(y[i].indexOf("{")>=0 || y[i].indexOf("[")>=0){lvl++}\r
+                       };\r
+                       if(debug=="html"){\r
+                               x=x.replace(/</g,"&lt;").replace(/>/g,"&gt;");\r
+                               x=x.replace(/\n/g,"<BR>").replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;")\r
+                       };\r
+                       if (debug=="compact"){x=x.replace(/\n/g,"").replace(/\t/g,"")}\r
+               };\r
+               return x\r
+       },\r
+       no_fast_endings:function(x){\r
+               x=x.split("/>");\r
+               for (var i=1;i<x.length;i++){\r
+                       var t=x[i-1].substring(x[i-1].lastIndexOf("<")+1).split(" ")[0];\r
+                       x[i]="></"+t+">"+x[i]\r
+               }       ;\r
+               x=x.join("");\r
+               return x\r
+       },\r
+       attris_to_tags: function(x){\r
+               var d=' ="\''.split("");\r
+               x=x.split(">");\r
+               for (var i=0;i<x.length;i++){\r
+                       var temp=x[i].split("<");\r
+                       for (var r=0;r<4;r++){temp[0]=temp[0].replace(new RegExp(d[r],"g"),"_jsonconvtemp"+r+"_")};\r
+                       if(temp[1]){\r
+                               temp[1]=temp[1].replace(/'/g,'"');\r
+                               temp[1]=temp[1].split('"');\r
+                               for (var j=1;j<temp[1].length;j+=2){\r
+                                       for (var r=0;r<4;r++){temp[1][j]=temp[1][j].replace(new RegExp(d[r],"g"),"_jsonconvtemp"+r+"_")}\r
+                               };\r
+                               temp[1]=temp[1].join('"')\r
+                       };\r
+                       x[i]=temp.join("<")\r
+               };\r
+               x=x.join(">");\r
+               x=x.replace(/ ([^=]*)=([^ |>]*)/g,"><$1>$2</$1");\r
+               x=x.replace(/>"/g,">").replace(/"</g,"<");\r
+               for (var r=0;r<4;r++){x=x.replace(new RegExp("_jsonconvtemp"+r+"_","g"),d[r])}  ;\r
+               return x\r
+       }\r
+};\r
+\r
+\r
+if(!Array.prototype.push){\r
+       Array.prototype.push=function(x){\r
+               this[this.length]=x;\r
+               return true\r
+       }\r
+};\r
+\r
+if (!Array.prototype.pop){\r
+       Array.prototype.pop=function(){\r
+               var response = this[this.length-1];\r
+               this.length--;\r
+               return response\r
+       }\r
+};\r
+\r
diff --git a/wrt/misc/rss/wrt_preview_frame.html b/wrt/misc/rss/wrt_preview_frame.html
new file mode 100644 (file)
index 0000000..50d94b3
--- /dev/null
@@ -0,0 +1,216 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
+       <title>Nokia WRT Preview</title>\r
+       <!-- jQuery-ui Begins -->\r
+               <link type="text/css" rel="stylesheet"  href="preview/script/jquery-ui/css/ui-darkness/ui.all.css"/>    \r
+               <script type="text/javascript" src="preview/script/jquery-ui/js/jquery-1.2.6.min.js"></script>\r
+               <script type="text/javascript" src="preview/script/jquery-ui/js/jquery-ui-1.6.custom.min.js"></script>\r
+       <!-- jQuery-ui Ends --> \r
+       <script type="text/javascript" language="JavaScript" src="preview/script/xml2json.js"></script>\r
+       <script type="text/javascript" language="JavaScript" src="preview/script/nokia.js"></script>\r
+       <script type="text/javascript" language="JavaScript" src="preview/script/resolution.js"></script>\r
+       <link type="text/css" rel="stylesheet"  href="preview/css/style.css"/>\r
+</head>\r
+<body>\r
+       <div id="preview-ui-top">\r
+               <div id="DeviceDisplayLayout" class="hide">\r
+                       <div id="DisplaySFKWrapper">\r
+                               <div id="DisplayArea">\r
+                                       <div id="IconArea"></div>\r
+                                       <div id="WidgetArea">\r
+                                               <div id="iframeMask" class="hide"></div>\r
+                                               <iframe src=""></iframe>\r
+                                       </div>\r
+                                       <div id="MenuItemsArea" class="scroll-pane">\r
+                                               <ul>\r
+                                                       <li><a href="javascript:void(0);">Exit</a></li>\r
+                                               </ul>\r
+                                       </div>\r
+                                       <div id="SoftKeysArea">\r
+                                               <ul>\r
+                                                       <li id="LskLabel"><a href="javascript:void(0);">Options</a></li>\r
+                                                       <li id="RskLabel"><a href="javascript:void(0);">Exit</a></li>\r
+                                               </ul>\r
+                                       </div>\r
+                               </div>\r
+                               <div id="SoftKeys">\r
+                                       <a href="javascript:void(0);"><img src="preview/images/TransperantImage.png" name="LskArea" border="0" id="LskArea"/></a><a href="javascript:void(0);"><img src="preview/images/TransperantImage.png" name="RskArea" border="0" id="RskArea"/></a> </div>\r
+                               </div>\r
+                       </div>\r
+               <div id="Dialog" title="Notification window"></div>\r
+<div id="PreferencesTab" class="hide">\r
+       <div id="tabs">\r
+               <ul>\r
+                       <li><a href="#tabs-1">Preferences</a></li>\r
+                       <li><a href="#tabs-2">Event Triggers</a></li>\r
+               </ul>\r
+               <div id="tabs-1">\r
+                       <div id="settings-view">\r
+               <table width="100%" cellpadding="0" cellspacing="0">\r
+                       <tr>\r
+                               <th>\r
+                                       Resolution\r
+                               </th>\r
+                               <td>\r
+                                       <select id="resOptions">\r
+                                               <option selected="true" value="http://www.forum.nokia.com/devices/matrix_240x320_1.html">240x320</option>\r
+                                               <option value="http://www.forum.nokia.com/devices/matrix_320x240_1.html">320x240</option>\r
+                                               <option value="http://www.forum.nokia.com/devices/matrix_360x640_1.html">360x640</option>\r
+                                               <option value="http://www.forum.nokia.com/devices/E90_Communicator">800x352</option>\r
+                                       </select>&nbsp; <a class="link" target="_blank" href="http://www.forum.nokia.com/devices/matrix_240x320_1.html" id="resSupportLink">Device matrix featuring this resolution</a>\r
+                               </td>\r
+                       </tr>\r
+                       <tr>\r
+                               <th>\r
+                                       Orientation                                     \r
+                               </th>\r
+                               <td>\r
+                                       <div id="Orientation_Controls" class="hide">\r
+                                               <label><input type="radio" name="input_orientation" id="input_portrait" value="portrait"/> Portrait</label>     \r
+                                               <label><input type="radio" name="input_orientation" id="input_landscape" value="landscape"/> Landscape</label>  \r
+                                       </div>\r
+                                       <div id="Orientation_Info" class="hide">\r
+                                       </div>\r
+                               </td>\r
+                       </tr>\r
+                       <tr>\r
+                               <th>\r
+                                       WRT Version\r
+                               </th>\r
+                               <td>\r
+                                       <label><input type="radio" name="wrt_version" id="wrt_version_1_0" value="WRT 1.0"/> WRT 1.0</label>    \r
+                                       <label><input type="radio" name="wrt_version" id="wrt_version_1_1" value="WRT 1.1"/> WRT 1.1</label>    \r
+                               </td>\r
+                       </tr>\r
+                       <tr>\r
+                               <th>\r
+                                       Home Screen view\r
+                               </th>\r
+                               <td>\r
+                                       <div id="HS_Control_Info">\r
+                                               Hello\r
+                                       </div>\r
+                               </td>\r
+                       </tr>\r
+               </table>\r
+               </div>\r
+               \r
+                       <div id="mini-view-info" class="hide">\r
+                               <div class="ui-panel">\r
+                                       <a class="ui-button" id="mini-view-back">Back</a>\r
+                               </div>\r
+                               <table cellpadding='0' cellspacing='0' width="100%">\r
+                                       <tr>\r
+                                               <th>To enable Mini view support for HomeScreen widget </th>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td>\r
+                                                       Add this line in Info.plist file\r
+                                                       <code>&lt;key&gt;MiniViewEnabled&lt;/key&gt;<br/>&lt;true/&gt;</code>\r
+                                                       and optionally add the following to the MainHTML file\r
+                                                       <code>&lt;div id="miniView"&gt; &lt;--  Define your Home Screen view here  --&gt; &lt;/div&gt;</code><br/>\r
+                                                       See Web Developer's Library for <a class="link" href="http://library.forum.nokia.com/index.jsp?topic=/Web_Developers_Library/GUID-63F4E17E-8895-4054-82AD-762B90610B30.html" target="_blank">more details</a>\r
+                                               </td>\r
+                                       </tr>\r
+                               </table>\r
+                       </div>\r
+               \r
+               \r
+               </div>\r
+               <div id="tabs-2">\r
+                       \r
+                       <div id="event-icons">\r
+                               <div id="event-battery"></div>\r
+                               <div id="event-messaging"></div>\r
+                               <div id="event-memory"></div>\r
+                       </div>\r
+\r
+                       <div id="event-battery-info" class="hide">\r
+                               <div class="ui-panel">\r
+                                       <a class="ui-button" id="event-battery-back">Back</a>\r
+                               </div>\r
+                               <table cellpadding='0' cellspacing='0' width="100%">\r
+                                       <tr>\r
+                                               <th colspan="2">Battery Triggers</th>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td>Charging status</td>\r
+                                               <td>\r
+                                                       <a class="ui-button-fixed" id="connect-charger">Connect charger</a>\r
+                                                       <a class="ui-button-fixed" id="disconnect-charger">Disconnect charger</a>\r
+                                               </td>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td>Battery Strength</td>\r
+                                               <td>\r
+                                                       <div id="slider"></div>\r
+                                                       <div id="slider-value-panel"><span>0</span></div>\r
+                                                       <div><a class="ui-button-fixed" id="update-batter-strength">Update</a></div>\r
+                                               </td>\r
+                                       </tr>\r
+                               </table>\r
+                       </div>\r
+\r
+                       <div id="event-messaging-info" class="hide">\r
+                               <div class="ui-panel">\r
+                                       <a class="ui-button" id="event-messaging-back">Back</a>\r
+                               </div>\r
+                               <table cellpadding='0' cellspacing='0' width="100%">\r
+                                       <tr>\r
+                                               <th colspan="2">Message Triggers</th>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td>New message</td>\r
+                                               <td>\r
+                                                       <a class="ui-button-fixed" id="send-sms">Trigger new SMS</a>\r
+                                                       <a class="ui-button-fixed" id="send-mms">Trigger new MMS</a>\r
+                                               </td>\r
+                                       </tr>\r
+                               </table>\r
+                       </div>\r
+\r
+                       <div id="event-memory-info" class="hide">\r
+                               <div class="ui-panel">\r
+                                       <a class="ui-button" id="event-memory-back">Back</a>\r
+                               </div>\r
+                               <table cellpadding='0' cellspacing='0' width="100%">\r
+                                       <tr>\r
+                                               <th colspan="2">Memory Triggers</th>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td>Memory Card</td>\r
+                                               <td>\r
+                                                       <a class="ui-button-fixed" id="connect-memory-card">Connect</a>\r
+                                                       <a class="ui-button-fixed" id="disconnect-memory-card">Disconnect</a>\r
+                                               </td>\r
+                                       </tr>\r
+                               </table>\r
+                       </div>\r
+                       \r
+               </div>\r
+       </div>\r
+</div>\r
+       </div>\r
+       <div id="preview-ui-bottom">\r
+               <div id="preview-ui-bottom-header">\r
+                       <div>Console window</div>\r
+                       <span class="open" id="Console-Toggle-Button"></span>\r
+                       <span id="Console-Clear-Button"></span>\r
+               </div>\r
+               <div style="clear:left;"></div>\r
+               <div id="preview-ui-bottom-body">\r
+               </div>\r
+       </div>\r
+       <div id="PreferencesBtn" class="hide"></div>\r
+       <div id="orientationIcon"></div>\r
+       <div id="loaderDiv"></div>\r
+       <div id="NotificationDiv" class="hide">\r
+               <p>NOKIA WRT Simulation may not work properly on this browser, <br/>Firefox is recommended for widget preview and debugging.  <br/><br/><strong>Continue?</strong></p>\r
+       </div>\r
+       <div id="BrowserNotificationBar" class="hide">\r
+               <p><a></a>NOKIA WRT Simulation may not work properly on this browser, Firefox is recommended for widget preview and debugging</p>\r
+       </div>\r
+</body>\r
+</html>\r
diff --git a/wrt/misc/rss/wrt_preview_main.html b/wrt/misc/rss/wrt_preview_main.html
new file mode 100644 (file)
index 0000000..6984a5f
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+    <head>
+       <script language="JavaScript" type="text/javascript" src="preview/script/lib/loader.js"></script>
+\r
+        <title></title>\r
+               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+        <script type="text/javascript" src="WRTKit/WRTKit.js"></script>\r
+        <script type="text/javascript" src="FeedUpdateBroker.js"></script>\r
+        <script type="text/javascript" src="RSSReader.js"></script>\r
+        <link rel="stylesheet" href="basic.css" type="text/css">\r
+        <META NAME="Generator" CONTENT="Nokia WRT plug-in for Aptana Studio 2.0.0" />\r
+    </head>\r
+    <body onload="init()">\r
+    </body>\r
+</html>
\ No newline at end of file
diff --git a/wrt/misc/widget.deb b/wrt/misc/widget.deb
new file mode 100644 (file)
index 0000000..93235a3
Binary files /dev/null and b/wrt/misc/widget.deb differ
diff --git a/wrt/zouba/.project b/wrt/zouba/.project
new file mode 100644 (file)
index 0000000..1f3ff7d
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>simple</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>com.nokia.wrt.widgetPreviewBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>com.nokia.wrt.WidgetProjectNature</nature>
+               <nature>com.aptana.ide.project.nature.web</nature>
+       </natures>
+</projectDescription>
diff --git a/wrt/zouba/.settings/com.aptana.ide.editor.js.prefs b/wrt/zouba/.settings/com.aptana.ide.editor.js.prefs
new file mode 100644 (file)
index 0000000..ad41b55
--- /dev/null
@@ -0,0 +1,42 @@
+#Wed Oct 28 03:33:50 GMT+02:00 2009
+com.aptana.ide.editors.codeassist.formatter.alignment_for_multiple_fields=1
+com.aptana.ide.editors.codeassist.formatter.blank_lines_before_imports=5
+com.aptana.ide.editors.codeassist.formatter.blank_lines_before_method=1
+com.aptana.ide.editors.codeassist.formatter.brace_position_for_array_initializer=end_of_line
+com.aptana.ide.editors.codeassist.formatter.brace_position_for_block=end_of_line
+com.aptana.ide.editors.codeassist.formatter.brace_position_for_block_in_case=next_line
+com.aptana.ide.editors.codeassist.formatter.brace_position_for_method_declaration=next_line
+com.aptana.ide.editors.codeassist.formatter.brace_position_for_switch=end_of_line
+com.aptana.ide.editors.codeassist.formatter.compact_else_if=true
+com.aptana.ide.editors.codeassist.formatter.format_guardian_clause_on_one_line=false
+com.aptana.ide.editors.codeassist.formatter.indent_breaks_compare_to_cases=true
+com.aptana.ide.editors.codeassist.formatter.indent_statements_compare_to_block=true
+com.aptana.ide.editors.codeassist.formatter.indent_statements_compare_to_body=true
+com.aptana.ide.editors.codeassist.formatter.indent_switchstatements_compare_to_cases=true
+com.aptana.ide.editors.codeassist.formatter.indent_switchstatements_compare_to_switch=false
+com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_catch_in_try_statement=insert
+com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_else_in_if_statement=insert
+com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_finally_in_try_statement=insert
+com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_if_statement=insert
+com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_return_statement=insert
+com.aptana.ide.editors.codeassist.formatter.insert_new_line_before_while_in_do_statement=insert
+com.aptana.ide.editors.codeassist.formatter.insert_new_line_in_empty_enum_declaration=doctype,br,link,meta
+com.aptana.ide.editors.codeassist.formatter.insert_new_line_in_empty_type_declaration=a,span,i,b,em,strong,h1,h2,h3,h4,h5,h6,title,option
+com.aptana.ide.editors.codeassist.formatter.insert_space_after_and_in_type_parameter=
+com.aptana.ide.editors.codeassist.formatter.insert_space_after_closing_brace_in_block=false
+com.aptana.ide.editors.codeassist.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=false
+com.aptana.ide.editors.codeassist.formatter.insert_space_between_empty_parens_in_enum_constant=
+com.aptana.ide.editors.codeassist.formatter.keep_else_statement_on_same_line=true
+com.aptana.ide.editors.codeassist.formatter.keep_empty_array_initializer_on_one_line=true
+com.aptana.ide.editors.codeassist.formatter.keep_imple_if_on_one_line=false
+com.aptana.ide.editors.codeassist.formatter.keep_then_statement_on_same_line=true
+com.aptana.ide.editors.codeassist.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+com.aptana.ide.editors.codeassist.formatter.preserveWhitespaceinCDATA=true
+com.aptana.ide.editors.codeassist.formatter.preserve_extra_carriage_returns=true
+com.aptana.ide.editors.codeassist.formatter.preserve_extra_carriage_returns2=
+com.aptana.ide.editors.codeassist.formatter.tabulation.char=\ 
+com.aptana.ide.editors.codeassist.formatter.tabulation.size=4
+com.aptana.ide.editors.codeassist.formatter.wraptags2=
+eclipse.preferences.version=1
+formatter_profile=_myway
+formatter_settings_version=1
diff --git a/wrt/zouba/.settings/org.eclipse.ltk.core.refactoring.prefs b/wrt/zouba/.settings/org.eclipse.ltk.core.refactoring.prefs
new file mode 100644 (file)
index 0000000..b0ef556
--- /dev/null
@@ -0,0 +1,3 @@
+#Wed Oct 28 03:33:50 GMT+02:00 2009
+eclipse.preferences.version=1
+org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
diff --git a/wrt/zouba/.tmp_index.html.21831~ b/wrt/zouba/.tmp_index.html.21831~
new file mode 100644 (file)
index 0000000..9f4a701
--- /dev/null
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title></title>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+        <script type="text/javascript" src="WRTKit/WRTKit.js">
+        </script>
+        <script type="text/javascript" src="basic.js">
+        </script>
+        <link rel="stylesheet" href="basic.css" type="text/css">
+    </head>
+    <body onload="init()">
+        <table align="center" border="1">
+            <tr>
+                <th align="left">
+                    time
+                </th>
+                <td>
+                    <div id="timeAtStop">
+                    </div>
+                </td>
+            </tr>
+            <tr>
+                <th align="left">
+                    linecode
+                </th>
+                <td>
+                    <div id="linecode">
+                    </div>
+                </td>
+            </tr>
+        </table>
+        <table border="0" align="center">
+        <tr>
+            <td>
+                <button onclick="takeMeHome()">
+                    HOME
+                </button>
+            </td>
+            <td>
+                <button onclick="takeMeToWork()">
+                    WORK
+                </button>
+            </td>
+        </tr>
+    </body>
+</html>
diff --git a/wrt/zouba/.tmp_index.html.61682~ b/wrt/zouba/.tmp_index.html.61682~
new file mode 100644 (file)
index 0000000..0cbcdf4
--- /dev/null
@@ -0,0 +1,48 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title></title>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+        <script type="text/javascript" src="basic.js">
+        </script>
+    </head>
+    <body onload="init()">
+        <table border="1">
+        <tr>
+            <th align="left">
+                arrivaltime
+            </th>
+            <td>
+                <div id="arrivaltime">
+                </div>
+            </td>
+        </tr>
+        <tr>
+            <th align="left">
+                linecode
+            </th>
+            <td>
+                <div id="linecode">
+                </div>
+            </td>
+        </tr>
+        <tr>
+            <th align="left">
+                debug
+            </th>
+            <td>
+                <div id="debug">
+                </div>
+            </td>
+        </tr>
+        <th align="left">
+            debug2
+        </th>
+        <td>
+            <div id="debug2">
+            </div>
+        </td>
+        </tr>
+    </table>
+    </body>
+</html>
diff --git a/wrt/zouba/Icon.png b/wrt/zouba/Icon.png
new file mode 100644 (file)
index 0000000..6354e39
Binary files /dev/null and b/wrt/zouba/Icon.png differ
diff --git a/wrt/zouba/Info.plist b/wrt/zouba/Info.plist
new file mode 100644 (file)
index 0000000..80d9ac0
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE plist PUBLIC "-//Nokia//DTD PLIST 1.0//EN" "http://www.nokia.com/DTDs/plist-1.0.dtd">\r
+<plist version="1.0">\r
+    <dict>\r
+        <key>DisplayName</key>\r
+        <string>zouba</string>\r
+        <key>Identifier</key>\r
+        <string>com.zouba.basic.widget</string>\r
+        <key>Version</key>\r
+        <string>1.0</string>\r
+        <key>MainHTML</key>\r
+        <string>index.html</string>\r
+        <key>AllowNetworkAccess</key>\r
+        <true/>\r
+        <key>MiniViewEnabled</key>\r
+               <false/>\r
+    </dict>\r
+</plist>
\ No newline at end of file
diff --git a/wrt/zouba/WRTKit/Resources/CheckBox.png b/wrt/zouba/WRTKit/Resources/CheckBox.png
new file mode 100644 (file)
index 0000000..ca6659a
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/CheckBox.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ContentPanelFoldIcons.png b/wrt/zouba/WRTKit/Resources/ContentPanelFoldIcons.png
new file mode 100644 (file)
index 0000000..1b7190f
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ContentPanelFoldIcons.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ControlAssemblyBackground.png b/wrt/zouba/WRTKit/Resources/ControlAssemblyBackground.png
new file mode 100644 (file)
index 0000000..93d9908
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ControlAssemblyBackground.png differ
diff --git a/wrt/zouba/WRTKit/Resources/DocumentBackground.png b/wrt/zouba/WRTKit/Resources/DocumentBackground.png
new file mode 100644 (file)
index 0000000..18defee
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/DocumentBackground.png differ
diff --git a/wrt/zouba/WRTKit/Resources/FormButtonCenter.png b/wrt/zouba/WRTKit/Resources/FormButtonCenter.png
new file mode 100644 (file)
index 0000000..c06d9ad
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/FormButtonCenter.png differ
diff --git a/wrt/zouba/WRTKit/Resources/FormButtonLeft.png b/wrt/zouba/WRTKit/Resources/FormButtonLeft.png
new file mode 100644 (file)
index 0000000..af8ca8a
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/FormButtonLeft.png differ
diff --git a/wrt/zouba/WRTKit/Resources/FormButtonRight.png b/wrt/zouba/WRTKit/Resources/FormButtonRight.png
new file mode 100644 (file)
index 0000000..e63121b
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/FormButtonRight.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ListViewCaptionBackground.png b/wrt/zouba/WRTKit/Resources/ListViewCaptionBackground.png
new file mode 100644 (file)
index 0000000..8e528c4
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ListViewCaptionBackground.png differ
diff --git a/wrt/zouba/WRTKit/Resources/NotificationPopupBackground.png b/wrt/zouba/WRTKit/Resources/NotificationPopupBackground.png
new file mode 100644 (file)
index 0000000..093701b
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/NotificationPopupBackground.png differ
diff --git a/wrt/zouba/WRTKit/Resources/NotificationPopupTypeIndicator.png b/wrt/zouba/WRTKit/Resources/NotificationPopupTypeIndicator.png
new file mode 100644 (file)
index 0000000..9220fff
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/NotificationPopupTypeIndicator.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ProgressBar0.png b/wrt/zouba/WRTKit/Resources/ProgressBar0.png
new file mode 100644 (file)
index 0000000..9d74fad
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ProgressBar0.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ProgressBar10.png b/wrt/zouba/WRTKit/Resources/ProgressBar10.png
new file mode 100644 (file)
index 0000000..eaf26a7
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ProgressBar10.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ProgressBar100.png b/wrt/zouba/WRTKit/Resources/ProgressBar100.png
new file mode 100644 (file)
index 0000000..51340de
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ProgressBar100.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ProgressBar20.png b/wrt/zouba/WRTKit/Resources/ProgressBar20.png
new file mode 100644 (file)
index 0000000..88140ae
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ProgressBar20.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ProgressBar30.png b/wrt/zouba/WRTKit/Resources/ProgressBar30.png
new file mode 100644 (file)
index 0000000..e2fea97
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ProgressBar30.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ProgressBar40.png b/wrt/zouba/WRTKit/Resources/ProgressBar40.png
new file mode 100644 (file)
index 0000000..9db19a6
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ProgressBar40.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ProgressBar50.png b/wrt/zouba/WRTKit/Resources/ProgressBar50.png
new file mode 100644 (file)
index 0000000..f5c3a86
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ProgressBar50.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ProgressBar60.png b/wrt/zouba/WRTKit/Resources/ProgressBar60.png
new file mode 100644 (file)
index 0000000..59810c7
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ProgressBar60.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ProgressBar70.png b/wrt/zouba/WRTKit/Resources/ProgressBar70.png
new file mode 100644 (file)
index 0000000..d037e58
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ProgressBar70.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ProgressBar80.png b/wrt/zouba/WRTKit/Resources/ProgressBar80.png
new file mode 100644 (file)
index 0000000..60d57f2
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ProgressBar80.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ProgressBar90.png b/wrt/zouba/WRTKit/Resources/ProgressBar90.png
new file mode 100644 (file)
index 0000000..9955d6b
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ProgressBar90.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ProgressBarUnknown.gif b/wrt/zouba/WRTKit/Resources/ProgressBarUnknown.gif
new file mode 100644 (file)
index 0000000..cd6b3f6
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ProgressBarUnknown.gif differ
diff --git a/wrt/zouba/WRTKit/Resources/RadioButton.png b/wrt/zouba/WRTKit/Resources/RadioButton.png
new file mode 100644 (file)
index 0000000..ad9311a
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/RadioButton.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ScrollbarThumbBottom.png b/wrt/zouba/WRTKit/Resources/ScrollbarThumbBottom.png
new file mode 100644 (file)
index 0000000..14e073f
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ScrollbarThumbBottom.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ScrollbarThumbMiddle.png b/wrt/zouba/WRTKit/Resources/ScrollbarThumbMiddle.png
new file mode 100644 (file)
index 0000000..e48f493
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ScrollbarThumbMiddle.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ScrollbarThumbTop.png b/wrt/zouba/WRTKit/Resources/ScrollbarThumbTop.png
new file mode 100644 (file)
index 0000000..2e79548
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ScrollbarThumbTop.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ScrollbarTrackBottom.png b/wrt/zouba/WRTKit/Resources/ScrollbarTrackBottom.png
new file mode 100644 (file)
index 0000000..853452b
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ScrollbarTrackBottom.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ScrollbarTrackMiddle.png b/wrt/zouba/WRTKit/Resources/ScrollbarTrackMiddle.png
new file mode 100644 (file)
index 0000000..93bf3fc
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ScrollbarTrackMiddle.png differ
diff --git a/wrt/zouba/WRTKit/Resources/ScrollbarTrackTop.png b/wrt/zouba/WRTKit/Resources/ScrollbarTrackTop.png
new file mode 100644 (file)
index 0000000..883dd14
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/ScrollbarTrackTop.png differ
diff --git a/wrt/zouba/WRTKit/Resources/SeparatorCenter.png b/wrt/zouba/WRTKit/Resources/SeparatorCenter.png
new file mode 100644 (file)
index 0000000..df0b5b6
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/SeparatorCenter.png differ
diff --git a/wrt/zouba/WRTKit/Resources/SeparatorLeft.png b/wrt/zouba/WRTKit/Resources/SeparatorLeft.png
new file mode 100644 (file)
index 0000000..86f3df6
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/SeparatorLeft.png differ
diff --git a/wrt/zouba/WRTKit/Resources/SeparatorRight.png b/wrt/zouba/WRTKit/Resources/SeparatorRight.png
new file mode 100644 (file)
index 0000000..ebd5f7d
Binary files /dev/null and b/wrt/zouba/WRTKit/Resources/SeparatorRight.png differ
diff --git a/wrt/zouba/WRTKit/Resources/UI.css b/wrt/zouba/WRTKit/Resources/UI.css
new file mode 100644 (file)
index 0000000..d2fcd59
--- /dev/null
@@ -0,0 +1,912 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+/******************************************************************************/\r
+/*        Definition of visuals for the WRTKit user interface toolkit         */\r
+/******************************************************************************/\r
+\r
+/******************************************************************************/\r
+/* Document body rules */\r
+\r
+body {\r
+    margin: 0px;\r
+    background: url("DocumentBackground.png") repeat-x fixed;\r
+    font: normal 12px Arial, sans-serif;\r
+    color: rgb(0,0,0);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* Override default WRT styling for HTML form controls */\r
+\r
+/* Textarea when focused */\r
+textarea:focus {\r
+    outline: none;\r
+}\r
+\r
+/* Textarea when hovering */\r
+textarea:hover {\r
+    outline: none;\r
+}\r
+\r
+/* Select elements when focused */\r
+select:focus {\r
+    outline: none;\r
+}\r
+\r
+/* Select elements when hovering */\r
+select:hover {\r
+    outline: none;\r
+}\r
+\r
+/* Input elements when focused */\r
+input:focus {\r
+    outline: none;\r
+}\r
+\r
+/* Input elements when hovering */\r
+input:hover {\r
+    outline: none;\r
+}\r
+\r
+/* Link elements */\r
+a {\r
+    text-decoration: none;\r
+    color: rgb(0,0,0);\r
+}\r
+\r
+/* Links when focused */\r
+a:focus {\r
+    background: none;\r
+    outline: none;\r
+}\r
+\r
+/* Links when hovering */\r
+a:hover {\r
+    background: none;\r
+    outline: none;\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* Rules for default view and document scrollbar containers */\r
+\r
+/* Default view container rules */\r
+.ViewContainer {\r
+    margin: 0px 0px 0px 0px;\r
+}\r
+\r
+/* Default document scrollbar container rules */\r
+.DocumentScrollbarContainer {\r
+    position: fixed;\r
+    right: 0px;\r
+    top: 0px;\r
+    height: 100%;\r
+    width: 7px;\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* View style rules */\r
+\r
+/* Rules for the list view */\r
+.ListView {\r
+    margin: 0px 0px 0px 0px;\r
+}\r
+\r
+/* Rules for the list view caption */\r
+.ListViewCaption {\r
+    background: url("ListViewCaptionBackground.png");\r
+    height: 35px;\r
+}\r
+\r
+/* Rules for the list view caption text */\r
+.ListViewCaptionText {\r
+    font-size: 18px;\r
+    font-weight: bold;\r
+    padding: 7px 0px 0px 11px;\r
+}\r
+\r
+/* Rules for the list view control list element */\r
+.ListViewControlList {\r
+    margin: 1px 10px 1px 3px;\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* Control style rules */\r
+\r
+/* Rules for control root element (rootElement) */\r
+.Control {\r
+    \r
+}\r
+\r
+/* Control assembly rules (assemblyElement) */\r
+.ControlAssembly {\r
+    background: url("ControlAssemblyBackground.png") repeat-x;\r
+    padding: 1px 5px;\r
+}\r
+\r
+/* Control assembly in normal state */\r
+.ControlAssemblyNormal {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Control assembly in focused state */\r
+.ControlAssemblyFocus {\r
+    background-position: 0px -250px;\r
+}\r
+\r
+/* Control assembly in hovering state */\r
+.ControlAssemblyHover {\r
+    background-position: 0px -500px;\r
+}\r
+\r
+/* Control assembly in disabled state */\r
+.ControlAssemblyDisabled {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Caption for controls (captionElement) */\r
+.ControlCaption {\r
+    font-weight: bold;\r
+    padding: 3px 0px 0px 3px;\r
+}\r
+\r
+/* Caption for controls in normal state */\r
+.ControlCaptionNormal {\r
+    \r
+}\r
+\r
+/* Caption for controls when focused */\r
+.ControlCaptionFocus {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* Caption for controls when hovering */\r
+.ControlCaptionHover {\r
+    \r
+}\r
+\r
+/* Caption for controls when disabled */\r
+.ControlCaptionDisabled {\r
+    color: rgb(125,125,125);\r
+}\r
+\r
+/* Control element rules (controlElement) */\r
+.ControlElement {\r
+    padding: 3px 3px 3px 3px;\r
+}\r
+\r
+/******************************************************************************/\r
+/* Label */\r
+\r
+/* Rules for the text value of a Label control */\r
+.LabelText {\r
+    \r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* ContentPanel */\r
+\r
+/* Caption area rules for non-foldable content panels */\r
+.ContentPanelCaptionNonFoldable {\r
+    padding: 3px 0px 0px 3px;\r
+}\r
+\r
+/* Caption area rules for foldable content panels */\r
+.ContentPanelCaptionFoldable {\r
+    padding: 4px 0px 3px 3px;\r
+}\r
+\r
+/* Rules for fold toggling element in content panel */\r
+.ContentPanelFoldToggle {\r
+    background: url("ContentPanelFoldIcons.png") no-repeat;\r
+    padding-left: 16px;\r
+}\r
+\r
+/* Collapsed fold */\r
+.ContentPanelFoldToggleCollapsed {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Expanded fold */\r
+.ContentPanelFoldToggleExpanded {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* Rules for the content panel caption text */\r
+.ContentPanelCaptionText {\r
+    font-weight: bold;\r
+}\r
+\r
+/* Caption text for content panel in normal state */\r
+.ContentPanelCaptionTextNormal {\r
+    \r
+}\r
+\r
+/* Caption text for content panel when focused */\r
+.ContentPanelCaptionTextFocus {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* Caption text for content panel when hovering */\r
+.ContentPanelCaptionTextHover {\r
+    \r
+}\r
+\r
+/* Caption text for content panel when disabled */\r
+.ContentPanelCaptionTextDisabled {\r
+    color: rgb(125,125,125);\r
+}\r
+\r
+/* Rules for content in the content panel */\r
+.ContentPanelContent {\r
+    padding: 2px 2px 2px 8px;\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* FormButton */\r
+\r
+/* Rules for form button */\r
+.FormButton {\r
+    \r
+}\r
+\r
+/* Rules for form button control element */\r
+.FormButtonControlElement {\r
+    \r
+}\r
+\r
+/* Rules for form button table (table) */\r
+.FormButtonTable {\r
+    width: 100%;\r
+    border-spacing: 0px;\r
+    padding: 0px;\r
+    table-layout: fixed;\r
+}\r
+\r
+/* Form button row (tr) */\r
+.FormButtonRow {\r
+    padding: 0px;\r
+}\r
+\r
+/* Rules for form button left cell (td) */\r
+.FormButtonLeftCell {\r
+    width: 8px;\r
+    height: 26px;\r
+    background: url("FormButtonLeft.png") no-repeat;\r
+    padding: 0px;\r
+}\r
+\r
+/* Rules for form button center cell (td) */\r
+.FormButtonCenterCell {\r
+    height: 26px;\r
+    background: url("FormButtonCenter.png") repeat-x;\r
+    padding: 0px;\r
+    vertical-align: middle;\r
+    text-align: center;\r
+}\r
+\r
+/* Rules for form button right cell (td) */\r
+.FormButtonRightCell {\r
+    width: 8px;\r
+    height: 26px;\r
+    background: url("FormButtonRight.png") no-repeat;\r
+    padding: 0px;\r
+}\r
+\r
+/* Rules for form button left cell in normal state (td) */\r
+.FormButtonLeftCellNormal {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Rules for form button left cell in focused state (td) */\r
+.FormButtonLeftCellFocus {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* Rules for form button left cell in hover state (td) */\r
+.FormButtonLeftCellHover {\r
+    background-position: 0px -100px;\r
+}\r
+\r
+/* Rules for form button left cell in disabled state (td) */\r
+.FormButtonLeftCellDisabled {\r
+    background-position: 0px -150px;\r
+}\r
+\r
+/* Rules for form button center cell in normal state (td) */\r
+.FormButtonCenterCellNormal {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Rules for form button center cell in focused state (td) */\r
+.FormButtonCenterCellFocus {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* Rules for form button center cell in hover state (td) */\r
+.FormButtonCenterCellHover {\r
+    background-position: 0px -100px;\r
+}\r
+\r
+/* Rules for form button center cell in disabled state (td) */\r
+.FormButtonCenterCellDisabled {\r
+    background-position: 0px -150px;\r
+}\r
+\r
+/* Rules for form button left cell in normal state (td) */\r
+.FormButtonRightCellNormal {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Rules for form button left cell in focused state (td) */\r
+.FormButtonRightCellFocus {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* Rules for form button left cell in hover state (td) */\r
+.FormButtonRightCellHover {\r
+    background-position: 0px -100px;\r
+}\r
+\r
+/* Rules for form button left cell in disabled state (td) */\r
+.FormButtonRightCellDisabled {\r
+    background-position: 0px -150px;\r
+}\r
+\r
+/* Rules for form button text */\r
+.FormButtonText {\r
+    font-weight: bold;\r
+}\r
+\r
+/* Form button text in normal state */\r
+.FormButtonTextNormal {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* Form button text when focused */\r
+.FormButtonTextFocus {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* Form button text when hovering */\r
+.FormButtonTextHover {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* Form button text when disabled */\r
+.FormButtonTextDisabled {\r
+    color: rgb(200,200,200);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* NavigationButton */\r
+\r
+/* Rules for navigation button */\r
+.NavigationButton {\r
+    \r
+}\r
+\r
+/* Rules for navigation button control element */\r
+.NavigationButtonControlElement {\r
+    padding: 3px 3px 3px 3px;\r
+}\r
+\r
+/* Rules for navigation button table (table) */\r
+.NavigationButtonTable {\r
+    border-spacing: 0px;\r
+    padding: 0px;\r
+}\r
+\r
+/* Navigation button row (tr) */\r
+.NavigationButtonRow {\r
+    padding: 0px;\r
+}\r
+\r
+/* Rules for navigation button image cell (td) */\r
+.NavigationButtonImageCell {\r
+    line-height: 1px;\r
+    font-size: 1px;\r
+    vertical-align: middle;\r
+}\r
+\r
+/* Rules for navigation button text cell (td) */\r
+.NavigationButtonTextCell {\r
+    vertical-align: middle;\r
+    padding: 0px;\r
+}\r
+\r
+/* Rules for navigation button image */\r
+.NavigationButtonImage {\r
+    padding: 0px 5px 0px 0px;\r
+}\r
+\r
+/* Rules for navigation button text */\r
+.NavigationButtonText {\r
+    font-weight: bold;\r
+}\r
+\r
+/* Navigation button text in normal state */\r
+.NavigationButtonTextNormal {\r
+    \r
+}\r
+\r
+/* Navigation button text when focused */\r
+.NavigationButtonTextFocus {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* Navigation button text when hovering */\r
+.NavigationButtonTextHover {\r
+    \r
+}\r
+\r
+/* Navigation button text when disabled */\r
+.NavigationButtonTextDisabled {\r
+    color: rgb(125,125,125);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* TextField */\r
+\r
+/* Rules for textField */\r
+.TextField {\r
+    width: 100%;\r
+    border: 1px solid rgb(0,0,0);\r
+    background: rgb(255,255,255);\r
+    margin: 0px 0px 3px 0px;\r
+}\r
+\r
+/* TextField in normal state */\r
+.TextFieldNormal {\r
+    \r
+}\r
+\r
+/* TextField in focus state */\r
+.TextFieldFocus {\r
+    \r
+}\r
+\r
+/* TextField in hover state */\r
+.TextFieldHover {\r
+    \r
+}\r
+\r
+/* TextField in disabled state */\r
+.TextFieldDisabled {\r
+    color: rgb(50,50,50);\r
+    background: rgb(200,200,200);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* TextArea */\r
+\r
+/* Rules for TextArea */\r
+.TextArea {\r
+    width: 100%;\r
+    border: 1px solid rgb(0,0,0);\r
+    background: rgb(255,255,255);\r
+    margin: 0px 0px 3px 0px;\r
+}\r
+\r
+/* TextArea in normal state */\r
+.TextAreaNormal {\r
+    \r
+}\r
+\r
+/* TextArea in focus state */\r
+.TextAreaFocus {\r
+    \r
+}\r
+\r
+/* TextArea in hover state */\r
+.TextAreaHover {\r
+    \r
+}\r
+\r
+/* TextArea in disabled state */\r
+.TextAreaDisabled {\r
+    color: rgb(50,50,50);\r
+    background: rgb(200,200,200);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* Separator */\r
+\r
+/* Rules for Separator (table) */\r
+.Separator {\r
+    width: 100%;\r
+    padding: 0px;\r
+    border-spacing: 0px;\r
+    table-layout: fixed;\r
+    margin: 3px 0px;\r
+}\r
+\r
+/* Separator row (tr) */\r
+.SeparatorRow {\r
+    padding: 0px;\r
+}\r
+\r
+/* Separator left cell (td) */\r
+.SeparatorLeftCell {\r
+    width: 5px;\r
+    height: 2px;\r
+    background: url("SeparatorLeft.png") no-repeat;\r
+    padding: 0px;\r
+}\r
+\r
+/* Separator center cell (td) */\r
+.SeparatorCenterCell {\r
+    height: 2px;\r
+    background: url("SeparatorCenter.png") repeat-x;\r
+    padding: 0px;\r
+}\r
+\r
+/* Separator right cell (td) */\r
+.SeparatorRightCell {\r
+    width: 6px;\r
+    height: 2px;\r
+    background: url("SeparatorRight.png") no-repeat;\r
+    padding: 0px;\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* SelectionMenu */\r
+\r
+/* Rules for SelectionMenu select element */\r
+.SelectionMenu {\r
+    width: 100%;\r
+    border: 1px solid rgb(0,0,0);\r
+    background: rgb(255,255,255);\r
+    margin: 0px 0px 3px 0px;\r
+}\r
+\r
+/* SelectionMenu in normal state */\r
+.SelectionMenuNormal {\r
+    \r
+}\r
+\r
+/* SelectionMenu in focus state */\r
+.SelectionMenuFocus {\r
+    \r
+}\r
+\r
+/* SelectionMenu in hover state */\r
+.SelectionMenuHover {\r
+    \r
+}\r
+\r
+/* SelectionMenu in disabled state */\r
+.SelectionMenuDisabled {\r
+    color: rgb(50,50,50);\r
+    background: rgb(200,200,200);\r
+}\r
+\r
+/* Rules for SelectionMenu option elements */\r
+.SelectionMenuOption {\r
+    background: rgb(255,255,255);\r
+}\r
+\r
+/* SelectionMenu option in normal state */\r
+.SelectionMenuOptionNormal {\r
+    \r
+}\r
+\r
+/* SelectionMenu option in focus state */\r
+.SelectionMenuOptionFocus {\r
+    \r
+}\r
+\r
+/* SelectionMenu option in hover state */\r
+.SelectionMenuOptionHover {\r
+    \r
+}\r
+\r
+/* SelectionMenu option in disabled state */\r
+.SelectionMenuOptionDisabled {\r
+    color: rgb(50,50,50);\r
+    background: rgb(200,200,200);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* SelectionList */\r
+\r
+/* SelectionList option list element */\r
+.SelectionList {\r
+    \r
+}\r
+\r
+/* SelectionList option list element in normal state */\r
+.SelectionListNormal {\r
+    \r
+}\r
+\r
+/* SelectionList option list element in focus state */\r
+.SelectionListFocus {\r
+    \r
+}\r
+\r
+/* SelectionList option list element in hover state */\r
+.SelectionListHover {\r
+    \r
+}\r
+\r
+/* SelectionList option list element in disabled state */\r
+.SelectionListDisabled {\r
+    \r
+}\r
+\r
+/* SelectionList option element in single selection mode */\r
+.SelectionListOptionSingle {\r
+    padding-left: 19px;\r
+    background: url("RadioButton.png") no-repeat;\r
+    height: 16px;\r
+}\r
+\r
+/* SelectionList option element in single selection mode, unchecked normal state */\r
+.SelectionListOptionSingleUncheckedNormal {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* SelectionList option element in single selection mode, unchecked focus state */\r
+.SelectionListOptionSingleUncheckedFocus {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* SelectionList option element in single selection mode, unchecked diabled state */\r
+.SelectionListOptionSingleUncheckedDisabled {\r
+    background-position: 0px -100px;\r
+}\r
+\r
+/* SelectionList option element in single selection mode, checked normal state */\r
+.SelectionListOptionSingleCheckedNormal {\r
+    background-position: 0px -150px;\r
+}\r
+\r
+/* SelectionList option element in single selection mode, checked focus state */\r
+.SelectionListOptionSingleCheckedFocus {\r
+    background-position: 0px -200px;\r
+}\r
+\r
+/* SelectionList option element in single selection mode, checked diabled state */\r
+.SelectionListOptionSingleCheckedDisabled {\r
+    background-position: 0px -250px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode */\r
+.SelectionListOptionMulti {\r
+    padding-left: 19px;\r
+    background: url("CheckBox.png") no-repeat;\r
+    height: 16px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode, unchecked normal state */\r
+.SelectionListOptionMultiUncheckedNormal {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode, unchecked focus state */\r
+.SelectionListOptionMultiUncheckedFocus {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode, unchecked diabled state */\r
+.SelectionListOptionMultiUncheckedDisabled {\r
+    background-position: 0px -100px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode, checked normal state */\r
+.SelectionListOptionMultiCheckedNormal {\r
+    background-position: 0px -150px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode, checked focus state */\r
+.SelectionListOptionMultiCheckedFocus {\r
+    background-position: 0px -200px;\r
+}\r
+\r
+/* SelectionList option element in multi selection mode, checked diabled state */\r
+.SelectionListOptionMultiCheckedDisabled {\r
+    background-position: 0px -250px;\r
+}\r
+\r
+/* SelectionList option text */\r
+.SelectionListOptionText {\r
+    \r
+}\r
+\r
+/* SelectionList option text in normal state */\r
+.SelectionListOptionTextNormal {\r
+    \r
+}\r
+\r
+/* SelectionList option text in focus state */\r
+.SelectionListOptionTextFocus {\r
+    color: rgb(255,255,255);\r
+}\r
+\r
+/* SelectionList option text in hover state */\r
+.SelectionListOptionTextHover {\r
+    \r
+}\r
+\r
+/* SelectionList option text in disabled state */\r
+.SelectionListOptionTextDisabled {\r
+    color: rgb(125,125,125);\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* Scrollbar */\r
+\r
+/* Scrollbar root element */\r
+.Scrollbar {\r
+    position: absolute;\r
+    height: 100%;\r
+    width: 7px;\r
+}\r
+\r
+/* Top portion of scrollbar track */\r
+.ScrollbarTrackTop {\r
+    position: absolute;\r
+    background: url("ScrollbarTrackTop.png") no-repeat;\r
+    width: 7px;\r
+    height: 4px;\r
+}\r
+\r
+/* Middle portion of scrollbar track */\r
+.ScrollbarTrackMiddle {\r
+    position: absolute;\r
+    background: url("ScrollbarTrackMiddle.png") repeat-y;\r
+    width: 7px;\r
+}\r
+\r
+/* Bottom portion of scrollbar track */\r
+.ScrollbarTrackBottom {\r
+    position: absolute;\r
+    background: url("ScrollbarTrackBottom.png") no-repeat;\r
+    width: 7px;\r
+    height: 4px;\r
+}\r
+\r
+/* Top portion of scrollbar thumb */\r
+.ScrollbarThumbTop {\r
+    position: absolute;\r
+    background: url("ScrollbarThumbTop.png") no-repeat;\r
+    width: 7px;\r
+    height: 5px;\r
+}\r
+\r
+/* Middle portion of scrollbar thumb */\r
+.ScrollbarThumbMiddle {\r
+    position: absolute;\r
+    background: url("ScrollbarThumbMiddle.png") repeat-y;\r
+    width: 7px;\r
+}\r
+\r
+/* Bottom portion of scrollbar thumb */\r
+.ScrollbarThumbBottom {\r
+    position: absolute;\r
+    background: url("ScrollbarThumbBottom.png") no-repeat;\r
+    width: 7px;\r
+    height: 5px;\r
+}\r
+\r
+\r
+/******************************************************************************/\r
+/* NotificationPopup */\r
+\r
+/* Container that defines the area for the popup dialog */\r
+.NotificationPopupContainer {\r
+    position: fixed;\r
+    bottom: 0px;\r
+    left: 50%;\r
+    margin-left: -115px;\r
+    width: 230px;\r
+    height: 85px;\r
+}\r
+\r
+/* Notification popup dialog */\r
+.NotificationPopup {\r
+    position: absolute;\r
+    width: 230px;\r
+    height: 85px;\r
+    background: url("NotificationPopupBackground.png") repeat-x;\r
+    border: 1px solid rgb(0,0,0);\r
+}\r
+\r
+/* Notification type indicator */\r
+.NotificationPopupTypeIndicator {\r
+    position: absolute;\r
+    left: 195px;\r
+    top: 10px;\r
+    width: 24px;\r
+    height: 34px;\r
+    background: url("NotificationPopupTypeIndicator.png") no-repeat;\r
+}\r
+\r
+/* Notification type indicator for notifications of undefined type */\r
+.NotificationPopupTypeIndicatorNone {\r
+    background-position: 0px 0px;\r
+}\r
+\r
+/* Notification type indicator for info notifications */\r
+.NotificationPopupTypeIndicatorInfo {\r
+    background-position: 0px -50px;\r
+}\r
+\r
+/* Notification type indicator for warning notifications */\r
+.NotificationPopupTypeIndicatorWarning {\r
+    background-position: 0px -100px;\r
+}\r
+\r
+/* Notification type indicator for wait notifications */\r
+.NotificationPopupTypeIndicatorWait {\r
+    background-position: 0px -150px;\r
+}\r
+\r
+/* Notification text area */\r
+.NotificationPopupText {\r
+    position: absolute;\r
+    left: 10px;\r
+    top: 8px;\r
+    width: 180px;\r
+    height: 50px;\r
+}\r
+\r
+/* Progress bar */\r
+.NotificationPopupProgressBar {\r
+    position: absolute;\r
+    left: 6px;\r
+    top: 60px;\r
+    width: 218px;\r
+    height: 16px;\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/ActionControl.js b/wrt/zouba/WRTKit/UI/ActionControl.js
new file mode 100644 (file)
index 0000000..f97c8e5
--- /dev/null
@@ -0,0 +1,144 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The ActionControl class is an abstract base class for action controls like\r
+// buttons. Don't use ActionControl directly.\r
+\r
+// Constructor.\r
+function ActionControl(id, caption) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption);\r
+    }\r
+}\r
+\r
+// ActionControl inherits from Control.\r
+ActionControl.prototype = new Control(UI_NO_INIT_ID);\r
+\r
+// Reference to the button element.\r
+ActionControl.prototype.buttonElement = null;\r
+\r
+// Reference to the link element.\r
+ActionControl.prototype.linkElement = null;\r
+\r
+// Enabled status.\r
+ActionControl.prototype.enabled = false;\r
+\r
+// Initializer - called from constructor.\r
+ActionControl.prototype.init = function(id, caption) {\r
+    uiLogger.debug("ActionControl.init(" + id + ", " + caption + ")");\r
+    \r
+    // call superclass initializer\r
+    Control.prototype.init.call(this, id, caption);\r
+    \r
+    // the control defaults to enabled\r
+    this.enabled = true;\r
+}\r
+\r
+// Common event listeners hookup function called from subclasses.\r
+ActionControl.prototype.bindActionControlListeners = function() {\r
+    var self = this;\r
+    this.linkElement.addEventListener("focus", function() { self.focusStateChanged(true); }, false);\r
+    this.linkElement.addEventListener("blur", function() { self.focusStateChanged(false); }, false);\r
+    this.buttonElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);\r
+    this.buttonElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);\r
+    this.buttonElement.addEventListener("mousedown", function(event) {\r
+                                                       self.controlClicked(event);\r
+                                                       event.stopPropagation();\r
+                                                       event.preventDefault();\r
+                                                   }, true);\r
+    this.buttonElement.addEventListener("keydown", function(event) {\r
+                                                    // center and enter trigger the action\r
+                                                    if (event.keyCode == 0 || event.keyCode == 13) {\r
+                                                        self.controlClicked();\r
+                                                        event.stopPropagation();\r
+                                                        event.preventDefault();\r
+                                                    }\r
+                                                 }, true);\r
+}\r
+\r
+// Returns the enabled state.\r
+ActionControl.prototype.isEnabled = function() {\r
+    return this.enabled;\r
+}\r
+\r
+// Sets the enabled state.\r
+ActionControl.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("ActionControl.setEnabled(" + enabled + ")");\r
+    // switch the state\r
+    this.enabled = enabled;\r
+}\r
+\r
+// Sets the focused state for the control.\r
+// Note: This may not always succeed.\r
+ActionControl.prototype.setFocused = function(focused) {\r
+    uiLogger.debug("ActionControl.setFocused(" + focused + ")");\r
+    if (this.enabled) {\r
+        if (focused) {\r
+            this.linkElement.focus();\r
+        } else {\r
+            this.linkElement.blur();\r
+        }\r
+    }\r
+}\r
+\r
+// Callback for clicks.\r
+ActionControl.prototype.controlClicked = function(event) {\r
+    uiLogger.debug("ActionControl.controlClicked()");\r
+    \r
+    // if we're enabled then a click results in an action performed event\r
+    if (this.enabled) {\r
+        // focus when clicked\r
+        if (!this.focused) {\r
+            this.linkElement.focus();\r
+        }\r
+        \r
+        // notify event listeners\r
+        this.actionPerformed(event);\r
+    }\r
+}\r
+\r
+// Callback for action performed events.\r
+ActionControl.prototype.actionPerformed = function(event) {\r
+    uiLogger.debug("ActionControl.actionPerformed()");\r
+    // notify event listeners\r
+    this.fireEvent(this.createEvent("ActionPerformed", event));\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/Ajax.js b/wrt/zouba/WRTKit/UI/Ajax.js
new file mode 100644 (file)
index 0000000..4f34aa5
--- /dev/null
@@ -0,0 +1,103 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// Ajax utility calss to create XmlHttpRequest object\r
+function Ajax() \r
+{\r
+       //      xmlHttpRequest object   \r
+       var request = null;\r
+\r
+    // branch for native XMLHttpRequest object\r
+    if(window.XMLHttpRequest && !(window.ActiveXObject)) {\r
+       try \r
+               {\r
+                       request = new XMLHttpRequest();\r
+                       try\r
+                       {\r
+                               //      attach the Bypass code, if the browser is firefox\r
+                               if(netscape.security.PrivilegeManager.enablePrivilege)\r
+                               {\r
+                                       //      duplicate the function\r
+                                       request._open = request.open;\r
+                                       \r
+                                       //      redefine the function definition\r
+                                       request.open = function(method, url, flag)\r
+                                       {\r
+                                               try\r
+                                               {\r
+                                                       // Enable Universal Browser Read\r
+                                                       netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");\r
+\r
+                                                       //      call the native XmlHttpRequest.open method\r
+                                                       this._open(method, url, flag);\r
+                                               }catch(e)\r
+                                               {\r
+                                                       //      call the native XmlHttpRequest.open method\r
+                                                       this._open(method, url, flag);\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+                       catch(e)\r
+                       {\r
+                               //      eatup all exceptions\r
+                       }\r
+               } \r
+               catch(e) {\r
+                       request = null;\r
+        }\r
+    // branch for IE/Windows ActiveX version\r
+    } else if(window.ActiveXObject) {\r
+               try {\r
+               request = new ActiveXObject("Msxml2.XMLHTTP");\r
+       } catch(e) {\r
+               try {\r
+                       request = new ActiveXObject("Microsoft.XMLHTTP");\r
+               } catch(e) {\r
+                       alert('Failed to create XmlHttprequest');\r
+                               return null;\r
+               }\r
+               }\r
+    }\r
+       \r
+       return (request);\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/ContentPanel.js b/wrt/zouba/WRTKit/UI/ContentPanel.js
new file mode 100644 (file)
index 0000000..90ed10f
--- /dev/null
@@ -0,0 +1,367 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The ContentPanel class is a control for displaying content. The panel\r
+// can be expanded and collapsed.\r
+\r
+// Constructor.\r
+function ContentPanel(id, caption, content, foldable, expanded) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, content, foldable, expanded);\r
+    }\r
+}\r
+\r
+// ContentPanel inherits from Control.\r
+ContentPanel.prototype = new Control(UI_NO_INIT_ID);\r
+\r
+// The element hierarchy in a content panel is as follows:\r
+//\r
+// rootElement\r
+//     assemblyElement\r
+//         captionElement\r
+//             foldToggleElement\r
+//                 captionLinkElement\r
+//                     captionTextElement\r
+//     contentElement\r
+//\r
+// captionTextElement is moved under foldToggleElement if disabled\r
+// or captionElement if not foldable\r
+\r
+// The fold toggle element used for folding content panels.\r
+ContentPanel.prototype.foldToggleElement = null;\r
+\r
+// The caption link element of this control.\r
+ContentPanel.prototype.captionLinkElement = null;\r
+\r
+// The caption text element of this control.\r
+ContentPanel.prototype.captionTextElement = null;\r
+\r
+// The content element of this control.\r
+ContentPanel.prototype.contentElement = null;\r
+\r
+// The foldable state of this control.\r
+ContentPanel.prototype.foldable = false;\r
+\r
+// The expanded state of this control.\r
+ContentPanel.prototype.expanded = false;\r
+\r
+// Enabled status.\r
+ContentPanel.prototype.enabled = false;\r
+\r
+// Initializer - called from constructor.\r
+ContentPanel.prototype.init = function(id, caption, content, foldable, expanded) {\r
+    uiLogger.debug("ContentPanel.init(" + id + ", " + caption + ", " + content + ", " + foldable + ", " + expanded + ")");\r
+    \r
+    // call superclass initializer\r
+    Control.prototype.init.call(this, id, caption);\r
+    \r
+    // the control defaults to enabled\r
+    this.enabled = true;\r
+    \r
+    // create caption text element\r
+    this.captionTextElement = document.createElement("span");\r
+    \r
+    // disconnect the control element\r
+    this.assemblyElement.removeChild(this.controlElement);\r
+    \r
+    // set the foldable state\r
+    this.foldable = foldable;\r
+    \r
+    // is this a foldable content panel?\r
+    if (foldable) {\r
+        // create fold toggle element\r
+        this.foldToggleElement = document.createElement("div");\r
+        this.captionElement.appendChild(this.foldToggleElement);\r
+        \r
+        // create caption link and add to caption element\r
+        this.captionLinkElement = document.createElement("a");\r
+        this.captionLinkElement.href = "JavaScript:void(0)";\r
+        this.foldToggleElement.appendChild(this.captionLinkElement);\r
+        \r
+        // add the text element to the link element\r
+        this.captionLinkElement.appendChild(this.captionTextElement);\r
+        \r
+        // bind event listeners\r
+        var self = this;\r
+        this.captionLinkElement.addEventListener("focus", function() { self.focusStateChanged(true); }, false);\r
+        this.captionLinkElement.addEventListener("blur", function() { self.focusStateChanged(false); }, false);\r
+        this.foldToggleElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);\r
+        this.foldToggleElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);\r
+        this.foldToggleElement.addEventListener("mousedown", function(event) {\r
+                                                                 self.captionClicked();\r
+                                                                 event.stopPropagation();\r
+                                                                 event.preventDefault();\r
+                                                             }, true);\r
+        this.foldToggleElement.addEventListener("keydown", function(event) {\r
+                                                               // center and enter trigger the action\r
+                                                               if (event.keyCode == 0 || event.keyCode == 13) {\r
+                                                                   self.captionClicked();\r
+                                                                   event.stopPropagation();\r
+                                                                   event.preventDefault();\r
+                                                               }\r
+                                                           }, true);\r
+        \r
+        this.expanded = expanded;\r
+    } else {\r
+        // since this is not a foldable panel the content should be expanded\r
+        this.expanded = true;\r
+        \r
+        // add the text element directly to the caption element\r
+        this.captionElement.appendChild(this.captionTextElement);\r
+    }\r
+    \r
+    // create content element\r
+    this.contentElement = document.createElement("div");\r
+    this.contentElement.style.display = this.expanded ? "block" : "none";\r
+    this.rootElement.appendChild(this.contentElement);\r
+    \r
+    // set caption, content and expanded state\r
+    this.setCaption(caption);\r
+    this.setContent(content);\r
+    \r
+    // update style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the enabled state.\r
+ContentPanel.prototype.isEnabled = function() {\r
+    return this.enabled;\r
+}\r
+\r
+// Sets the enabled state.\r
+ContentPanel.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("ContentPanel.setEnabled(" + enabled + ")");\r
+    \r
+    // bail out early if there is no change in state\r
+    if (this.enabled == enabled) {\r
+        return;\r
+    }\r
+    \r
+    // set the enabled state\r
+    this.enabled = enabled;\r
+    \r
+    // is this a foldable content?\r
+    if (this.foldable) {\r
+         // the caption link must be disabled\r
+        if (this.enabled) {\r
+            // diabled -> enabled\r
+            this.foldToggleElement.removeChild(this.captionTextElement);\r
+            this.foldToggleElement.appendChild(this.captionLinkElement);\r
+            this.captionLinkElement.appendChild(this.captionTextElement);\r
+        } else {\r
+            // enabled -> diabled\r
+            this.captionLinkElement.removeChild(this.captionTextElement);\r
+            this.foldToggleElement.removeChild(this.captionLinkElement);\r
+            this.foldToggleElement.appendChild(this.captionTextElement);\r
+        }\r
+    }\r
+    \r
+    // update style\r
+    this.updateStyleFromState();    \r
+}\r
+\r
+// Returns the caption; null if none.\r
+ContentPanel.prototype.getCaption = function() {\r
+    return this.caption;\r
+}\r
+\r
+// Sets the caption; null if none.\r
+ContentPanel.prototype.setCaption = function(caption) {\r
+    // bail out if the caption text element has not been created\r
+    // this is to prevent the superclass init calling this before\r
+    // we've initialized our custom caption\r
+    if (this.captionTextElement == null)\r
+        return;\r
+    \r
+    uiLogger.debug("ContentPanel.setCaption(" + caption + ")");\r
+    \r
+    // set the display style\r
+    this.captionElement.style.display = (caption == null) ? "none" : "block";\r
+    \r
+    // set the caption\r
+    this.caption = caption;\r
+    this.captionTextElement.innerHTML = (caption == null) ? "" : caption;\r
+    \r
+    // update style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the content.\r
+ContentPanel.prototype.getContent = function() {\r
+    return this.contentElement.innerHTML;\r
+}\r
+\r
+// Sets the content.\r
+ContentPanel.prototype.setContent = function(content) {\r
+    uiLogger.debug("ContentPanel.setContent(" + content + ")");\r
+    this.contentElement.innerHTML = (content == null) ? "" : content;\r
+}\r
+\r
+// Returns the focusable state for the control.\r
+ContentPanel.prototype.isFocusable = function() {\r
+    // a content panel is focusable if it's foldable and enabled\r
+    return (this.foldable && this.enabled);\r
+}\r
+\r
+// Sets the focused state for the control.\r
+// Note: This may not always succeed.\r
+ContentPanel.prototype.setFocused = function(focused) {\r
+    uiLogger.debug("ContentPanel.setFocused(" + focused + ")");\r
+    if (this.enabled && this.foldable) {\r
+        if (focused) {\r
+            this.captionLinkElement.focus();\r
+        } else {\r
+            this.captionLinkElement.blur();\r
+        }\r
+    }\r
+    // note that this.focused gets set as a result of focusStateChanged() being called\r
+    // rather than setting it explicitly here\r
+}\r
+\r
+// Returns the expanded state.\r
+ContentPanel.prototype.isExpanded = function() {\r
+    return this.expanded;\r
+}\r
+\r
+// Sets the expanded state.\r
+ContentPanel.prototype.setExpanded = function(expanded) {\r
+    uiLogger.debug("ContentPanel.setExpanded(" + expanded + ")");\r
+    \r
+    // make sure only foldable content panels are folded\r
+    if (!this.foldable) {\r
+        uiLogger.warn("Cannot fold a non-foldable content panel!");\r
+        return;\r
+    }\r
+    \r
+    this.expanded = expanded;\r
+    if (this.expanded) {\r
+        // expand\r
+        this.contentElement.style.display = "block";\r
+        \r
+        // find out control top and bottom\r
+        var controlTop = this.getAbsoluteTop(this.rootElement);\r
+        var controlHeight = this.rootElement.clientHeight;\r
+        var controlBottom = controlTop + controlHeight;\r
+        \r
+        // find out the viewport top and bottom\r
+        var viewportTop = window.scrollY;\r
+        var viewportHeight = window.innerHeight;\r
+        var viewportBottom = viewportTop + viewportHeight;\r
+        \r
+        // make sure the control is positioned so that it can be seen\r
+        var overflow = controlBottom - viewportBottom;\r
+        if (overflow > 0) {\r
+            // there's overflow so we need to scroll to get the control\r
+            // into the viewport - however not so far that the control\r
+            // goes past the viewport top.\r
+            var distanceToTop = controlTop - viewportTop;\r
+            var scrollAmount = Math.min(overflow, distanceToTop);\r
+            window.scrollBy(0, scrollAmount);\r
+        }\r
+    } else {\r
+        // collapse\r
+        this.contentElement.style.display = "none";\r
+    }\r
+    \r
+    // notify event listeners\r
+    this.fireEvent(this.createEvent("ExpandedStateChanged", this.expanded));\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the absolute position (y) of the given element.\r
+ContentPanel.prototype.getAbsoluteTop = function(element) {\r
+    // traverse from element to root and add top-offset\r
+    // for each element we find on the way\r
+    var absTop = 0;\r
+    while (element != null) {\r
+        absTop += element.offsetTop;\r
+        element = element.offsetParent;\r
+    }\r
+    return absTop;\r
+}\r
+\r
+// Callback for when the caption is clicked.\r
+ContentPanel.prototype.captionClicked = function() {\r
+    uiLogger.debug("ContentPanel.captionClicked()");\r
+    \r
+    // if we're enabled then a click results toggling the expanded state\r
+    if (this.enabled) {\r
+        // focus when clicked\r
+        if (!this.focused) {\r
+            this.captionLinkElement.focus();\r
+        }\r
+        \r
+        // toggle the expanded state\r
+        this.setExpanded(!this.expanded);\r
+    }\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+ContentPanel.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("ContentPanel.updateStyleFromState()");\r
+\r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set root element class name\r
+    this.setClassName(this.rootElement, "Control");\r
+\r
+    // set the control assembly class names\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);\r
+    \r
+    if (this.foldable) {\r
+        // foldable content panel\r
+        this.setClassName(this.captionElement, "ContentPanelCaptionFoldable");\r
+        this.setClassName(this.foldToggleElement, "ContentPanelFoldToggle ContentPanelFoldToggle" + (this.expanded ? "Expanded" : "Collapsed"));\r
+    } else {\r
+        // non-folding\r
+        this.setClassName(this.captionElement, "ContentPanelCaptionNonFoldable");\r
+    }\r
+    \r
+    // set the content caption text class names\r
+    this.setClassName(this.captionTextElement, "ContentPanelCaptionText ContentPanelCaptionText" + stateName);\r
+    \r
+    // set the content element class names\r
+    this.setClassName(this.contentElement, "ContentPanelContent");\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/Control.js b/wrt/zouba/WRTKit/UI/Control.js
new file mode 100644 (file)
index 0000000..fd3c8bb
--- /dev/null
@@ -0,0 +1,231 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The Control class is an abstract base class for all user interface controls.\r
+\r
+// Constructor.\r
+function Control(id, caption) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption);\r
+    }\r
+}\r
+\r
+// Control inherits from UIElement.\r
+Control.prototype = new UIElement(UI_NO_INIT_ID);\r
+\r
+// The view that control belongs to.\r
+Control.prototype.view = null;\r
+\r
+// Is the control focused?\r
+Control.prototype.focused = false;\r
+\r
+// Is the pointer over this control?\r
+Control.prototype.hovering = false;\r
+\r
+// The element hierarchy in a control is as follows:\r
+//\r
+// rootElement\r
+//     assemblyElement\r
+//         captionElement\r
+//         controlElement\r
+//\r
+// The assembly element groups the portion of a control that typically handle\r
+// the visual effects for focus and hover states. Having a separate root and\r
+// assembly elements allows other elements to be added to a control without\r
+// them being affected by the CSS rules of the assembly element.\r
+\r
+// The assembly element of this control.\r
+Control.prototype.assemblyElement = null;\r
+\r
+// The caption of this control; null if none.\r
+Control.prototype.caption = null;\r
+\r
+// The caption element of this control.\r
+Control.prototype.captionElement = null;\r
+\r
+// The control element of this control.\r
+Control.prototype.controlElement = null;\r
+\r
+// Initializer - called from constructor.\r
+Control.prototype.init = function(id, caption) {\r
+    uiLogger.debug("Control.init(" + id + ", " + caption + ")");\r
+    \r
+    // call superclass initializer\r
+    UIElement.prototype.init.call(this, id);\r
+    \r
+    // create assembly, caption and control elements\r
+    this.assemblyElement = document.createElement("div");\r
+    this.captionElement = document.createElement("div");\r
+    this.assemblyElement.appendChild(this.captionElement);\r
+    this.controlElement = document.createElement("div");\r
+    this.assemblyElement.appendChild(this.controlElement);\r
+    this.rootElement.appendChild(this.assemblyElement);\r
+    \r
+    // set the caption\r
+    // style is not updated because the subclass will update the style later\r
+    // when it has completely initialized the component\r
+    this.setCaption(caption, true);\r
+}\r
+\r
+// Returns the caption; null if none.\r
+Control.prototype.getCaption = function() {\r
+    return this.caption;\r
+}\r
+\r
+// Sets the caption; null if none.\r
+Control.prototype.setCaption = function(caption, noStyleUpdate) {\r
+    uiLogger.debug("Control.setCaption(" + caption + ")");\r
+    \r
+    // set the display style\r
+    this.captionElement.style.display = (caption == null) ? "none" : "block";\r
+    \r
+    // set the caption\r
+    this.caption = caption;\r
+    this.captionElement.innerHTML = (caption == null) ? "" : caption;\r
+    \r
+    // update style\r
+    if (!noStyleUpdate) {\r
+        this.updateStyleFromState();\r
+    }\r
+}\r
+\r
+// Returns the enabled state.\r
+// Override this in subclasses as required to implement the state change.\r
+Control.prototype.isEnabled = function() {\r
+    return false;\r
+}\r
+\r
+// Sets the enabled state.\r
+// Override this in subclasses as required to implement the state change.\r
+Control.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("Control.setEnabled(" + enabled + ")");\r
+}\r
+\r
+// Returns the focusable state for the control.\r
+// Defaults focusable if enabled - override this in subclasses as required.\r
+Control.prototype.isFocusable = function() {\r
+    return this.isEnabled();\r
+}\r
+\r
+// Returns the focused state for the control.\r
+Control.prototype.isFocused = function() {\r
+    return this.focused;\r
+}\r
+\r
+// Sets the focused state for the control.\r
+// Note: This may not always succeed.\r
+// Override this in subclasses as required to implement the state change.\r
+Control.prototype.setFocused = function(focused) {\r
+    uiLogger.debug("Control.setFocused(" + focused + ")");\r
+    // note that this.focused gets set as a result of focusStateChanged() being called\r
+    // rather than setting it explicitly here\r
+}\r
+\r
+// Called when the focus state has changed for this control.\r
+Control.prototype.focusStateChanged = function(focused) {\r
+    uiLogger.debug("Control.focusStateChanged(" + focused + ")");\r
+    if (this.focused != focused) {\r
+        this.focused = focused;\r
+        \r
+        // let the view know about the focus change\r
+        if (this.view != null) {\r
+            this.view.focusedControlChanged(focused ? this : null);\r
+        }\r
+        \r
+        // update the style from the current state\r
+        this.updateStyleFromState();\r
+        \r
+        // notify event listeners\r
+        this.fireEvent(this.createEvent("FocusStateChanged", focused));\r
+    }\r
+}\r
+\r
+// Called when the hover state has changed for this control.\r
+Control.prototype.hoverStateChanged = function(hovering) {\r
+    uiLogger.debug("Control.hoverStateChanged(" + hovering + ")");\r
+    if (this.hovering != hovering) {\r
+        this.hovering = hovering;\r
+        \r
+        // update the style from the current state\r
+        this.updateStyleFromState();\r
+        \r
+        // notify event listeners\r
+        this.fireEvent(this.createEvent("HoverStateChanged", hovering));\r
+    }\r
+}\r
+\r
+// Helper method that returns the state name for the current state.\r
+Control.prototype.getStyleStateName = function() {\r
+    var focusable = this.isFocusable();\r
+    if (focusable && this.focused) {\r
+        return "Focus";\r
+    } else if (focusable && this.hovering) {\r
+        return "Hover";\r
+    } else if (!this.isEnabled()) {\r
+        return "Disabled";\r
+    } else {\r
+        return "Normal";\r
+    }\r
+}\r
+\r
+// Resets the state tracking for focus and hover.\r
+// Override this in subclasses as required to implement the state reset.\r
+Control.prototype.resetFocusState = function() {\r
+    uiLogger.debug("Control.resetFocusState()");\r
+    this.hovering = false;\r
+    this.focused = false;\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Helper function that sets a classname for an element.\r
+// Only sets the class name if it actually is different from the current value.\r
+Control.prototype.setClassName = function(element, className) {\r
+    if (element.className != className) {\r
+        element.className = className;\r
+    }\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+// Override this in subclasses as required to implement the state change.\r
+Control.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("Control.updateStyleFromState()");\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/FormButton.js b/wrt/zouba/WRTKit/UI/FormButton.js
new file mode 100644 (file)
index 0000000..b02ba32
--- /dev/null
@@ -0,0 +1,177 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The FormButton class implements a button control for use in form-style UIs.\r
+\r
+// Constructor.\r
+function FormButton(id, text) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, text);\r
+    }\r
+}\r
+\r
+// FormButton inherits from ActionControl.\r
+FormButton.prototype = new ActionControl(UI_NO_INIT_ID);\r
+\r
+// Button table element.\r
+FormButton.prototype.tableElement = null;\r
+\r
+// Button table row element.\r
+FormButton.prototype.tableRowElement = null;\r
+\r
+// Button table left cell element.\r
+FormButton.prototype.tableLeftCellElement = null;\r
+\r
+// Button table center cell element.\r
+FormButton.prototype.tableCenterCellElement = null;\r
+\r
+// Button text element.\r
+FormButton.prototype.textElement = null;\r
+\r
+// Button table right cell element.\r
+FormButton.prototype.tableRightCellElement = null;\r
+\r
+// Initializer - called from constructor.\r
+FormButton.prototype.init = function(id, text) {\r
+    uiLogger.debug("FormButton.init(" + id + ", " + text + ")");\r
+    \r
+    // call superclass initializer\r
+    ActionControl.prototype.init.call(this, id, null);\r
+    \r
+    // remove caption element\r
+    this.assemblyElement.removeChild(this.captionElement);\r
+    \r
+    // construct the button\r
+    this.buttonElement = document.createElement("div");\r
+    this.tableElement = document.createElement("table");\r
+    this.tableRowElement = document.createElement("tr");\r
+    this.tableLeftCellElement = document.createElement("td");\r
+    this.tableCenterCellElement = document.createElement("td");\r
+    this.linkElement = document.createElement("a");\r
+    this.linkElement.href = "JavaScript:void(0)";\r
+    this.textElement = document.createElement("span");\r
+    this.tableRightCellElement = document.createElement("td");\r
+    this.tableElement.appendChild(this.tableRowElement);\r
+    this.tableRowElement.appendChild(this.tableLeftCellElement);\r
+    this.tableRowElement.appendChild(this.tableCenterCellElement);\r
+    this.tableCenterCellElement.appendChild(this.linkElement);\r
+    this.linkElement.appendChild(this.textElement);\r
+    this.tableRowElement.appendChild(this.tableRightCellElement);\r
+    this.buttonElement.appendChild(this.tableElement);\r
+    this.controlElement.appendChild(this.buttonElement);\r
+    \r
+    // set the text\r
+    this.setText(text);\r
+    \r
+    // bind event listeners\r
+    this.bindActionControlListeners();\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Sets the enabled state.\r
+FormButton.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("FormButton.setEnabled(" + enabled + ")");\r
+    \r
+    // bail out early if there is no change in state\r
+    if (this.enabled == enabled) {\r
+        return;\r
+    }\r
+    \r
+    // set the enabled state\r
+    this.enabled = enabled;\r
+    \r
+    if (this.enabled) {\r
+        // diabled -> enabled\r
+        this.tableCenterCellElement.removeChild(this.textElement);\r
+        this.tableCenterCellElement.appendChild(this.linkElement);\r
+        this.linkElement.appendChild(this.textElement);\r
+    } else {\r
+        // enabled -> diabled\r
+        this.linkElement.removeChild(this.textElement);\r
+        this.tableCenterCellElement.removeChild(this.linkElement);\r
+        this.tableCenterCellElement.appendChild(this.textElement);\r
+    }\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the button text.\r
+FormButton.prototype.getText = function() {\r
+    return this.textElement.innerHTML;\r
+}\r
+\r
+// Sets the button text.\r
+FormButton.prototype.setText = function(text) {\r
+    uiLogger.debug("FormButton.setText(" + text + ")");\r
+    this.textElement.innerHTML = (text == null) ? "" : text;;\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+FormButton.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("FormButton.updateStyleFromState()");\r
+    \r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set root element class name\r
+    this.setClassName(this.rootElement, "Control");\r
+    \r
+    // set the control assembly class names\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssemblyNormal");\r
+    \r
+    // control element\r
+    this.setClassName(this.controlElement, "ControlElement FormButtonControlElement");\r
+    \r
+    // set the button table class names\r
+    this.setClassName(this.buttonElement, "FormButton");\r
+    this.setClassName(this.tableElement, "FormButtonTable");\r
+    this.setClassName(this.tableRowElement, "FormButtonRow");\r
+    this.setClassName(this.tableLeftCellElement, "FormButtonLeftCell FormButtonLeftCell" + stateName);\r
+    this.setClassName(this.tableCenterCellElement, "FormButtonCenterCell FormButtonLeftCell" + stateName);\r
+    this.setClassName(this.tableRightCellElement, "FormButtonRightCell FormButtonLeftCell" + stateName);\r
+    \r
+    // set the button text class name\r
+    this.setClassName(this.textElement, "FormButtonText FormButtonText" + stateName);\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/Label.js b/wrt/zouba/WRTKit/UI/Label.js
new file mode 100644 (file)
index 0000000..5a7c645
--- /dev/null
@@ -0,0 +1,105 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The Label class implements a control that displays textual content.\r
+\r
+// Constructor.\r
+function Label(id, caption, text) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, text);\r
+    }\r
+}\r
+\r
+// Label inherits from Control.\r
+Label.prototype = new Control(UI_NO_INIT_ID);\r
+\r
+// Content element for label text.\r
+Label.prototype.contentElement = null;\r
+\r
+// Initializer - called from constructor.\r
+Label.prototype.init = function(id, caption, text) {\r
+    uiLogger.debug("Label.init(" + id + ", " + caption + ", " + text + ")");\r
+    \r
+    // call superclass initializer\r
+    Control.prototype.init.call(this, id, caption);\r
+    \r
+    // create content element\r
+    this.contentElement = document.createElement("div");\r
+    this.controlElement.appendChild(this.contentElement);\r
+    \r
+    // set the text\r
+    this.setText(text);\r
+}\r
+\r
+// Returns the enabled state for the control.\r
+Label.prototype.isEnabled = function() {\r
+    return true;\r
+}\r
+\r
+// Returns the focusable state for the control.\r
+Label.prototype.isFocusable = function() {\r
+    return false;\r
+}\r
+\r
+// Returns the control text.\r
+Label.prototype.getText = function() {\r
+    return this.contentElement.innerHTML;\r
+}\r
+\r
+// Sets the text for the control.\r
+Label.prototype.setText = function(text) {\r
+    uiLogger.debug("Label.setText(" + text + ")");\r
+    this.contentElement.innerHTML = (text == null) ? "" : text;\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+Label.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("Label.updateStyleFromState()");\r
+    \r
+    // set element class names\r
+    this.setClassName(this.rootElement, "Control");\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssemblyNormal");\r
+    this.setClassName(this.captionElement, "ControlCaption ControlCaptionNormal");\r
+    this.setClassName(this.controlElement, "ControlElement");\r
+    this.setClassName(this.contentElement, "LabelText");\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/ListView.js b/wrt/zouba/WRTKit/UI/ListView.js
new file mode 100644 (file)
index 0000000..54d4c8e
--- /dev/null
@@ -0,0 +1,189 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The ListView class implements a vertical list view that hosts controls\r
+// as child components.\r
+\r
+// Constructor.\r
+function ListView(id, caption) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption);\r
+    }\r
+}\r
+\r
+// ListView inherits from View.\r
+ListView.prototype = new View(UI_NO_INIT_ID);\r
+\r
+// The caption of this view; null if none.\r
+ListView.prototype.caption = null;\r
+\r
+// The caption element of this view.\r
+ListView.prototype.captionElement = null;\r
+\r
+// The caption text element of this view.\r
+ListView.prototype.captionTextElement = null;\r
+\r
+// Root HTML element for controls.\r
+ListView.prototype.listElement = null;\r
+\r
+// List of controls in the view.\r
+ListView.prototype.controls = null;\r
+\r
+// Initializer for ListView.\r
+ListView.prototype.init = function(id, caption) {\r
+    uiLogger.debug("ListView.init(" + id + ", " + caption + ")");\r
+    \r
+    // call superclass initializer\r
+    View.prototype.init.call(this, id);\r
+    \r
+    // init control array\r
+    this.controls = [];\r
+    \r
+    // set style class name for root element\r
+    this.rootElement.className = "ListView";\r
+    \r
+    // create caption and caption text elements\r
+    this.captionElement = document.createElement("div");\r
+    this.captionElement.className = "ListViewCaption";\r
+    this.captionTextElement = document.createElement("div");\r
+    this.captionTextElement.className = "ListViewCaptionText";\r
+    this.captionElement.appendChild(this.captionTextElement);\r
+    this.rootElement.appendChild(this.captionElement);\r
+    \r
+    // create root element for controls and add to the view root element\r
+    this.listElement = document.createElement("div");\r
+    this.listElement.className = "ListViewControlList";\r
+    this.rootElement.appendChild(this.listElement);\r
+    \r
+    // set the caption\r
+    this.setCaption(caption);\r
+}\r
+\r
+// Returns the caption; null if none.\r
+ListView.prototype.getCaption = function() {\r
+    return this.caption;\r
+}\r
+\r
+// Sets the caption; null if none.\r
+ListView.prototype.setCaption = function(caption) {\r
+    uiLogger.debug("ListView.setCaption(" + caption + ")");\r
+    \r
+    // set the display style\r
+    this.captionElement.style.display = (caption == null) ? "none" : "block";\r
+    \r
+    // set the caption\r
+    this.caption = caption;\r
+    this.captionTextElement.innerHTML = (caption == null) ? "" : caption;\r
+}\r
+\r
+// Returns an array of controls in the view.\r
+ListView.prototype.getControls = function() {\r
+    return this.controls;\r
+}\r
+\r
+// Adds a control to the view.\r
+ListView.prototype.addControl = function(control) {\r
+    uiLogger.debug("ListView.addControl(" + control + ")");\r
+    \r
+    // add the control to the controls array and attach it to the list element\r
+    this.controls.push(control);\r
+    this.listElement.appendChild(control.rootElement);\r
+    control.view = this;\r
+}\r
+\r
+// Inserts a control to the view before the specified control.\r
+ListView.prototype.insertControl = function(control, beforeControl) {\r
+    uiLogger.debug("ListView.insertControl(" + control + ", " + beforeControl + ")");\r
+    \r
+    // iterate through current controls\r
+    for (var i = 0; i < this.controls.length; i++) {\r
+        // is this the control we should insert before?\r
+        if (this.controls[i] == beforeControl) {\r
+            // we found the control to insert before - insert here and connect to list element\r
+            this.controls.splice(i, 0, control);\r
+            this.listElement.insertBefore(control.rootElement, beforeControl.rootElement);\r
+            control.view = this;\r
+            return;\r
+        }\r
+    }\r
+    \r
+    // the control wasn't found so we'll add it last\r
+    this.addControl(control);\r
+}\r
+\r
+// Removes a control from the view.\r
+ListView.prototype.removeControl = function(control) {\r
+    uiLogger.debug("ListView.removeControl(" + control + ")");\r
+    \r
+    // iterate through current controls\r
+    for (var i = 0; i < this.controls.length; i++) {\r
+        // is this the control we should remove?\r
+        if (this.controls[i] == control) {\r
+            // we found the control to remove - remove it from the list element\r
+            this.controls.splice(i, 1);\r
+            this.listElement.removeChild(control.rootElement);\r
+            control.view = null;\r
+        }\r
+    }\r
+}\r
+\r
+// Attempts to focus the first focusable control.\r
+ListView.prototype.focusFirstControl = function() {\r
+    uiLogger.debug("ListView.focusFirstControl()");\r
+    for (var i = 0; i < this.controls.length; i++) {\r
+        // is this control focusable?\r
+        var control = this.controls[i];\r
+        if (control.isFocusable()) {\r
+            control.setFocused(true);\r
+            break;\r
+        }\r
+    }\r
+}\r
+\r
+// Attempts to reset all control focus states.\r
+// Override in subclasses as required.\r
+ListView.prototype.resetControlFocusStates = function() {\r
+    uiLogger.debug("ListView.resetControlFocusStates()");\r
+    for (var i = 0; i < this.controls.length; i++) {\r
+        this.controls[i].resetFocusState();\r
+    }\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/NavigationButton.js b/wrt/zouba/WRTKit/UI/NavigationButton.js
new file mode 100644 (file)
index 0000000..bfcf750
--- /dev/null
@@ -0,0 +1,220 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The NavigationButton class implements a button control for use in\r
+// navigational contexts in menu-style UIs.\r
+\r
+// Constructor.\r
+function NavigationButton(id, image, text) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, image, text);\r
+    }\r
+}\r
+\r
+// NavigationButton inherits from ActionControl.\r
+NavigationButton.prototype = new ActionControl(UI_NO_INIT_ID);\r
+\r
+// Button table element.\r
+NavigationButton.prototype.tableElement = null;\r
+\r
+// Button table row element.\r
+NavigationButton.prototype.tableRowElement = null;\r
+\r
+// Button table left cell element.\r
+NavigationButton.prototype.tableLeftCellElement = null;\r
+\r
+// Button table right cell element.\r
+NavigationButton.prototype.tableRightCellElement = null;\r
+\r
+// Button image element.\r
+NavigationButton.prototype.imageElement = null;\r
+\r
+// Button link element.\r
+NavigationButton.prototype.linkElement = null;\r
+\r
+// Button text element.\r
+NavigationButton.prototype.textElement = null;\r
+\r
+// Initializer - called from constructor.\r
+NavigationButton.prototype.init = function(id, image, text) {\r
+    uiLogger.debug("NavigationButton.init(" + id + ", " + image + ", " + text + ")");\r
+    \r
+    // call superclass initializer\r
+    ActionControl.prototype.init.call(this, id, null);\r
+    \r
+    // remove caption element\r
+    this.assemblyElement.removeChild(this.captionElement);\r
+    \r
+    // construct the button\r
+    this.buttonElement = document.createElement("div");\r
+    this.tableElement = document.createElement("table");\r
+    this.tableRowElement = document.createElement("tr");\r
+    this.tableLeftCellElement = document.createElement("td");\r
+    this.tableRightCellElement = document.createElement("td");\r
+    this.imageElement = null;\r
+    this.linkElement = document.createElement("a");\r
+    this.linkElement.href = "JavaScript:void(0)";\r
+    this.textElement = document.createElement("span");\r
+    this.tableElement.appendChild(this.tableRowElement);\r
+    this.tableRowElement.appendChild(this.tableLeftCellElement);\r
+    this.tableRowElement.appendChild(this.tableRightCellElement);\r
+    this.tableRightCellElement.appendChild(this.linkElement);\r
+    this.linkElement.appendChild(this.textElement);\r
+    this.buttonElement.appendChild(this.tableElement);\r
+    this.controlElement.appendChild(this.buttonElement);\r
+    \r
+    // set the image and text\r
+    this.setImage(image);\r
+    this.setText(text);\r
+    \r
+    // bind event listeners\r
+    this.bindActionControlListeners();\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Sets the enabled state.\r
+NavigationButton.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("NavigationButton.setEnabled(" + enabled + ")");\r
+    \r
+    // bail out early if there is no change in state\r
+    if (this.enabled == enabled) {\r
+        return;\r
+    }\r
+    \r
+    // set the enabled state\r
+    this.enabled = enabled;\r
+    \r
+    if (this.enabled) {\r
+        // diabled -> enabled\r
+        this.tableRightCellElement.removeChild(this.textElement);\r
+        this.tableRightCellElement.appendChild(this.linkElement);\r
+        this.linkElement.appendChild(this.textElement);\r
+    } else {\r
+        // enabled -> diabled\r
+        this.linkElement.removeChild(this.textElement);\r
+        this.tableRightCellElement.removeChild(this.linkElement);\r
+        this.tableRightCellElement.appendChild(this.textElement);\r
+    }\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the button image (URL); null if none.\r
+NavigationButton.prototype.getImage = function() {\r
+    return (this.imageElement != null) ? this.imageElement.src : null;\r
+}\r
+\r
+// Sets the button image (URL); null if none.\r
+NavigationButton.prototype.setImage = function(image) {\r
+    uiLogger.debug("NavigationButton.setImage(" + image + ")");\r
+    \r
+    if (image == null) {\r
+        // remove image - if any\r
+        if (this.imageElement != null) {\r
+            this.tableLeftCellElement.removeChild(this.imageElement);\r
+        }\r
+    } else {\r
+        // default to not append image element\r
+        var append = false;\r
+        \r
+        // create image element if one doesn't exist\r
+        if (this.imageElement == null) {\r
+            this.imageElement = document.createElement("img");\r
+            this.imageElement.setAttribute("alt", "");\r
+            append = true;\r
+        }\r
+        \r
+        // set image source URL\r
+        this.imageElement.src = image;\r
+        \r
+        // append the image element to the left cell?\r
+        if (append) {\r
+            this.tableLeftCellElement.appendChild(this.imageElement);\r
+        }\r
+    }\r
+}\r
+\r
+// Returns the button text.\r
+NavigationButton.prototype.getText = function() {\r
+    return this.textElement.innerHTML;\r
+}\r
+\r
+// Sets the button text.\r
+NavigationButton.prototype.setText = function(text) {\r
+    uiLogger.debug("NavigationButton.setText(" + text + ")");\r
+    this.textElement.innerHTML = (text == null) ? "" : text;;\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+NavigationButton.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("NavigationButton.updateStyleFromState()");\r
+    \r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set root element class name\r
+    this.setClassName(this.rootElement, "Control");\r
+    \r
+    // set the control assembly class names\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);\r
+    \r
+    // control element\r
+    this.setClassName(this.controlElement, "ControlElement NavigationButtonControlElement");\r
+    \r
+    // set the button table class names\r
+    this.setClassName(this.buttonElement, "NavigationButton");\r
+    this.setClassName(this.tableElement, "NavigationButtonTable");\r
+    this.setClassName(this.tableRowElement, "NavigationButtonRow");\r
+    this.setClassName(this.tableLeftCellElement, "NavigationButtonImageCell");\r
+    this.setClassName(this.tableRightCellElement, "NavigationButtonTextCell");\r
+    \r
+    // set image class names\r
+    if (this.imageElement) {\r
+        this.setClassName(this.imageElement, "NavigationButtonImage");\r
+    }\r
+    \r
+    // set the button text class name\r
+    this.setClassName(this.textElement, "NavigationButtonText NavigationButtonText" + stateName);\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/NotificationPopup.js b/wrt/zouba/WRTKit/UI/NotificationPopup.js
new file mode 100644 (file)
index 0000000..b69f3d0
--- /dev/null
@@ -0,0 +1,330 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The NotificationPopup class handles the display of notifications such as\r
+// warnings, information messages and progress indication.\r
+\r
+// Constructor.\r
+function NotificationPopup() {\r
+    // create notification popup\r
+    this.containerElement = document.createElement("div");\r
+    this.containerElement.className = "NotificationPopupContainer";\r
+    this.popupElement = document.createElement("div");\r
+    this.popupElement.className = "NotificationPopup";\r
+    this.typeIndicatorElement = document.createElement("div");\r
+    this.typeIndicatorElement.className = "NotificationPopupTypeIndicator";\r
+    this.textElement = document.createElement("div");\r
+    this.textElement.className = "NotificationPopupText";\r
+    this.progressBarElement = document.createElement("div");\r
+    this.progressBarElement.className = "NotificationPopupProgressBar";\r
+    \r
+    // assemble popup\r
+    this.popupElement.appendChild(this.typeIndicatorElement);\r
+    this.popupElement.appendChild(this.textElement);\r
+    this.popupElement.appendChild(this.progressBarElement);\r
+    this.containerElement.appendChild(this.popupElement);\r
+    \r
+    // create progress bar image element and initialize it\r
+    this.progressBarImageElement = document.createElement("img");\r
+    var self = this;\r
+    this.progressBarImageElement.addEventListener("load", function() { self.progressBarImageLoadingCompleted(); }, false);\r
+    this.progressBarImageElement.setAttribute("alt", "");\r
+    this.progressBarImageURL = this.getProgressBarImage(0);\r
+    this.progressBarImageElement.src = this.progressBarImageURL;\r
+    this.progressBarElement.appendChild(this.progressBarImageElement);\r
+    \r
+    // init the popup to be fully down\r
+    this.popupElement.style.top = "100%";\r
+    \r
+    // set default popup contents\r
+    this.setPopupContents(null, null, null);\r
+}\r
+\r
+// Notification container element.\r
+NotificationPopup.prototype.containerElement = null;\r
+\r
+// Notification popup element.\r
+NotificationPopup.prototype.popupElement = null;\r
+\r
+// Type indicator element.\r
+NotificationPopup.prototype.typeIndicatorElement = null;\r
+\r
+// Notification text element.\r
+NotificationPopup.prototype.textElement = null;\r
+\r
+// Progress bar element.\r
+NotificationPopup.prototype.progressBarElement = null;\r
+\r
+// Progress bar image element.\r
+NotificationPopup.prototype.progressBarImageElement = null;\r
+\r
+// Progress bar image URL.\r
+NotificationPopup.prototype.progressBarImageURL = null;\r
+\r
+// Has the progress bar image been loaded?\r
+NotificationPopup.prototype.progressBarImageLoaded = false;\r
+\r
+// Flag that tracks whether we're in the middle of starting to\r
+// show a notification popup.\r
+NotificationPopup.prototype.processingShowNotification = false;\r
+\r
+// Notification popup position (0 = hidden, 1 = showing).\r
+NotificationPopup.prototype.popupPosition = 0;\r
+\r
+// Interval for timer ticks (in milliseconds)\r
+NotificationPopup.prototype.ANIM_TIMER_INTERVAL = 25;\r
+\r
+// Animation timer identifier or null if no active timer.\r
+NotificationPopup.prototype.animTimerId = null;\r
+\r
+// Time in milliseconds for the popup animation to complete\r
+NotificationPopup.prototype.ANIM_TIME = 300;\r
+\r
+// Flag that determines the behavior of showNotification(). If set to true\r
+// the popup will snap open when showNotification() is called instead of\r
+// animation.\r
+NotificationPopup.prototype.SHOW_SNAPS_OPEN = true;\r
+\r
+// Animation direction (0 = no movement, -1 hiding, +1 = showing).\r
+NotificationPopup.prototype.animDir = 0;\r
+\r
+// Auto-hide timer identifier or null if no active timer.\r
+NotificationPopup.prototype.autoHideTimerId = null;\r
+\r
+// The commanded display time.\r
+NotificationPopup.prototype.displayTime = -1;\r
+\r
+// Displays a notification.\r
+NotificationPopup.prototype.showNotification = function(displayTime, type, text, progress) {\r
+    uiLogger.debug("NotificationPopup.showNotification(" + displayTime + ", " + type + ", " + text + ", " + progress + ")");\r
+    \r
+    // mark that showNotification() has been called and that we are in\r
+    // the middle of starting to show the notification popup\r
+    this.processingShowNotification = true;\r
+    \r
+    // remember the display time\r
+    this.displayTime = displayTime;\r
+    \r
+    // attach the popup to the document if not attached\r
+    if (this.containerElement.parentNode == null) {\r
+        document.body.appendChild(this.containerElement);\r
+        uiLogger.debug("Notification popup attached to document");\r
+    }\r
+    \r
+    // set popup contents and update style\r
+    this.setPopupContents(type, text, progress);\r
+    \r
+    // if the progress image is loaded then we can complete the showing\r
+    // of the notification popup immediately - otherwise the image loaded\r
+    // allback will complete the process.\r
+    if (this.progressBarImageLoaded) {\r
+        this.completeShowNotification();\r
+    }\r
+}\r
+\r
+// Completes displaying of a notification.\r
+// Note: Used internally - don't call this directly.\r
+NotificationPopup.prototype.completeShowNotification = function() {\r
+    uiLogger.debug("NotificationPopup.completeShowNotification()");\r
+    \r
+    // animation direction is +1 for showing the popup\r
+    if (this.popupPosition != 1) {\r
+        if (this.SHOW_SNAPS_OPEN) {\r
+            if (this.popupPosition == 0) {\r
+                this.popupPosition = 1;\r
+            }\r
+        }\r
+        this.animatePopup(1);\r
+    }\r
+    \r
+    // setup auto hiding if a display time is specified\r
+    if (this.displayTime > 0) {\r
+        // stop any existing timer\r
+        if (this.autoHideTimerId != null) {\r
+            clearTimeout(this.autoHideTimerId);\r
+            uiLogger.debug("Auto hide timer stopped");\r
+        }\r
+        // set timer to hide notification\r
+        var self = this;\r
+        this.autoHideTimerId = setTimeout(function() {\r
+                                              if (self.displayTime > 0) {\r
+                                                  self.hideNotification();\r
+                                              }\r
+                                          }, this.ANIM_TIME + this.displayTime);\r
+        uiLogger.debug("Auto hide timer started");\r
+    }\r
+    \r
+    // mark us as no longer processing a show notification call\r
+    this.processingShowNotification = false;\r
+}\r
+\r
+// Hides the currently displayed notification.\r
+NotificationPopup.prototype.hideNotification = function() {\r
+    uiLogger.debug("NotificationPopup.hideNotification()");\r
+    // mark us as no longer processing a show notification call\r
+    this.processingShowNotification = false;\r
+    \r
+    // animation direction is -1 for hiding the popup\r
+    if (this.popupPosition != 0) {\r
+        this.animatePopup(-1);\r
+    }\r
+    \r
+    // stop auto hide timer if one is set\r
+    if (this.autoHideTimerId != null) {\r
+        clearTimeout(this.autoHideTimerId);\r
+        this.autoHideTimerId = null;\r
+        uiLogger.debug("Auto hide timer stopped");\r
+    }\r
+}\r
+\r
+// Starts animation of the popup (1 to show, -1 to hide).\r
+NotificationPopup.prototype.animatePopup = function(direction) {\r
+    uiLogger.debug("NotificationPopup.animatePopup(" + direction + ")");\r
+    // set the direction and star the animation timer\r
+    this.animDir = direction;\r
+    if (this.animTimerId == null) {\r
+        var self = this;\r
+        this.animTimerId = setInterval(function() { self.animate(); }, this.ANIM_TIMER_INTERVAL);\r
+        uiLogger.debug("Notification popup animation started");\r
+    }\r
+}\r
+\r
+// Callback for animation timer.\r
+NotificationPopup.prototype.animate = function() {\r
+    // calculate new popup position and clamp\r
+    var animStep = (this.ANIM_TIMER_INTERVAL / this.ANIM_TIME) * this.animDir;\r
+    var newPos = this.popupPosition + animStep;\r
+    if (newPos < 0) {\r
+        newPos = 0;\r
+    } else if (newPos > 1) {\r
+        newPos = 1;\r
+    }\r
+    \r
+    // set the new position to the popup element\r
+    this.popupPosition = newPos;\r
+    this.popupElement.style.top = (100 - Math.round(this.popupPosition * 100)) + "%";\r
+    \r
+    // have we reached the end of the animation?\r
+    if (newPos == 0 || newPos == 1) {\r
+        // reset animation direction\r
+        this.animDir = 0;\r
+        \r
+        // remove the popup from the body if its hidden\r
+        if (newPos == 0) {\r
+            document.body.removeChild(this.containerElement);\r
+            uiLogger.debug("Notification popup detached from document");\r
+        }\r
+        \r
+        // stop timer\r
+        clearTimeout(this.animTimerId);\r
+        this.animTimerId = null;\r
+        uiLogger.debug("Notification popup animation stopped");\r
+    }\r
+}\r
+\r
+// Returns a URL for the progress bar image to use for the specified progress.\r
+NotificationPopup.prototype.getProgressBarImage = function(progress) {\r
+    // path for progress bar images\r
+    var progressBarImagePath = "WRTKit/Resources/";\r
+    \r
+    if (progress < 0) {\r
+        // unknown progress\r
+        return progressBarImagePath + "ProgressBarUnknown.gif";\r
+    } else {\r
+        // known progress (should be between 0 and 1)\r
+        var progPct = Math.round(progress * 10) * 10;\r
+        if (progPct < 0) {\r
+            progPct = 0;\r
+        } else if (progPct > 100) {\r
+            progPct = 100;\r
+        }\r
+        return progressBarImagePath + "ProgressBar" + progPct + ".png";\r
+    }\r
+}\r
+\r
+// Sets the contents of the popup.\r
+NotificationPopup.prototype.setPopupContents = function(type, text, progress) {\r
+    uiLogger.debug("NotificationPopup.setPopupContents(" + type + ", " + text + ", " + progress + ")");\r
+    \r
+    // figure out notification type style name\r
+    var typeName = (type == null) ? "none" : type.toLowerCase();\r
+    typeName = typeName.charAt(0).toUpperCase() + typeName.substring(1);\r
+    \r
+    // set type element class names\r
+    this.typeIndicatorElement.className = "NotificationPopupTypeIndicator NotificationPopupTypeIndicator" + typeName;\r
+    \r
+    // set notification text\r
+    this.textElement.innerHTML = (text == null) ? "" : text;\r
+    \r
+    // set progress\r
+    this.progressBarElement.style.display = (progress == null) ? "none" : "block";\r
+    if (progress != null) {\r
+        var imgURL = this.getProgressBarImage(progress);\r
+        if (imgURL != this.progressBarImageURL) {\r
+            // load new image\r
+            this.progressBarImageLoaded = false;\r
+            this.progressBarImageURL = imgURL;\r
+            this.progressBarImageElement.src = imgURL;\r
+        } else {\r
+            // the correct image is already loaded\r
+            this.progressBarImageLoaded = true;\r
+        }\r
+    } else {\r
+        // there is no progress bar so there is no need\r
+        // to load any progress bar image\r
+        this.progressBarImageLoaded = true;\r
+    }\r
+}\r
+\r
+// Callback for notifying the object that its progress bar image completed loading.\r
+NotificationPopup.prototype.progressBarImageLoadingCompleted = function() {\r
+    uiLogger.debug("NotificationPopup.progressBarImageLoadingCompleted()");\r
+    \r
+    // mark the progress bar image as loaded\r
+    this.progressBarImageLoaded = true;\r
+    \r
+    // complete the process of displaying the notification popup\r
+    // if it has been commanded but not yet completed\r
+    if (this.processingShowNotification) {\r
+        this.completeShowNotification();\r
+    }\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/Scrollbar.js b/wrt/zouba/WRTKit/UI/Scrollbar.js
new file mode 100644 (file)
index 0000000..88e2a56
--- /dev/null
@@ -0,0 +1,173 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The Scrollbar class is an implementation of a user interface element that\r
+// indicates the current viewport position in a document.\r
+\r
+// Constructor.\r
+function Scrollbar(parentElement) {\r
+    uiLogger.debug("Scrollbar(" + parentElement + ")");\r
+    \r
+    // get the parent element\r
+    this.parentElement = parentElement;\r
+    \r
+    // create the root element\r
+    this.rootElement = document.createElement("div");\r
+    this.rootElement.className = "Scrollbar";\r
+    this.rootElement.style.visibility = "hidden";\r
+    \r
+    // create the scrollbar\r
+    // the scrollbar consists of a root element with six children\r
+    // (three track elements and three thumb elements)\r
+    \r
+    // track\r
+    this.trackTopElement = document.createElement("div");\r
+    this.trackTopElement.className = "ScrollbarTrackTop";\r
+    this.trackMiddleElement = document.createElement("div");\r
+    this.trackMiddleElement.className = "ScrollbarTrackMiddle";\r
+    this.trackBottomElement = document.createElement("div");\r
+    this.trackBottomElement.className = "ScrollbarTrackBottom";\r
+    \r
+    // thumb\r
+    this.thumbTopElement = document.createElement("div");\r
+    this.thumbTopElement.className = "ScrollbarThumbTop";\r
+    this.thumbMiddleElement = document.createElement("div");\r
+    this.thumbMiddleElement.className = "ScrollbarThumbMiddle";\r
+    this.thumbBottomElement = document.createElement("div");\r
+    this.thumbBottomElement.className = "ScrollbarThumbBottom";\r
+    \r
+    // assemble and attach the scrollbar\r
+    this.rootElement.appendChild(this.trackTopElement);\r
+    this.rootElement.appendChild(this.trackMiddleElement);\r
+    this.rootElement.appendChild(this.trackBottomElement);\r
+    this.rootElement.appendChild(this.thumbTopElement);\r
+    this.rootElement.appendChild(this.thumbMiddleElement);\r
+    this.rootElement.appendChild(this.thumbBottomElement);\r
+    this.parentElement.appendChild(this.rootElement);\r
+    \r
+    // bring the scrollbar up to date\r
+    this.update(0, 100, 100);\r
+}\r
+\r
+// Parent element for the scrollbar.\r
+Scrollbar.prototype.parentElement = null;\r
+\r
+// Root HTML element in the scrollbar.\r
+Scrollbar.prototype.rootElement = null;\r
+\r
+// Scrollbar track top element.\r
+Scrollbar.prototype.trackTopElement = null;\r
+\r
+// Scrollbar track middle element.\r
+Scrollbar.prototype.trackMiddleElement = null;\r
+\r
+// Scrollbar track bottom element.\r
+Scrollbar.prototype.trackBottomElement = null;\r
+\r
+// Scrollbar thumb top element.\r
+Scrollbar.prototype.thumbTopElement = null;\r
+\r
+// Scrollbar thumb middle element.\r
+Scrollbar.prototype.thumbMiddleElement = null;\r
+\r
+// Scrollbar thumb bottom element.\r
+Scrollbar.prototype.thumbBottomElement = null;\r
+\r
+// Is the scrollbar needed?\r
+Scrollbar.prototype.scrollbarNeeded = false;\r
+\r
+// Updates the scrollbar.\r
+Scrollbar.prototype.update = function(scrollY, viewportHeight, documentHeight) {\r
+    // figure out current heights\r
+    var scrollbarHeight = this.rootElement.clientHeight;\r
+    var trackTopHeight = this.trackTopElement.clientHeight;\r
+    var trackBottomHeight = this.trackBottomElement.clientHeight;\r
+    var thumbTopHeight = this.thumbTopElement.clientHeight;\r
+    var thumbBottomHeight = this.thumbBottomElement.clientHeight;\r
+    \r
+    // scrollable height is the larger of document and viewport heights\r
+    var scrollableHeight = documentHeight;\r
+    var scrollbarNeeded = true;\r
+    if (viewportHeight >= documentHeight) {\r
+        scrollableHeight = viewportHeight;\r
+        scrollbarNeeded = false;\r
+    }\r
+    \r
+    // show or hide scrollbar?\r
+    if (scrollbarNeeded != this.scrollbarNeeded) {\r
+        this.scrollbarNeeded = scrollbarNeeded;\r
+        this.rootElement.style.visibility = scrollbarNeeded ? "visible" : "hidden";\r
+    }\r
+    \r
+    // calculate thumb top position...\r
+    var thumbTopPct = scrollY / scrollableHeight;\r
+    var thumbTop = scrollbarHeight * thumbTopPct;\r
+    // ...and bottom position...\r
+    var thumbBottomPct = (scrollY + viewportHeight) / scrollableHeight;\r
+    var thumbBottom = scrollbarHeight * thumbBottomPct;\r
+    \r
+    // ...and thumb height\r
+    var thumbHeight = thumbBottom - thumbTop;\r
+    \r
+    // ensure that the thumb is not too small\r
+    var thumbMinHeight = thumbTopHeight + thumbBottomHeight;\r
+    if (thumbHeight < thumbMinHeight) {\r
+        var underflow = thumbMinHeight - thumbHeight;\r
+        // adjust thumb top pos assuming a shorter scrollbar track\r
+        var thumbMid = (scrollbarHeight - underflow) * ((thumbTopPct + thumbBottomPct) / 2) + (underflow / 2);\r
+        thumbTop = thumbMid - (thumbMinHeight / 2);\r
+        thumbBottom = thumbTop + thumbMinHeight;\r
+        thumbHeight = thumbBottom - thumbTop;\r
+    }\r
+    \r
+    // position and size track element (add 1 to the middle section height for rounding errors)\r
+    this.trackTopElement.style.top = "0px";\r
+    this.trackMiddleElement.style.top = Math.round(trackTopHeight) + "px";\r
+    this.trackMiddleElement.style.height = Math.round(scrollbarHeight - trackTopHeight - trackBottomHeight + 1) + "px";\r
+    this.trackBottomElement.style.top = Math.round(scrollbarHeight - trackTopHeight) + "px";\r
+    \r
+    // position and size thumb element (add 1 to the middle section height for rounding errors)\r
+    this.thumbTopElement.style.top = Math.round(thumbTop) + "px";\r
+    this.thumbMiddleElement.style.top = Math.round(thumbTop + thumbTopHeight) + "px";\r
+    this.thumbMiddleElement.style.height = Math.round(thumbHeight - thumbTopHeight - thumbBottomHeight + 1) + "px";\r
+    this.thumbBottomElement.style.top = Math.round(thumbBottom - thumbBottomHeight) + "px";\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/SelectionControl.js b/wrt/zouba/WRTKit/UI/SelectionControl.js
new file mode 100644 (file)
index 0000000..de363c9
--- /dev/null
@@ -0,0 +1,189 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The SelectionControl class is an abstract base class for controls that lets\r
+// the user select one or more options from a list of options. Don't use\r
+// SelectionControl directly.\r
+\r
+// Constructor.\r
+function SelectionControl(id, caption, options, multipleSelection, selected) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, options, multipleSelection, selected);\r
+    }\r
+}\r
+\r
+// SelectionControl inherits from Control.\r
+SelectionControl.prototype = new Control(UI_NO_INIT_ID);\r
+\r
+// List of options.\r
+SelectionControl.prototype.options = null;\r
+\r
+// The single selected option in single selection controls\r
+// or list of options in multi selection controls.\r
+SelectionControl.prototype.selected = null;\r
+\r
+// Single or multiple selection.\r
+SelectionControl.prototype.multipleSelection = false;\r
+\r
+// Initializer - called from constructor.\r
+SelectionControl.prototype.init = function(id, caption, options, multipleSelection, selected) {\r
+    uiLogger.debug("SelectionControl.init(" + id + ", " + caption + ", " + options + ", " + multipleSelection + ", " + selected + ")");\r
+    \r
+    // call superclass initializer\r
+    Control.prototype.init.call(this, id, caption);\r
+    \r
+    // set the multiple selection property\r
+    this.multipleSelection = multipleSelection;\r
+    \r
+    // init options and selected (makes copies of the original arrays)\r
+    this.options = (options != null) ? options.slice(0) : [];\r
+    if (multipleSelection) {\r
+        this.selected = (selected == null) ? [] : selected.slice(0);\r
+    } else {\r
+        this.selected = selected;\r
+    }\r
+    this.validateSelected();\r
+}\r
+\r
+// Returns true if the control is a multiple selection control; false if single.\r
+SelectionControl.prototype.isMultipleSelection = function() {\r
+    return this.multipleSelection;\r
+}\r
+\r
+// Returns true if the specified option is selected; false if not.\r
+SelectionControl.prototype.isSelected = function(option) {\r
+    if (this.multipleSelection) {\r
+        // multiple selection\r
+        // iterate through all selected options and look for the specified option\r
+        for (var i = 0; i < this.selected.length; i++) {\r
+            if (this.selected[i] == option) {\r
+                return true;\r
+            }\r
+        }\r
+        return false;\r
+    } else {\r
+        // single selection\r
+        return (this.selected == option);\r
+    }\r
+}\r
+\r
+// Returns the currently selected option in a single selection control or\r
+// an array of selected options in a multiple selection control. If there are\r
+// no selected options a single selection control returns null and a multiple\r
+// selection control returns an empty array.\r
+SelectionControl.prototype.getSelected = function() {\r
+    return this.multipleSelection ? this.selected.slice(0) : this.selected;\r
+}\r
+\r
+// Sets the currently selected options. Pass a single option in a single selection\r
+// control or an array of selected controls in a multiple selection control. To\r
+// deselect all options pass null in a single selection control and an empty array\r
+// in a multiple selection control.\r
+// Override in sublcasses to provide full implementation.\r
+SelectionControl.prototype.setSelected = function(selected) {\r
+    this.selected = this.multipleSelection ? selected.slice(0) : selected;\r
+    // make sure the selected option or options are legal\r
+    this.validateSelected();\r
+}\r
+\r
+// Ensures that the selected option or options exist among the options in this control.\r
+SelectionControl.prototype.validateSelected = function() {\r
+    if (this.multipleSelection) {\r
+        // multiple selection\r
+        // iterate through all selected options and ensure they exist among the options\r
+        for (var i = 0; i < this.selected.length; i++) {\r
+            // check that the selected option exists among the options\r
+            var found = false;\r
+            for (var j = 0; j < this.options.length; j++) {\r
+                if (this.options[j] == this.selected[i]) {\r
+                    // found - stop looking for this option\r
+                    found = true;\r
+                    break;\r
+                }\r
+            }\r
+            // not found - remove this selected element\r
+            if (!found) {\r
+                this.selected.splice(i, 1);\r
+                // since we removed an entry we must re-check this position\r
+                i--;\r
+            }\r
+        }\r
+    } else {\r
+        // single selection\r
+        if (this.selected != null) {\r
+            // check that the selected option exists among the options\r
+            for (var i = 0; i < this.options.length; i++) {\r
+                if (this.options[i] == this.selected) {\r
+                    // found - we're done\r
+                    return;\r
+                }\r
+            }\r
+            // not found - remove the selection\r
+            this.selected = null;\r
+        }\r
+    }\r
+}\r
+\r
+// Returns the options in the control as an array of option objects with\r
+// a value and text property.\r
+SelectionControl.prototype.getOptions = function() {\r
+    return this.options;\r
+}\r
+\r
+// Sets the options in the control.\r
+// Override in sublcasses to provide full implementation.\r
+SelectionControl.prototype.setOptions = function(options) {\r
+    this.options = options.slice(0);\r
+    // make sure the selected option or options are legal\r
+    this.validateSelected();\r
+}\r
+\r
+// Returns the option that has the specified value; null if none.\r
+SelectionControl.prototype.getOptionForValue = function(value) {\r
+    // iterate through all options and look for a match\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        if (this.options[i].value == value) {\r
+            return this.options[i];\r
+        }\r
+    }\r
+    return null;\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/SelectionList.js b/wrt/zouba/WRTKit/UI/SelectionList.js
new file mode 100644 (file)
index 0000000..bb28742
--- /dev/null
@@ -0,0 +1,355 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The SelectionList class implements a single or multi selection control\r
+// that lets users select one or more options from a list of options.\r
+\r
+// Constructor.\r
+function SelectionList(id, caption, options, multipleSelection, selected) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, options, multipleSelection, selected);\r
+    }\r
+}\r
+\r
+// SelectionList inherits from SelectionControl.\r
+SelectionList.prototype = new SelectionControl(UI_NO_INIT_ID);\r
+\r
+// Root element for options.\r
+SelectionList.prototype.optionListElement = null;\r
+\r
+// Array for tracking option elements.\r
+SelectionList.prototype.optionElements = null;\r
+\r
+// Tracking for currently focused option; null if none.\r
+SelectionList.prototype.focusedOption = null;\r
+\r
+// Enabled status.\r
+SelectionList.prototype.enabled = false;\r
+\r
+// Initializer - called from constructor.\r
+SelectionList.prototype.init = function(id, caption, options, multipleSelection, selected) {\r
+    uiLogger.debug("SelectionList.init(" + id + ", " + caption + ", " + options + ", " + multipleSelection + ", " + selected + ")");\r
+    \r
+    // call superclass initializer\r
+    SelectionControl.prototype.init.call(this, id, caption, options, multipleSelection, selected);\r
+    \r
+    // create option list element\r
+    this.optionListElement = document.createElement("div");\r
+    this.controlElement.appendChild(this.optionListElement);\r
+    \r
+    // the control defaults to enabled\r
+    this.enabled = true;\r
+    \r
+    // init option element arrays\r
+    this.optionElements = [];\r
+    \r
+    // update the option elements to match the options in this control\r
+    this.updateOptionElements();\r
+}\r
+\r
+// Returns the enabled state.\r
+SelectionList.prototype.isEnabled = function() {\r
+    return this.enabled;\r
+}\r
+\r
+// Sets the enabled state.\r
+SelectionList.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("SelectionList.setEnabled(" + enabled + ")");\r
+    // switch the state and update the the control\r
+    this.enabled = enabled;\r
+    this.updateOptionElements();\r
+}\r
+\r
+// Sets the focused state for the control.\r
+// Note: This may not always succeed.\r
+SelectionList.prototype.setFocused = function(focused) {\r
+    uiLogger.debug("SelectionList.setFocused(" + focused + ")");\r
+    if (this.enabled && this.optionElements.length > 0) {\r
+        if (focused) {\r
+            this.optionElements[0].link.focus();\r
+        } else {\r
+            this.optionElements[0].link.blur();\r
+        }\r
+    }\r
+}\r
+\r
+// Sets the currently selected options. Pass a single option in a single selection\r
+// control or an array of selected controls in a multiple selection control. To\r
+// deselect all options pass null in a single selection control and an empty array\r
+// in a multiple selection control.\r
+SelectionList.prototype.setSelected = function(selected) {\r
+    // call superclass setSelected()\r
+    SelectionControl.prototype.setSelected.call(this, selected);\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Sets the options in the control.\r
+SelectionList.prototype.setOptions = function(options) {\r
+    // call superclass setOptions()\r
+    SelectionControl.prototype.setOptions.call(this, options);\r
+    this.updateOptionElements();\r
+}\r
+\r
+// Updates the option elements for the control element.\r
+SelectionList.prototype.updateOptionElements = function() {\r
+    uiLogger.debug("SelectionControl.updateOptionElements()");\r
+    \r
+    // start by removing all current options from the option list element\r
+    while (this.optionListElement.firstChild != null) {\r
+        this.optionListElement.removeChild(this.optionListElement.firstChild);\r
+    }\r
+    \r
+    // iterate through the options and add (and possibly create) a\r
+    // properly configured option element for each option\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        // get the option and option element we're working on\r
+        var option = this.options[i];\r
+        \r
+        // option, link and text elements for this option\r
+        var optionElement;\r
+        var optionLinkElement;\r
+        var optionTextElement;\r
+        \r
+        // get the elements\r
+        if (i == this.optionElements.length) {\r
+            // we need to create a new option element...\r
+            optionElement = document.createElement("div");\r
+            \r
+            // ...and a new option link element...\r
+            optionLinkElement = document.createElement("a");\r
+            optionLinkElement.href = "JavaScript:void(0)";\r
+            \r
+            // ...and a new option text element\r
+            optionTextElement = document.createElement("span");\r
+            \r
+            // hook up event listeners to the element\r
+            var self = this;\r
+            optionLinkElement.addEventListener("focus", function(event) { self.optionFocusStateChanged(event, true); }, false);\r
+            optionLinkElement.addEventListener("blur", function(event) { self.optionFocusStateChanged(event, false); }, false);\r
+            optionElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);\r
+            optionElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);\r
+            optionElement.addEventListener("mousedown", function(event) {\r
+                                                               self.optionClicked(event)\r
+                                                               event.stopPropagation();\r
+                                                               event.preventDefault();\r
+                                                        }, true);\r
+            optionElement.addEventListener("keydown", function(event) {\r
+                                                            // center and enter trigger the action\r
+                                                            if (event.keyCode == 0 || event.keyCode == 13) {\r
+                                                                self.optionClicked(event)\r
+                                                                event.stopPropagation();\r
+                                                                event.preventDefault();\r
+                                                            }\r
+                                                      }, true);\r
+            \r
+            // add the elements to the option element array\r
+            this.optionElements.push({ option: optionElement, link: optionLinkElement, text: optionTextElement });\r
+        } else {\r
+            // we already have ready elements so we'll reuse them\r
+            optionElement = this.optionElements[i].option;\r
+            optionLinkElement = this.optionElements[i].link;\r
+            optionTextElement = this.optionElements[i].text;\r
+            \r
+            // remove the option link element from its current parent - if any\r
+            if (optionLinkElement.parentNode != null) {\r
+                optionLinkElement.parentNode.removeChild(optionLinkElement);\r
+            }\r
+            \r
+            // remove the option text element from its current parent - if any\r
+            if (optionTextElement.parentNode != null) {\r
+                optionTextElement.parentNode.removeChild(optionTextElement);\r
+            }\r
+        }\r
+        \r
+        // set the option text\r
+        optionTextElement.innerHTML = option.text;\r
+        \r
+        // hook up the option to the control\r
+        if (this.enabled) {\r
+            // add the option link element to the option element\r
+            optionElement.appendChild(optionLinkElement);\r
+            // add the text element to the option element\r
+            optionLinkElement.appendChild(optionTextElement);\r
+        } else {\r
+            // add the text element directly to the control element\r
+            optionElement.appendChild(optionTextElement);\r
+        }\r
+        // add the option element to the option list element\r
+        this.optionListElement.appendChild(optionElement);\r
+    }\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Callback for focus state change events.\r
+SelectionList.prototype.optionFocusStateChanged = function(event, focused) {\r
+    uiLogger.debug("SelectionControl.optionFocusStateChanged()");\r
+    \r
+    // get the event source option\r
+    var option = null;\r
+    var optionElement = null;\r
+    for (var i = 0; i < this.optionElements.length; i++) {\r
+        optionElement = this.optionElements[i];\r
+        if (optionElement.link == event.currentTarget) {\r
+            option = this.options[i];\r
+            break;\r
+        }\r
+    }\r
+    \r
+    // remember the focused option; or null if none is focused\r
+    if (focused) {\r
+        this.focusedOption = option;\r
+    } else {\r
+        this.focusedOption = null;\r
+    }\r
+    \r
+    // call the superclass focus state change handler\r
+    this.focusStateChanged(focused);\r
+}\r
+\r
+// Callback for clicks.\r
+SelectionList.prototype.optionClicked = function(event) {\r
+    uiLogger.debug("SelectionControl.optionClicked()");\r
+    \r
+    // bail out if we're not enabled\r
+    if (!this.enabled) {\r
+        return false;\r
+    }\r
+    \r
+    // get the changed option\r
+    var option = null;\r
+    var optionElement = null;\r
+    for (var i = 0; i < this.optionElements.length; i++) {\r
+        optionElement = this.optionElements[i];\r
+        if (optionElement.option == event.currentTarget) {\r
+            option = this.options[i];\r
+            break;\r
+        }\r
+    }\r
+    \r
+    // make sure the option is focused\r
+    optionElement.link.focus();\r
+    \r
+    // toggle the selection\r
+    if (this.multipleSelection) {\r
+        // iterate through the selected options and see if this\r
+        // option is selected. if not then add it to the selection.\r
+        // if it already is selected then them remove it.\r
+        var found = false;\r
+        for (var i = 0; i < this.selected.length; i++) {\r
+            if (this.selected[i] == option) {\r
+                // remove from selected set\r
+                found = true;\r
+                this.selected.splice(i, 1);\r
+                break;\r
+            }\r
+        }\r
+        if (!found) {\r
+            // add to the selected set\r
+            this.selected.push(option);\r
+        }\r
+    } else {\r
+        // update the selected option\r
+        this.selected = option;\r
+    }\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+    \r
+    // notify event listeners\r
+    this.fireEvent(this.createEvent("SelectionChanged", this.getSelected()));\r
+}\r
+\r
+// Resets the state tracking for focus and hover.\r
+// Override this in subclasses as required to implement the state reset.\r
+SelectionList.prototype.resetFocusState = function() {\r
+    uiLogger.debug("SelectionList.resetFocusState()");\r
+    this.hovering = false;\r
+    this.focused = false;\r
+    this.focusedOption = null;\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+SelectionList.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("SelectionList.updateStyleFromState()");\r
+    \r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set element class names\r
+    this.setClassName(this.rootElement, "Control");\r
+    this.setClassName(this.controlElement, "ControlElement");\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);\r
+    this.setClassName(this.captionElement, "ControlCaption ControlCaption" + stateName);\r
+    \r
+    // set option list and option class names\r
+    this.setClassName(this.optionListElement, "SelectionList SelectionList" + stateName);\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        var option = this.options[i];\r
+        \r
+        // get the option and option text elements for this option\r
+        var optionElement = this.optionElements[i].option;\r
+        var optionTextElement = this.optionElements[i].text;\r
+        \r
+        // figure out the option state\r
+        var optionStateName = this.isSelected(option) ? "Checked" : "Unchecked";\r
+        if (!this.enabled) {\r
+            optionStateName += "Disabled";\r
+        } else if (this.focusedOption == option) {\r
+            optionStateName += "Focus";\r
+        } else {\r
+            optionStateName += "Normal";\r
+        }\r
+        \r
+        // set option element class names\r
+        if (this.multipleSelection) {\r
+            this.setClassName(optionElement, "SelectionListOptionMulti SelectionListOptionMulti" + optionStateName);\r
+        } else {\r
+            this.setClassName(optionElement, "SelectionListOptionSingle SelectionListOptionSingle" + optionStateName);\r
+        }\r
+        \r
+        // set option text class names\r
+        this.setClassName(optionTextElement, "SelectionListOptionText SelectionListOptionText" + stateName);\r
+    }\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/SelectionMenu.js b/wrt/zouba/WRTKit/UI/SelectionMenu.js
new file mode 100644 (file)
index 0000000..ec63695
--- /dev/null
@@ -0,0 +1,204 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The SelectionMenu class implements a single or multi selection control\r
+// that lets users select one or more options from a menu.\r
+\r
+// Constructor.\r
+function SelectionMenu(id, caption, options, multipleSelection, selected) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, options, multipleSelection, selected);\r
+    }\r
+}\r
+\r
+// SelectionMenu inherits from SelectionControl.\r
+SelectionMenu.prototype = new SelectionControl(UI_NO_INIT_ID);\r
+\r
+// Reference to the peer HTML element.\r
+SelectionControl.prototype.peerElement = null;\r
+\r
+// Array for tracking option elements.\r
+SelectionMenu.prototype.optionElements = null;\r
+\r
+// Initializer - called from constructor.\r
+SelectionMenu.prototype.init = function(id, caption, options, multipleSelection, selected) {\r
+    uiLogger.debug("SelectionMenu.init(" + id + ", " + caption + ", " + options + ", " + multipleSelection + ", " + selected + ")");\r
+    \r
+    // call superclass initializer\r
+    SelectionControl.prototype.init.call(this, id, caption, options, multipleSelection, selected);\r
+    \r
+    // create the control\r
+    this.peerElement = document.createElement("select");\r
+    this.peerElement.multiple = multipleSelection;\r
+    this.controlElement.appendChild(this.peerElement);\r
+    \r
+    // init option elements array\r
+    this.optionElements = [];\r
+    \r
+    // update the option elements to match the options in this control\r
+    this.updateOptionElements();\r
+    \r
+    // bind event listeners\r
+    var self = this;\r
+    this.peerElement.addEventListener("focus", function() { self.focusStateChanged(true); }, false);\r
+    this.peerElement.addEventListener("blur", function() { self.focusStateChanged(false); }, false);\r
+    this.peerElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);\r
+    this.peerElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);\r
+    this.peerElement.addEventListener("change", function() { self.selectionChanged(); }, false);\r
+}\r
+\r
+// Returns the enabled state.\r
+SelectionMenu.prototype.isEnabled = function() {\r
+    return !this.peerElement.disabled;\r
+}\r
+\r
+// Sets the enabled state.\r
+SelectionMenu.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("SelectionMenu.setEnabled(" + enabled + ")");\r
+    this.peerElement.disabled = !enabled;\r
+}\r
+\r
+// Sets the focused state for the control.\r
+// Note: This may not always succeed.\r
+SelectionMenu.prototype.setFocused = function(focused) {\r
+    uiLogger.debug("SelectionMenu.setFocused(" + focused + ")");\r
+    if (focused) {\r
+        this.peerElement.focus();\r
+    } else {\r
+        this.peerElement.blur();\r
+    }\r
+}\r
+\r
+// Sets the currently selected options. Pass a single option in a single selection\r
+// control or an array of selected controls in a multiple selection control. To\r
+// deselect all options pass null in a single selection control and an empty array\r
+// in a multiple selection control.\r
+SelectionMenu.prototype.setSelected = function(selected) {\r
+    // call superclass setSelected()\r
+    SelectionControl.prototype.setSelected.call(this, selected);\r
+    \r
+    // iterate through the options and set the selected state\r
+    // on the corresponding option element\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        this.optionElements[i].selected = this.isSelected(this.options[i]);\r
+    }\r
+}\r
+\r
+// Sets the options in the control.\r
+SelectionMenu.prototype.setOptions = function(options) {\r
+    // call superclass setOptions()\r
+    SelectionControl.prototype.setOptions.call(this, options);\r
+    this.updateOptionElements();\r
+}\r
+\r
+// Updates the option elements for the peer select element.\r
+SelectionMenu.prototype.updateOptionElements = function() {\r
+    // start by removing all current options from the select element\r
+    while (this.peerElement.firstChild != null) {\r
+        this.peerElement.removeChild(this.peerElement.firstChild);\r
+    }\r
+    \r
+    // iterate through the options and add (and possibly create) a\r
+    // properly configured option element for each option\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        // do we need to create a new option element?\r
+        if (i == this.optionElements.length) {\r
+            this.optionElements.push(document.createElement("option"));\r
+        }\r
+        \r
+        // get the option and option element we're working on\r
+        var option = this.options[i];\r
+        var optionElement = this.optionElements[i];\r
+        \r
+        // set the state for this option element and add it to the\r
+        // peer select element\r
+        optionElement.text = option.text;\r
+        optionElement.selected = this.isSelected(option);\r
+        this.peerElement.appendChild(optionElement);\r
+    }\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();    \r
+}\r
+\r
+// Callback for selection change events.\r
+SelectionMenu.prototype.selectionChanged = function() {\r
+    uiLogger.debug("SelectionControl.selectionChanged()");\r
+    \r
+    // update the selected options array or reference\r
+    this.selected = (this.multipleSelection) ? [] : null;\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        if (this.optionElements[i].selected) {\r
+            if (this.multipleSelection) {\r
+                this.selected.push(this.options[i]);\r
+            } else {\r
+                this.selected = this.options[i];\r
+                break;\r
+            }\r
+        }\r
+    }\r
+    \r
+    // notify event listeners\r
+    this.fireEvent(this.createEvent("SelectionChanged", this.getSelected()));\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+SelectionMenu.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("SelectionMenu.updateStyleFromState()");\r
+    \r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set element class names\r
+    this.setClassName(this.rootElement, "Control");\r
+    this.setClassName(this.controlElement, "ControlElement");\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);\r
+    this.setClassName(this.captionElement, "ControlCaption ControlCaption" + stateName);\r
+    \r
+    // set select and option element class names\r
+    var peerStateName = this.isEnabled() ? stateName : "Disabled";\r
+    this.setClassName(this.peerElement, "SelectionMenu SelectionMenu" + peerStateName);\r
+    for (var i = 0; i < this.options.length; i++) {\r
+        var option = this.optionElements[i];\r
+        this.setClassName(option, "SelectionMenuOption SelectionMenuOption" + peerStateName);\r
+    }\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/Separator.js b/wrt/zouba/WRTKit/UI/Separator.js
new file mode 100644 (file)
index 0000000..050e350
--- /dev/null
@@ -0,0 +1,119 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The Separator class is used to provide a visual separator in a list.\r
+\r
+// Constructor.\r
+function Separator(id) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id);\r
+    }\r
+}\r
+\r
+// Separator inherits from Control.\r
+Separator.prototype = new Control(UI_NO_INIT_ID);\r
+\r
+// Reference to the separator element.\r
+Separator.prototype.separatorElement = null;\r
+\r
+// Separator row element.\r
+Separator.prototype.tableRowElement = null;\r
+\r
+// Left cell element.\r
+Separator.prototype.tableLeftCellElement = null;\r
+\r
+// Center cell element.\r
+Separator.prototype.tableCenterCellElement = null;\r
+\r
+// Right cell element.\r
+Separator.prototype.tableRightCellElement = null;\r
+\r
+// Initializer - called from constructor.\r
+Separator.prototype.init = function(id) {\r
+    uiLogger.debug("Separator.init(" + id + ")");\r
+    \r
+    // call superclass initializer\r
+    Control.prototype.init.call(this, id, null);\r
+    \r
+    // remove caption and control elements\r
+    this.assemblyElement.removeChild(this.captionElement);\r
+    this.assemblyElement.removeChild(this.controlElement);\r
+    \r
+    // create separator\r
+    this.separatorElement = document.createElement("table");\r
+    this.tableRowElement = document.createElement("tr");\r
+    this.tableLeftCellElement = document.createElement("td");\r
+    this.tableCenterCellElement = document.createElement("td");\r
+    this.tableRightCellElement = document.createElement("td");\r
+    this.tableRowElement.appendChild(this.tableLeftCellElement);\r
+    this.tableRowElement.appendChild(this.tableCenterCellElement);\r
+    this.tableRowElement.appendChild(this.tableRightCellElement);\r
+    this.separatorElement.appendChild(this.tableRowElement);\r
+    this.assemblyElement.appendChild(this.separatorElement);\r
+    \r
+    // update style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the enabled state for the control.\r
+Separator.prototype.isEnabled = function() {\r
+    return true;\r
+}\r
+\r
+// Returns the focusable state for the control.\r
+Separator.prototype.isFocusable = function() {\r
+    return false;\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+Separator.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("Separator.updateStyleFromState()");\r
+    \r
+    // set element class names\r
+    this.setClassName(this.rootElement, "Control");\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssemblyNormal");\r
+    this.setClassName(this.separatorElement, "Separator");\r
+    this.setClassName(this.tableRowElement, "SeparatorRow");\r
+    this.setClassName(this.tableLeftCellElement, "SeparatorLeftCell");\r
+    this.setClassName(this.tableCenterCellElement, "SeparatorCenterCell");\r
+    this.setClassName(this.tableRightCellElement, "SeparatorRightCell");\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/TextArea.js b/wrt/zouba/WRTKit/UI/TextArea.js
new file mode 100644 (file)
index 0000000..68bef8c
--- /dev/null
@@ -0,0 +1,96 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The TextArea class implements a multi line text entry control.\r
+\r
+// Constructor.\r
+function TextArea(id, caption, value, rows) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, value, rows);\r
+    }\r
+}\r
+\r
+// TextArea inherits from TextEntryControl.\r
+TextArea.prototype = new TextEntryControl(UI_NO_INIT_ID);\r
+\r
+// Initializer - called from constructor.\r
+TextArea.prototype.init = function(id, caption, value, rows) {\r
+    uiLogger.debug("TextArea.init(" + id + ", " + caption + ", " + value + ", " + rows + ")");\r
+    \r
+    // call superclass initializer\r
+    TextEntryControl.prototype.init.call(this, id, caption);\r
+    \r
+    // create the peer element\r
+    this.peerElement = document.createElement("textarea");\r
+    // default rowcount is 3 if not defined\r
+    // width always comes from style but is a required attribute\r
+    this.peerElement.rows = (rows != null) ? rows : 3;\r
+    this.peerElement.cols = 20;\r
+    this.controlElement.appendChild(this.peerElement);\r
+    \r
+    // set the value\r
+    this.peerElement.value = (value == null) ? "" : value;\r
+    \r
+    // bind event listeners\r
+    this.bindTextEntryControlListeners();\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+TextArea.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("TextArea.updateStyleFromState()");\r
+    \r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set element class names\r
+    this.setClassName(this.rootElement, "Control");\r
+    this.setClassName(this.controlElement, "ControlElement");\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);\r
+    this.setClassName(this.captionElement, "ControlCaption ControlCaption" + stateName);\r
+    \r
+    // set peer element class names\r
+    var peerStateName = this.isEnabled() ? stateName : "Disabled";\r
+    this.setClassName(this.peerElement, "TextArea TextArea" + stateName);\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/TextEntryControl.js b/wrt/zouba/WRTKit/UI/TextEntryControl.js
new file mode 100644 (file)
index 0000000..509fd26
--- /dev/null
@@ -0,0 +1,125 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The TextEntryControl class is an abstract base class for the single and multi-\r
+// line text entry controls TextField and TextArea. Don't use TextEntryControl\r
+// directly.\r
+\r
+// Constructor.\r
+function TextEntryControl(id, caption) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption);\r
+    }\r
+}\r
+\r
+// TextEntryControl inherits from Control.\r
+TextEntryControl.prototype = new Control(UI_NO_INIT_ID);\r
+\r
+// Reference to the peer HTML element.\r
+TextEntryControl.prototype.peerElement = null;\r
+\r
+// Initializer - called from constructor.\r
+TextEntryControl.prototype.init = function(id, caption) {\r
+    uiLogger.debug("TextEntryControl.init(" + id + ", " + caption + ")");\r
+    \r
+    // call superclass initializer\r
+    Control.prototype.init.call(this, id, caption);\r
+}\r
+\r
+// Common event listeners hookup function called from subclasses.\r
+TextEntryControl.prototype.bindTextEntryControlListeners = function() {\r
+    var self = this;\r
+    this.peerElement.addEventListener("focus", function() { self.focusStateChanged(true); }, false);\r
+    this.peerElement.addEventListener("blur", function() { self.focusStateChanged(false); }, false);\r
+    this.peerElement.addEventListener("mouseover", function() { self.hoverStateChanged(true); }, false);\r
+    this.peerElement.addEventListener("mouseout", function() { self.hoverStateChanged(false); }, false);\r
+    this.peerElement.addEventListener("change", function() { self.valueChanged(); }, false);\r
+}\r
+\r
+// Returns the enabled state.\r
+// Override this in subclasses as required to implement the state change.\r
+TextEntryControl.prototype.isEnabled = function() {\r
+    return !this.peerElement.readOnly;\r
+}\r
+\r
+// Sets the enabled state.\r
+// Override this in subclasses as required to implement the state change.\r
+TextEntryControl.prototype.setEnabled = function(enabled) {\r
+    uiLogger.debug("TextEntryControl.setEnabled(" + enabled + ")");\r
+    this.peerElement.readOnly = !enabled;\r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Returns the control text.\r
+TextEntryControl.prototype.getText = function() {\r
+    return this.peerElement.value;\r
+}\r
+\r
+// Sets the text for the control.\r
+TextEntryControl.prototype.setText = function(text) {\r
+    this.peerElement.value = text;\r
+}\r
+\r
+// Returns the focusable state for the control.\r
+TextEntryControl.prototype.isFocusable = function() {\r
+    // text entry controls are always focusable\r
+    return true;\r
+}\r
+\r
+// Sets the focused state for the control.\r
+// Note: This may not always succeed.\r
+TextEntryControl.prototype.setFocused = function(focused) {\r
+    uiLogger.debug("TextEntryControl.setFocused(" + focused + ")");\r
+    if (focused) {\r
+        this.peerElement.focus();\r
+    } else {\r
+        this.peerElement.blur();\r
+    }\r
+}\r
+\r
+// Callback for value change events.\r
+TextEntryControl.prototype.valueChanged = function() {\r
+    uiLogger.debug("TextEntryControl.valueChanged()");\r
+    // notify event listeners\r
+    this.fireEvent(this.createEvent("ValueChanged", this.peerElement.value));\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/TextField.js b/wrt/zouba/WRTKit/UI/TextField.js
new file mode 100644 (file)
index 0000000..56236f6
--- /dev/null
@@ -0,0 +1,93 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The TextField class implements a single line text entry control.\r
+\r
+// Constructor.\r
+function TextField(id, caption, value, masked) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id, caption, value, masked);\r
+    }\r
+}\r
+\r
+// TextField inherits from TextEntryControl.\r
+TextField.prototype = new TextEntryControl(UI_NO_INIT_ID);\r
+\r
+// Initializer - called from constructor.\r
+TextField.prototype.init = function(id, caption, value, masked) {\r
+    uiLogger.debug("TextField.init(" + id + ", " + caption + ", " + value + ", " + masked + ")");\r
+    \r
+    // call superclass initializer\r
+    TextEntryControl.prototype.init.call(this, id, caption);\r
+    \r
+    // create the peer element\r
+    this.peerElement = document.createElement("input");\r
+    this.peerElement.type = masked ? "password" : "text";\r
+    this.controlElement.appendChild(this.peerElement);\r
+    \r
+    // set the value\r
+    this.peerElement.value = (value == null) ? "" : value;\r
+    \r
+    // bind event listeners\r
+    this.bindTextEntryControlListeners();\r
+    \r
+    // update the style\r
+    this.updateStyleFromState();\r
+}\r
+\r
+// Updates the style of the control to reflects the state of the control.\r
+TextField.prototype.updateStyleFromState = function() {\r
+    uiLogger.debug("TextField.updateStyleFromState()");\r
+    \r
+    // determine the state name\r
+    var stateName = this.getStyleStateName();\r
+    \r
+    // set element class names\r
+    this.setClassName(this.rootElement, "Control");\r
+    this.setClassName(this.controlElement, "ControlElement");\r
+    this.setClassName(this.assemblyElement, "ControlAssembly ControlAssembly" + stateName);\r
+    this.setClassName(this.captionElement, "ControlCaption ControlCaption" + stateName);\r
+    \r
+    // set peer element class names\r
+    var peerStateName = this.isEnabled() ? stateName : "Disabled";\r
+    this.setClassName(this.peerElement, "TextField TextField" + peerStateName);\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/UIElement.js b/wrt/zouba/WRTKit/UI/UIElement.js
new file mode 100644 (file)
index 0000000..576794a
--- /dev/null
@@ -0,0 +1,114 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The UIElement class is the base class for all user interface elements.\r
+\r
+// Constructor.\r
+function UIElement(id) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id);\r
+    }\r
+}\r
+\r
+// UI element identifier.\r
+UIElement.prototype.id = null;\r
+\r
+// Root HTML element in the UI element.\r
+UIElement.prototype.rootElement = null;\r
+\r
+// Initializer for UIElement.\r
+UIElement.prototype.init = function(id) {\r
+    uiLogger.debug("UIElement.init(" + id + ")");\r
+    \r
+    // copy identifier\r
+    this.id = id;\r
+    \r
+    // init event listener array\r
+    this.eventListeners = [];\r
+    \r
+    // create the root element\r
+    this.rootElement = document.createElement("div");\r
+    if (id != null) {\r
+        this.rootElement.id = id;\r
+    }\r
+}\r
+\r
+// Returns an array containing the current event listeners.\r
+UIElement.prototype.getEventListeners = function() {\r
+    return this.eventListeners;\r
+}\r
+\r
+// Adds an event listener.\r
+UIElement.prototype.addEventListener = function(eventType, listener) {\r
+    var listenerDef = { type: eventType, listener: listener };\r
+    this.eventListeners.push(listenerDef);\r
+}\r
+\r
+// Removes an event listener.\r
+UIElement.prototype.removeEventListener = function(eventType, listener) {\r
+    // iterate through current listeners and remove the specified\r
+    // listener when its found\r
+    for (var i = 0; i < this.eventListeners.length; i++) {\r
+        var listenerDef = this.eventListeners[i];\r
+        if ((listenerDef.type == eventType) &&\r
+                (listenerDef.listener == listener)) {\r
+            this.eventListeners.splice(i, 1);\r
+            return;\r
+        }\r
+    }\r
+}\r
+\r
+// Factory method for an event object where this object is the source object.\r
+UIElement.prototype.createEvent = function(type, value) {\r
+    return { source: this, type: type, value: value };\r
+}\r
+\r
+// Fires an event to all listeners.\r
+UIElement.prototype.fireEvent = function(event) {\r
+    // iterate through all event listeners and notify them of the event\r
+    for (var i = 0; i < this.eventListeners.length; i++) {\r
+        var listenerDef = this.eventListeners[i];\r
+        if (listenerDef.type == null || listenerDef.type == event.type) {\r
+            listenerDef.listener.call(this, event);\r
+        }\r
+    }\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/UIInit.js b/wrt/zouba/WRTKit/UI/UIInit.js
new file mode 100644 (file)
index 0000000..4097edb
--- /dev/null
@@ -0,0 +1,49 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The UIInit script is included before the rest of the UI scripts to setup\r
+// any resources needed by the UI toolkit.\r
+\r
+// Create UI logger.\r
+var uiLogger = new Logger();\r
+uiLogger.level = uiLogger.LOG_LEVEL_OFF;\r
+uiLogger.filter = ["QECR"];\r
diff --git a/wrt/zouba/WRTKit/UI/UIManager.js b/wrt/zouba/WRTKit/UI/UIManager.js
new file mode 100644 (file)
index 0000000..4cfcc20
--- /dev/null
@@ -0,0 +1,240 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The UI manager manages a set of views and other user interface elements.\r
+\r
+// Constructor.\r
+function UIManager(viewParentElement, scrollbarParentElement, enableScrollBar, delayInit) {    \r
+    uiLogger.debug("UIManager(" + viewParentElement + ", " + scrollbarParentElement + ")");\r
+    if (delayInit == null) {\r
+        this.init(viewParentElement, enableScrollBar, scrollbarParentElement);\r
+    }\r
+}\r
+\r
+// Parent element for views.\r
+UIManager.prototype.viewParentElement = null;\r
+\r
+// Parent element for scrollbar.\r
+UIManager.prototype.scrollbarParentElement = null;\r
+\r
+// The currently displayed view.\r
+UIManager.prototype.currentView = null;\r
+\r
+// Reference to the scrollbar.\r
+UIManager.prototype.scrollbar = null;\r
+\r
+// Current scroll Y position.\r
+UIManager.prototype.scrollY = -1;\r
+\r
+// Current viewport height.\r
+UIManager.prototype.viewportHeight = -1;\r
+\r
+// Current document height.\r
+UIManager.prototype.documentHeight = -1;\r
+\r
+// Timer identifier or null if no active timer.\r
+UIManager.prototype.timerId = null;\r
+\r
+// Interval for timer ticks for the UI manager timer (in milliseconds)\r
+UIManager.prototype.TIMER_INTERVAL = 250;\r
+\r
+// Reference to the notification popup used to displays notifications.\r
+UIManager.prototype.notificationPopup = null;\r
+\r
+// is scrollbar enabled\r
+UIManager.prototype.enableScrollBar = null;\r
+\r
+// init function\r
+UIManager.prototype.init = function(viewParentElement, enableScrollBar, scrollbarParentElement) {\r
+    this.enableScrollBar = enableScrollBar;\r
+    \r
+    // parent element for views\r
+    if (viewParentElement == null) {\r
+        // create a parent for views\r
+        this.viewParentElement = document.createElement("div");\r
+        this.viewParentElement.className = "ViewContainer";\r
+        document.body.appendChild(this.viewParentElement);\r
+    }\r
+    else {\r
+        this.viewParentElement = viewParentElement;\r
+    }\r
+    \r
+    // parent element for scrollbar\r
+    if (enableScrollBar) {\r
+        if (scrollbarParentElement == null) {\r
+            // create a parent for the scrollbar\r
+            this.scrollbarParentElement = document.createElement("div");\r
+            this.scrollbarParentElement.className = "DocumentScrollbarContainer";\r
+            document.body.appendChild(this.scrollbarParentElement);\r
+        }\r
+        else {\r
+            this.scrollbarParentElement = scrollbarParentElement;\r
+        }\r
+    }\r
+    \r
+    // currently selected view\r
+    this.currentView = null;\r
+    \r
+    // create the notification popup\r
+    // the notification popup adds itself as a child element to the document body\r
+    this.notificationPopup = new NotificationPopup();\r
+    \r
+    // create scrollbar\r
+    if (enableScrollBar) {\r
+        this.scrollbar = new Scrollbar(this.scrollbarParentElement);\r
+    }\r
+    \r
+    // setup scrollbar tracking\r
+    var self = this;\r
+    this.startTimer();\r
+    if (enableScrollBar) {\r
+        window.addEventListener("resize", function(){\r
+            self.updateScrollbar();\r
+        }, false);\r
+        window.addEventListener("scroll", function(){\r
+            self.updateScrollbar();\r
+        }, false);\r
+    }\r
+}\r
+\r
+// Returns the current view.\r
+UIManager.prototype.getView = function() {\r
+    return this.currentView;\r
+}\r
+\r
+// Switches to the specified view.\r
+UIManager.prototype.setView = function(view) {\r
+    uiLogger.debug("View set to " + view.id);\r
+    \r
+    // remove the current view from the parent element\r
+    if (this.currentView != null) {\r
+        this.viewParentElement.removeChild(this.currentView.rootElement);\r
+    }\r
+    \r
+    // reset scroll\r
+    window.scrollTo(0, 0);\r
+    \r
+    // add the new view to the parent element\r
+    if (view != null) {\r
+        this.currentView = view;\r
+        this.currentView.resetControlFocusStates();\r
+        this.viewParentElement.appendChild(this.currentView.rootElement);\r
+    }\r
+    \r
+    // update scrollbar\r
+    if (this.enableScrollBar) {\r
+        this.updateScrollbar();\r
+    }\r
+    \r
+    // focus the first focusable control\r
+    // a timer is used to prevent unwanted focus shift\r
+    setTimeout(function() { view.focusFirstControl(); }, 1);\r
+}\r
+\r
+// Updates the scrollbar.\r
+UIManager.prototype.updateScrollbar = function() {\r
+    if (this.enableScrollBar) {\r
+        // get current viewport and document position and dimensions\r
+        var scrollY = window.scrollY;\r
+        var viewportHeight = window.innerHeight;\r
+        var documentHeight = Math.max(document.documentElement.scrollHeight, document.height);\r
+        \r
+        // check if the scroll position or view has changed\r
+        if (this.scrollY != scrollY ||\r
+                this.viewportHeight != viewportHeight ||\r
+                this.documentHeight != documentHeight) {\r
+            // scroll position or view has changed\r
+            this.scrollY = scrollY;\r
+            this.viewportHeight = viewportHeight;\r
+            this.documentHeight = documentHeight;\r
+            \r
+            // update the scrollbar\r
+            this.scrollbar.update(scrollY, viewportHeight, documentHeight);\r
+            uiLogger.debug("Scrollbar updated");\r
+        }\r
+    }\r
+}\r
+\r
+// Starts the view manager timer.\r
+UIManager.prototype.startTimer = function() {\r
+    if (this.timerId == null) {\r
+        uiLogger.debug("UIManager timer started");\r
+        var self = this;\r
+        // setup the timer\r
+        this.timerId = setInterval(function() { self.onTimer(); }, this.TIMER_INTERVAL);\r
+    } else {\r
+        uiLogger.warn("UIManager timer already running");\r
+    }\r
+}\r
+\r
+// Stops the view manager timer.\r
+UIManager.prototype.stopTimer = function() {\r
+    if (this.timerId != null) {\r
+        // stop the timer\r
+        clearTimeout(this.timerId);\r
+        this.timerId = null;\r
+    } else {\r
+        uiLogger.warn("UIManager timer already stopped");\r
+    }\r
+}\r
+\r
+// Timer callback function.\r
+UIManager.prototype.onTimer = function() {\r
+    if (this.enableScrollBar) {\r
+        // make sure the scrollbar is up to date\r
+        this.updateScrollbar();\r
+    }\r
+}\r
+\r
+// Displays a notification.\r
+UIManager.prototype.showNotification = function(displayTime, type, text, progress) {\r
+    uiLogger.debug("UIManager.showNotification(" + displayTime + ", " + type + ", " + text + ", " + progress + ")");\r
+    // use the notification popup to show the notification\r
+    this.notificationPopup.showNotification(displayTime, type, text, progress);\r
+}\r
+\r
+// Hides the currently displayed notification.\r
+UIManager.prototype.hideNotification = function() {\r
+    uiLogger.debug("UIManager.hideNotification()");\r
+    // hide the notification popup\r
+    this.notificationPopup.hideNotification();\r
+}\r
diff --git a/wrt/zouba/WRTKit/UI/View.js b/wrt/zouba/WRTKit/UI/View.js
new file mode 100644 (file)
index 0000000..5821c01
--- /dev/null
@@ -0,0 +1,90 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// The View class is an abstract base class for views in the UI toolkit.\r
+// Don't use the View directly - instead use a concrete subclass like ListView.\r
+\r
+// Constructor.\r
+function View(id) {\r
+    if (id != UI_NO_INIT_ID) {\r
+        this.init(id);\r
+    }\r
+}\r
+\r
+// View inherits from UIElement.\r
+View.prototype = new UIElement(UI_NO_INIT_ID);\r
+\r
+// Currently focused control.\r
+View.prototype.focusedControl = null;\r
+\r
+// Initializer - called from constructor.\r
+View.prototype.init = function(id) {\r
+    uiLogger.debug("View.init(" + id + ")");\r
+    \r
+    // call superclass initializer\r
+    UIElement.prototype.init.call(this, id);\r
+}\r
+\r
+// Returns the currently focused control; null if none.\r
+View.prototype.getFocusedControl = function() {\r
+    return this.focusedControl;\r
+}\r
+\r
+// Used to notify the view that the focused control has changed.\r
+View.prototype.focusedControlChanged = function(control) {\r
+    uiLogger.debug("View.focusedControlChanged(" + control + ")");\r
+    this.focusedControl = control;\r
+    // notify event listeners\r
+    this.fireEvent(this.createEvent("FocusedControlChanged", this.focusedControl));\r
+}\r
+\r
+// Attempts to focus the first focusable control.\r
+// Override in subclasses as required.\r
+View.prototype.focusFirstControl = function() {\r
+    uiLogger.debug("View.focusFirstControl()");\r
+}\r
+\r
+// Attempts to reset all control focus states.\r
+// Override in subclasses as required.\r
+View.prototype.resetControlFocusStates = function() {\r
+    uiLogger.debug("View.resetControlFocusStates()");\r
+}\r
diff --git a/wrt/zouba/WRTKit/Utils/Logger.js b/wrt/zouba/WRTKit/Utils/Logger.js
new file mode 100644 (file)
index 0000000..efbdfdc
--- /dev/null
@@ -0,0 +1,117 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// Logger utility class that uses the Firebug console class.\r
+\r
+// Constructor (everything is static so this is empty).\r
+function Logger() {\r
+    // Set default logger level.\r
+    this.level = this.LOG_LEVEL_OFF;\r
+}\r
+\r
+// Logger levels.\r
+Logger.prototype.LOG_LEVEL_DEBUG = 0;\r
+Logger.prototype.LOG_LEVEL_INFO = 1;\r
+Logger.prototype.LOG_LEVEL_WARN = 2;\r
+Logger.prototype.LOG_LEVEL_ERROR = 3;\r
+Logger.prototype.LOG_LEVEL_OFF = 4;\r
+\r
+Logger.prototype.level = null;\r
+Logger.prototype.filter = null;\r
+\r
+// Disable logging on other browsers except Firefox.\r
+Logger.prototype.enabled = (navigator.userAgent.indexOf("Firefox") != -1);\r
+\r
+// Dumps an objects properties and methods to the console.\r
+Logger.prototype.dump = function(obj) {\r
+    if (this.enabled) {\r
+        console.dir(obj);\r
+    }\r
+}\r
+\r
+// Dumps a stracktrace to the console.\r
+Logger.prototype.trace = function() {\r
+    if (this.enabled) {\r
+        console.trace();\r
+    }\r
+}\r
+\r
+// Prints a debug message to the console.\r
+Logger.prototype.debug = function(str) {\r
+    if (this.enabled && this.level <= this.LOG_LEVEL_DEBUG) {\r
+        if (this.filter == null) {\r
+            console.debug(str);\r
+        } else {\r
+            var show = false;\r
+            for (i in this.filter) {\r
+                if (str.indexOf(this.filter[i]) >= 0) {\r
+                    show = true;\r
+                    break;\r
+                }\r
+            }\r
+            if (show) {\r
+                console.debug(str);\r
+            }\r
+        }\r
+    }\r
+}\r
+\r
+// Prints an info message to the console.\r
+Logger.prototype.info = function(str) {\r
+    if (this.enabled && this.level <= this.LOG_LEVEL_INFO) {\r
+        console.info(str);\r
+    }\r
+}\r
+\r
+// Prints a warning message to the console.\r
+Logger.prototype.warn = function(str) {\r
+    if (this.enabled && this.level <= this.LOG_LEVEL_WARN) {\r
+        console.warn(str);\r
+    }\r
+}\r
+\r
+// Prints an error message to the console.\r
+Logger.prototype.error = function(str) {\r
+    if (this.enabled && this.level <= this.LOG_LEVEL_ERROR) {\r
+        console.error(str);\r
+    }\r
+}\r
diff --git a/wrt/zouba/WRTKit/WRTKit.js b/wrt/zouba/WRTKit/WRTKit.js
new file mode 100644 (file)
index 0000000..23093a8
--- /dev/null
@@ -0,0 +1,90 @@
+/*\r
+� Copyright 2008 Nokia Corporation. All rights reserved.\r
+\r
+IMPORTANT:  The Nokia software ("WRTKit and Example Widget files") is supplied to you by Nokia\r
+Corporation (�Nokia�) in consideration of your agreement to the following terms. Your use, installation\r
+and/or redistribution of the WRTKit and Example Widget files constitutes acceptance of these terms. If\r
+you do not agree with these terms, please do not use, install, or redistribute the WRTKit and Example\r
+Widget files.\r
+\r
+In consideration of your agreement to abide by the following terms, and subject to these terms, Nokia\r
+grants you a personal, non-exclusive license, under Nokia�s copyrights in the WRTKit and Example\r
+Widget files, to use, reproduce, and redistribute the WRTKit and Example files, in text form (for HTML,\r
+CSS, or JavaScript files) or binary form (for associated images), for the sole purpose of creating S60\r
+Widgets.\r
+\r
+If you redistribute the WRTKit and Example files, you must retain this entire notice in all such\r
+redistributions of the WRTKit and Example files.\r
+\r
+You may not use the name, trademarks, service marks or logos of Nokia to endorse or promote products\r
+that include the WRTKit and Example files without the prior written explicit agreement with Nokia.\r
+Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by\r
+Nokia herein, including but not limited to any patent rights that may be infringed by your products that\r
+incorporate the WRTKit and Example files or by other works in which the WRTKit and Example files\r
+may be incorporated.\r
+\r
+The WRTKit and Example files are provided on an "AS IS" basis.  NOKIA MAKES NO\r
+WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED\r
+WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A\r
+PARTICULAR PURPOSE, REGARDING THE EXAMPLES OR ITS USE AND OPERATION\r
+ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL NOKIA BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, AND/OR\r
+DISTRIBUTION OF THE EXAMPLES, HOWEVER CAUSED AND WHETHER UNDER THEORY\r
+OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE,\r
+EVEN IF NOKIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+*/\r
+\r
+///////////////////////////////////////////////////////////////////////////////\r
+// This script includes the WRTKit for use in a widget.\r
+\r
+// WRTKit version (major.minor.revision, e.g. 1.0.0).\r
+var WRTKIT_VERSION_MAJOR = 1;\r
+var WRTKIT_VERSION_MINOR = 0;\r
+var WRTKIT_VERSION_REVISION = 0;\r
+var WRTKIT_RESOURCE_DIRECTORY = "WRTKit/Resources/";\r
+\r
+// Include util script files.\r
+includeScript("WRTKit/Utils/Logger.js");\r
+\r
+// Include UI visual definition.\r
+includeStyleSheet("WRTKit/Resources/UI.css");\r
+\r
+// Include all UI toolkit script files.\r
+var UI_NO_INIT_ID = "UI_NO_INIT_ID";\r
+\r
+includeScript("WRTKit/UI/UIInit.js");\r
+includeScript("WRTKit/UI/UIElement.js");\r
+includeScript("WRTKit/UI/Scrollbar.js");\r
+includeScript("WRTKit/UI/NotificationPopup.js");\r
+includeScript("WRTKit/UI/UIManager.js");\r
+includeScript("WRTKit/UI/View.js");\r
+includeScript("WRTKit/UI/ListView.js");\r
+includeScript("WRTKit/UI/Control.js");\r
+includeScript("WRTKit/UI/Separator.js");\r
+includeScript("WRTKit/UI/Label.js");\r
+includeScript("WRTKit/UI/ContentPanel.js");\r
+includeScript("WRTKit/UI/TextEntryControl.js");\r
+includeScript("WRTKit/UI/TextField.js");\r
+includeScript("WRTKit/UI/TextArea.js");\r
+includeScript("WRTKit/UI/SelectionControl.js");\r
+includeScript("WRTKit/UI/SelectionMenu.js");\r
+includeScript("WRTKit/UI/SelectionList.js");\r
+includeScript("WRTKit/UI/ActionControl.js");\r
+includeScript("WRTKit/UI/FormButton.js");\r
+includeScript("WRTKit/UI/NavigationButton.js");\r
+includeScript("WRTKit/UI/Ajax.js");\r
+\r
+// Includes a script file by writing a script tag.\r
+function includeScript(src) {\r
+    document.write("<script type=\"text/javascript\" src=\"" + src + "\"></script>");\r
+}\r
+\r
+// Includes a style sheet by writing a style tag.\r
+function includeStyleSheet(src) {\r
+    document.write("<style type=\"text/css\"> @import url(\"" +  src + "\"); </style>");\r
+}\r
diff --git a/wrt/zouba/basic.css b/wrt/zouba/basic.css
new file mode 100644 (file)
index 0000000..1a477af
--- /dev/null
@@ -0,0 +1,11 @@
+/*\r
+ * Add your Stylesheet contents here\r
+ */\r
+body {\r
+  font-size:36pt;\r
+}\r
+\r
+button {\r
+  font-size:36pt;\r
+}\r
+\r
diff --git a/wrt/zouba/basic.js b/wrt/zouba/basic.js
new file mode 100644 (file)
index 0000000..a588dd4
--- /dev/null
@@ -0,0 +1,233 @@
+///////////////////////////////////////////////////////////////////////////////
+// The FeedUpdateBroker class implements a simple RSS fetcher and parser.
+
+var username = "zouba";
+var password = "caf9r3ee";
+
+var homeKey = "taivaanvuohentie%207%2Chelsinki";
+var workKey = "it%E4merenkatu%2011%2Chelsinki";
+
+var work = {
+    x: 2551042,
+    y: 6672829
+};
+var home = {
+    x: 2549183,
+    y: 6672570
+};
+
+var keyA = work;
+var keyB = home;
+
+// Feed update broker.
+var feedUpdateBroker = null;
+
+// Constructor.
+function FeedUpdateBroker()
+{
+    this.httpReq = null;
+    this.callback = null;
+}
+
+// Fetches a feed from the specified URL and calls the callback when the feed
+// has been fetched and parsed, or if the process results in an error.
+FeedUpdateBroker.prototype.fetchFeed = function(feedURL, callback)
+{
+    // remember callback
+    this.callback = callback;
+    
+    // create new XML HTTP request
+    this.httpReq = new Ajax();
+    
+    // set callback
+    var self = this;
+    this.httpReq.onreadystatechange = function()
+    {
+        self.readyStateChanged();
+    };
+    
+    // append the current time after the URL to bypass caches
+    var fullURL = feedURL;
+    if (fullURL.indexOf("?") == -1) {
+        fullURL += "?";
+    }
+    else {
+        fullURL += "&";
+    }
+    fullURL += "nocache=" + (new Date().getTime());
+    
+    // initiate the request
+    this.httpReq.open("GET", fullURL, true);
+    this.httpReq.send(null);
+}
+
+// Callback for ready-state change events in the XML HTTP request.
+FeedUpdateBroker.prototype.readyStateChanged = function()
+{
+    // complete request?
+    if (this.httpReq.readyState == 4) {
+        // attempt to get response status
+        var responseStatus = null;
+        try {
+            responseStatus = this.httpReq.status;
+        } 
+        catch (noStatusException) {
+        }
+        
+        this.callback(responseStatus, this.httpReq.responseXML);
+    }
+}
+
+function parseRouteXML(responseStatus, xmlDoc)
+{
+  if (responseStatus == 200 && xmlDoc != null) {
+    var routes = xmlDoc.getElementsByTagName("ROUTE");
+
+    for (var i = routes.length - 1; i >= 0; i--){
+      var lines = routes[i].getElementsByTagName("LINE");
+      var firstLine = lines[0];
+      var joreCode = firstLine.getAttribute("code");
+
+      var stop = firstLine.getElementsByTagName("STOP")[0];
+      var arrival = stop.getElementsByTagName("ARRIVAL")[0];
+      var arrivalTime = arrival.getAttribute("time");
+      addRow( joreCode, arrivalTime );
+    };         
+  }
+}
+
+function addRow( joreCode, timeAtStop )
+{
+  var timeTable = document.getElementById("timeTable");
+
+  var newRow = timeTable.insertRow(0);
+  var codeCell       = newRow.insertCell(0);
+  var timeAtStopCell = newRow.insertCell(1);
+  codeCell.innerHTML       = parseJORECode(joreCode);
+  timeAtStopCell.innerHTML = timeAtStop;
+}
+
+
+function parseHomeXML(responseStatus, xmlDoc)
+{
+    if (responseStatus == 200 && xmlDoc != null) {
+        var location = xmlDoc.getElementsByTagName("LOC");
+        var firstLocation = location[0];
+        
+        home.x = firstLocation.getAttribute("x");
+        home.y = firstLocation.getAttribute("y");
+    }
+}
+
+function parseWorkXML(responseStatus, xmlDoc)
+{
+    if (responseStatus == 200 && xmlDoc != null) {
+        var location = xmlDoc.getElementsByTagName("LOC");
+        var firstLocation = location[0];
+        
+        work.x = firstLocation.getAttribute("x");
+        work.y = firstLocation.getAttribute("y");
+    }
+}
+
+function getRoute()
+{
+    var feedURL = "http://api.reittiopas.fi/public-ytv/fi/api/?a=" + keyA.x + "," + keyA.y + "&b=" + keyB.x + "," + keyB.y + "&user=" + username + "&pass=" + password;
+    feedUpdateBroker.fetchFeed(feedURL, parseRouteXML);
+}
+
+function parseJORECode(joreCode)
+{
+    var areaTransportTypeCode = joreCode.substring(0, 1);
+    var lineCode = joreCode.substring(1, 5);
+    var letterVariant = joreCode.substring(5, 6);
+    var letterNumberVariant = joreCode.substring(6, 7);
+    var direction = joreCode.substring(7, 8);
+    
+    return "" + lineCode + letterVariant;
+}
+
+function emptyTable()
+{
+  var table = document.getElementById("timeTable");
+  var rows = table.rows;
+  for (var i = rows.length - 1; i >= 0; i--){
+    table.deleteRow(i);
+  }
+  document.getElementById("debug").innerHTML = "";
+}
+
+function takeMeHome()
+{
+    emptyTable();
+
+    keyA = work;
+    keyB = home;
+    
+    getRoute();
+}
+
+function takeMeToWork()
+{
+    emptyTable();
+
+    keyA = home;
+    keyB = work;
+    
+    getRoute();
+}
+
+var so;
+
+try {
+    //Retrieves the Service object to the ILocation interface
+    so = device.getServiceObject("Service.Location", "ILocation");
+    document.getElementById("debug").innerHTML = "after so";
+} catch (e) {
+    document.getElementById("debug").innerHTML = ' ' +e;
+    //alert(' ' +e);
+}
+// Gets the GPS position
+function getLocationAsync()
+{
+    document.getElementById("debug").innerHTML = "getLocationAsync()";
+    // This specifies update option used while retrieving location estimation. 
+    var updateoptions = new Object();
+    // Setting PartialUpdates to 'FALSE' ensures that user get atleast 
+    // BasicLocationInformation (Longitude, Lattitude, and Altitude.) is the default when no LocationInformationClass criteria is given.
+    updateoptions.PartialUpdates = false;
+    var criteria = new Object();
+    criteria.Updateoptions = updateoptions;
+    try {
+    //Executes the GetLocation method and sets the callbackLocation as the callback function to be called.
+    so.ILocation.GetLocation(criteria,callbackLocation);
+    } catch (e) {
+        document.getElementById("debug").innerHTML = "getLocationAsync: " + e;
+        //alert ("getLocationAsync: " + e);
+    }
+}
+
+//Callback function that receives the result as parameter.
+function callbackLocation(transId, eventCode, result)
+{
+    var latitude = result.ReturnValue.Latitude;
+    var longitude = result.ReturnValue.Longitude;
+    document.getElementById("debug").innerHTML = latitude+":"+longitude;
+}
+
+function init()
+{
+    feedUpdateBroker = new FeedUpdateBroker();
+    
+    var homeURL = "http://api.reittiopas.fi/public-ytv/fi/api/?key=" + homeKey + "&user=" + username + "&pass=" + password;
+    feedUpdateBroker.fetchFeed(homeURL, parseHomeXML);
+    
+    var workURL = "http://api.reittiopas.fi/public-ytv/fi/api/?key=" + workKey + "&user=" + username + "&pass=" + password;
+    feedUpdateBroker.fetchFeed(workURL, parseWorkXML);
+
+    //getLocationAsync();
+}
diff --git a/wrt/zouba/index.html b/wrt/zouba/index.html
new file mode 100644 (file)
index 0000000..fc75bcd
--- /dev/null
@@ -0,0 +1,31 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title></title>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+        <script type="text/javascript" src="WRTKit/WRTKit.js"></script>
+        <script type="text/javascript" src="basic.js"></script>
+        <link rel="stylesheet" href="basic.css" type="text/css">
+    </head>
+    <body onload="init()">
+        <table id="timeTable" align="center" border="1">
+        </table>
+        <table border="0" align="center">
+        <tr>
+            <td>
+                <button onclick="takeMeHome()">
+                    HOME
+                </button>
+            </td>
+            <td>
+                <button onclick="takeMeToWork()">
+                    WORK
+                </button>
+            </td>
+        </tr>
+               <tr>
+               <td>debug</td>
+               <td id="debug"></td>
+               </tr>
+    </body>
+</html>
diff --git a/wrt/zouba/preview/css/style.css b/wrt/zouba/preview/css/style.css
new file mode 100644 (file)
index 0000000..2f87e68
--- /dev/null
@@ -0,0 +1,633 @@
+@charset "utf-8";\r
+body {\r
+       background-image: url(../images/Gradient0Background.png);\r
+       background-repeat: repeat-x;\r
+       margin: 0px;\r
+       font-family: "Nokia Sans", "Nokia Sans SemiBold", "Arial Narrow";\r
+       padding: 0px;\r
+       overflow: hidden;\r
+}\r
+.hide{\r
+       display:none;\r
+}\r
+.show{\r
+       display:block;\r
+}\r
+\r
+code{\r
+       background-color: #ffffa6;\r
+       color: #000000;\r
+       padding: 3px;\r
+       display: block;\r
+       font-size: 110%;\r
+       margin: 3px 0px;\r
+}\r
+\r
+#DisplaySFKWrapper{\r
+       overflow: hidden;\r
+}\r
+#DisplayArea {\r
+       margin-right: auto;\r
+       margin-left: auto;\r
+       overflow: hidden;\r
+\r
+}\r
+\r
+#WidgetArea{\r
+       position: relative;\r
+       z-index: 99;\r
+}\r
+#WidgetArea iframe{\r
+       width: 100%;\r
+       height: 100%;\r
+       border: 0px;\r
+       margin-left: auto;\r
+       margin-top: auto;\r
+}\r
+\r
+#WidgetArea.hs_portrait{\r
+       background-image: url(../images/device/360x640/hs-portrait.png);\r
+       background-repeat: no-repeat;\r
+}\r
+\r
+#WidgetArea.hs_landscape{\r
+       background-image: url(../images/device/360x640/hs-landscape.png);\r
+       background-repeat: no-repeat;\r
+}\r
+#WidgetArea.hs_portrait iframe{\r
+       width: 306px;\r
+       height: 76px;\r
+       margin-left: 26px;\r
+       margin-top: 321px;\r
+       overflow: hidden !important;\r
+}\r
+\r
+#WidgetArea.hs_landscape iframe{\r
+       width: 306px;\r
+       height: 76px;\r
+       margin-left: 322px !important;\r
+       margin-top: 151px !important;\r
+       overflow: hidden !important;\r
+}\r
+\r
+#iframeMask\r
+{\r
+       width: 328px;\r
+       height: 100px;\r
+       position: absolute;\r
+       z-index: 900;\r
+       background-image: url(../images/hs-iframeMask.png);\r
+       background-repeat: no-repeat;\r
+       background-position: top left;\r
+}\r
+\r
+#iframeMask:hover\r
+{\r
+       background-repeat: no-repeat;\r
+       background-position: bottom left;\r
+}\r
+\r
+\r
+#WidgetArea.hs_portrait #iframeMask{\r
+       margin-left: 16px !important;\r
+       margin-top: 310px !important;\r
+}\r
+#WidgetArea.hs_landscape #iframeMask{\r
+       margin-left: 312px !important;\r
+       margin-top: 140px !important;\r
+}\r
+\r
+\r
+#SoftKeys{\r
+       height: 50px;\r
+       width: 240px;\r
+       margin-right: auto;\r
+       margin-left: auto;\r
+       margin-top: 10px;\r
+}\r
+\r
+div.clear{\r
+       clear: both;\r
+}\r
+#DeviceDisplayLayout {\r
+       background-repeat: no-repeat;\r
+       background-position: center center;\r
+       margin-right: auto;\r
+       margin-left: auto;\r
+       margin-top: 0px;\r
+       overflow: hidden;\r
+}\r
+\r
+#DeviceDisplayLayout.portrait_240x320 {\r
+       background-image: url(../images/device/240x320/Portrait.png);\r
+       width: 600px;\r
+       height: 536px;\r
+}\r
+\r
+#DeviceDisplayLayout.landscape_240x320 {\r
+       background-image: url(../images/device/240x320/Landscape.png);\r
+       width: 848px;\r
+       height: 408px;\r
+}\r
+\r
+#SoftKeysArea{\r
+       z-index: 101;\r
+       position: relative;\r
+/*     background-image: url(../images/device/menuKeys-bg.png);\r
+       background-repeat: no-repeat;\r
+       background-position: center top;\r
+*/\r
+       background-color: #666666;\r
+}\r
+\r
+#SoftKeysArea ul{\r
+       list-style: none;\r
+       margin: 0px;\r
+       padding: 0px;\r
+       \r
+}\r
+\r
+#SoftKeysArea ul li{\r
+       margin: 0px;\r
+       font-weight: bold;\r
+       font-size: 15px;\r
+       float: left;\r
+       padding: 5px;\r
+}\r
+\r
+\r
+#SoftKeysArea ul li a{\r
+       color: #FFFFFF;\r
+       text-decoration: none;\r
+       display: block;\r
+}\r
+\r
+li#RskLabel{\r
+       text-align: right;\r
+}\r
+\r
+#MenuItemsArea{\r
+       z-index: 100;\r
+       display: none;\r
+}      \r
+\r
+#MenuItemsArea ul{\r
+       margin: 0px;\r
+       padding: 5px;\r
+       list-style-position: inside;\r
+       list-style-image: none;\r
+       list-style-type: none;\r
+       background-color: #CCCCCC;\r
+}\r
+\r
+#MenuItemsArea ul li{\r
+       font-size: 13px;\r
+       font-weight: bold;\r
+}\r
+\r
+#MenuItemsArea li.active{\r
+       background-color: #75ea00;\r
+}\r
+\r
+#MenuItemsArea a{\r
+       color: #000;\r
+       text-decoration: none;\r
+       display: block;\r
+       padding: 5px;\r
+       height: 14px;\r
+}\r
+#MenuItemsArea a:hover{\r
+       background-color: #75ea00;\r
+}\r
+\r
+#MenuItemsArea a.subMenuItem{\r
+       background-image: url(../images/sub-menu-arrow.png);\r
+       background-repeat: no-repeat;\r
+       background-position: right 0px;\r
+}\r
+\r
+#MenuItemsArea a.subMenuItem:hover{\r
+       background-position: right -20px;\r
+}\r
+#MenuItemsArea a.subMenuItem:active{\r
+       background-position: right -40px;\r
+}\r
+\r
+#MenuItemsArea li.active a.subMenuItem{\r
+       background-position: right -20px;\r
+}\r
+div#IconArea{\r
+       display: none;\r
+       font-size: 0.9em;\r
+       font-weight: bold;\r
+       background-repeat: no-repeat;\r
+}\r
+\r
+div#IconArea.portrait240x320{\r
+       background-image: url(../images/statusBar_240x320.png);\r
+}\r
+div#IconArea.landscape240x320{\r
+       background-image: url(../images/statusBar_320x240.png);\r
+}\r
+\r
+div#IconArea.portrait320x240{\r
+       background-image: url(../images/statusBar_320x240.png);\r
+}\r
+div#IconArea.landscape320x240{\r
+       background-image: url(../images/statusBar_240x320.png);\r
+}\r
+\r
+div#IconArea.portrait360x640{\r
+       background-image: url(../images/statusBar_360x640.png);\r
+}\r
+div#IconArea.landscape360x640{\r
+       background-image: url(../images/statusBar_640x360.png);\r
+}\r
+\r
+div#IconArea.landscape800x352{\r
+       background-image: url(../images/statusBar_800x352.png);\r
+}\r
+\r
+\r
+div.IconFile{\r
+       margin-left: auto;\r
+       margin-right: auto;\r
+       text-align: center;\r
+       padding: 20px;\r
+}\r
+\r
+div.IconFile:hover{\r
+       background-image: url(../images/IconArea-hover.png);\r
+       background-position: center center;\r
+       background-repeat: no-repeat;\r
+}\r
+\r
+div.IconFile p{\r
+       margin: 0px;\r
+}\r
+\r
+\r
+\r
+p.highlight span{\r
+       background-color: #fbf7a2;\r
+       font-weight: normal;\r
+       font-size: 0.8em;\r
+       padding: 3px;\r
+}\r
+\r
+/*\r
+       preferences CSS\r
+*/\r
+\r
+div#PreferencesBtn{\r
+       width: 75px;\r
+       height: 85px;\r
+       background-image: url(../images/settings-icon.png);\r
+       position: absolute;\r
+       top: 10px;\r
+       left: 10px;\r
+       background-position: left bottom;\r
+       z-index: 200;\r
+}\r
+\r
+div#PreferencesBtn:hover{\r
+       background-position: left top;\r
+}\r
+\r
+div#loaderDiv{\r
+       padding: 10px;\r
+       font-size: 1.1em;\r
+       position: absolute;\r
+       top: 0px;\r
+       right: 0px;\r
+       display: none;\r
+       z-index: 202;\r
+}\r
+\r
+div#loaderDiv.green{\r
+       background-color: #5abd2b;\r
+       color: #FFFFFF;\r
+}\r
+\r
+div#loaderDiv.yellow{\r
+       background-color: #ffff00;\r
+       color: #000000;\r
+}\r
+\r
+div#orientationIcon{\r
+       background-image: url(../images/normal-orientation-icon.png);\r
+       background-repeat: no-repeat;\r
+       width: 191px;\r
+       height: 72px;\r
+       float: left;\r
+       position: absolute;\r
+       left: 10px;\r
+       top: 0px;\r
+       display: none;\r
+}\r
+div#orientationIcon:hover{\r
+       background-image: url(../images/active-orientation-icon.png);\r
+}\r
+\r
+table{\r
+       border-top: 1px solid #808080;\r
+       border-left: 1px solid #808080;\r
+}\r
+\r
+table a.link{\r
+       background-color: #20c41c;\r
+       color: #ffffff;\r
+       font-weight: bold;\r
+       border: 1px solid #4e872c;\r
+       padding: 3px 2px;\r
+       text-decoration: none;\r
+       font-size: 80%;\r
+}\r
+\r
+table th, table td{\r
+       padding: 6px 5px;\r
+       border-bottom: 1px solid #808080;\r
+       border-right: 1px solid #808080;\r
+       font-size: 0.9em;\r
+}\r
+table th{\r
+       width: 150px;\r
+       text-align: left;\r
+       background-image: url(../images/th-bg-gradient.png);\r
+       background-repeat: repeat-x;\r
+       background-position: left bottom;\r
+}\r
+\r
+#NotificationDiv p{\r
+       color: #ffffff;\r
+       font-size: 95%;\r
+       padding: 5px;\r
+}\r
+\r
+strong{\r
+       color: #eee46c;\r
+}\r
+\r
+#BrowserNotificationBar{\r
+       z-index: 2000;\r
+       background-color: #f2eb8e;\r
+       border-bottom: 2px solid #f0d25e;\r
+       display: none;\r
+       position: absolute;\r
+       left: 0;\r
+       top: 0;\r
+       width: 100%;\r
+       font-size: 80%;\r
+       font-weight: bolder;\r
+       text-align: right;\r
+       margin: 0px;\r
+       opacity: 0.9;\r
+}\r
+#BrowserNotificationBar a{\r
+       height: 10px;\r
+       width: 10px;\r
+       float: right;\r
+       background-image: url(../images/BrowserNotificationBar-Toogle.gif);\r
+       background-position: 0px -10px;\r
+       margin : 4px 15px 0px 10px;\r
+       cursor: hand;\r
+       overflow: hidden;\r
+}\r
+/*\r
+       Event Triggering CSS\r
+*/\r
+\r
+h2{\r
+       font-size: 120%;\r
+       margin: 3px 0px;\r
+       padding: 0px;\r
+}\r
+\r
+#tabs-1, #tabs-2{\r
+       height: 223px;\r
+       overflow: auto;\r
+}\r
+\r
+#connect-charger-icon, #dis-connect-charger-icon{\r
+       background-repeat: no-repeat;\r
+       background-position: left top;\r
+       width: 165px;\r
+       height: 36px;\r
+       margin: 5px auto;\r
+}\r
+\r
+#connect-charger-icon{\r
+       background-image: url(../images/connect-charger-icon.png);\r
+}\r
+\r
+#dis-connect-charger-icon{\r
+       background-image: url(../images/dis-connect-charger-icon.png);\r
+}\r
+\r
+#connect-charger-icon:hover, #dis-connect-charger-icon:hover{\r
+       background-position: left bottom;\r
+}\r
+\r
+div#event-battery, div#event-messaging, div#event-memory{\r
+       float: left;\r
+       width: 150px;\r
+       height: 50px;\r
+       background-position: left top;\r
+       margin: 10px;\r
+       background-repeat: no-repeat;\r
+       border: 1px solid #6f6f6f;\r
+}\r
+\r
+div#event-battery.active:hover, div#event-messaging.active:hover, div#event-memory.active:hover{\r
+       background-position: 0px -50px;\r
+       border: 1px solid #75ea4f;\r
+}\r
+\r
+div#event-messaging.inactive, div#event-memory.inactive{\r
+       background-position: 0px -100px;\r
+       border: 1px solid #676767;\r
+}\r
+\r
+\r
+div#event-battery{\r
+       background-image: url(../images/battery-icon.png);\r
+}\r
+\r
+div#event-messaging{\r
+       background-image: url(../images/messaging-icon.png);\r
+}\r
+\r
+div#event-memory{\r
+       background-image: url(../images/memory-icon.png);\r
+}\r
+\r
+div.ui-panel{\r
+       height:30px;    \r
+}\r
+\r
+a.ui-button, a.ui-button-fixed {\r
+       background:#555555 url(../script/jquery-ui/css/ui-darkness/images/555555_40x100_textures_02_glass_20.png) repeat-x scroll 0 50%;\r
+       border:1px solid #666666;\r
+       color:#EEEEEE;\r
+       cursor:pointer;\r
+       font-size:0.9em;\r
+       font-weight:bolder;\r
+       line-height:1.4em;\r
+       margin:0.5em 8px 0.5em 0;\r
+       padding:0.2em 0.6em 0.3em;\r
+       text-decoration: none;\r
+}\r
+a.ui-button:hover, a.ui-button-fixed:hover {\r
+       background:#0078A3 url(../script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png) repeat-x scroll 0 50%;\r
+       border:1px solid #4bd94b;\r
+       color:#FFFFFF;\r
+}\r
+\r
+a.ui-button-fixed{\r
+       float: left;\r
+       padding: 0.4em 0.6em 0.8em;\r
+       text-align: center;\r
+       width: 145px !important;\r
+}\r
+\r
+div#slider-value-panel{\r
+       text-align: center;\r
+       margin-top: 10px;\r
+}\r
+\r
+div#slider-value-panel span{\r
+       padding: 3px;\r
+       background:#0078A3 url(../script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png) repeat-x scroll 0 50%;\r
+       border:1px solid #4bd94b;\r
+       color:#FFFFFF;\r
+       font-weight: bolder;\r
+}\r
+\r
+\r
+/*\r
+       Console UI\r
+*/\r
+#preview-ui-top{\r
+       overflow:auto;\r
+}\r
+\r
+#preview-ui-bottom{\r
+       overflow:hidden;\r
+       display: none;\r
+}\r
+#preview-ui-bottom-header{\r
+       background-color: #aeaeae;\r
+       background-image: url(../images/console-icon.gif);\r
+       background-repeat: repeat-x;\r
+       background-position: 0px -28px;\r
+}\r
+span#Console-Toggle-Button{\r
+       height: 9px;\r
+       width: 15px;\r
+       float: right;\r
+       background-repeat: no-repeat;\r
+       margin : 12px 8px 0px 0px;\r
+       cursor: hand;\r
+}\r
+\r
+span#Console-Toggle-Button.open{\r
+       background-position: 0px 0px;\r
+       background-image: url(../images/console-close-icon.png);\r
+}\r
+\r
+span#Console-Toggle-Button.open:hover{\r
+       background-position: 0px -9px;\r
+}\r
+\r
+span#Console-Toggle-Button.open:active{\r
+       background-position: 0px -18px;\r
+}\r
+\r
+\r
+span#Console-Toggle-Button.close{\r
+       background-position: 0px 0px;\r
+       background-image: url(../images/console-open-icon.png);\r
+}\r
+\r
+span#Console-Toggle-Button.close:hover{\r
+       background-position: 0px -9px;\r
+}\r
+\r
+span#Console-Toggle-Button.close:active{\r
+       background-position: 0px -18px;\r
+}\r
+\r
+\r
+span#Console-Clear-Button{\r
+       height: 16px;\r
+       width: 39px;\r
+       float: right;\r
+       background-image: url(../images/console-clear-button.png);\r
+       background-repeat: no-repeat;\r
+       margin : 10px 10px 0px 0px;\r
+       cursor: hand;\r
+}\r
+span#Console-Clear-Button:hover{\r
+       background-position: -0px -16px;\r
+}\r
+\r
+#preview-ui-bottom-body{\r
+       overflow:auto;\r
+       background-color: #ffffff;\r
+       display: none;\r
+}\r
+\r
+#preview-ui-bottom-body p{\r
+       font-family: "Courier New", Courier, monospace;\r
+       font-size: 11px;\r
+       padding: 2px 5px;\r
+       border-bottom: 1px solid silver;\r
+       margin: 0px;\r
+}\r
+\r
+#preview-ui-bottom-body p.log{\r
+\r
+}\r
+\r
+#preview-ui-bottom-body p.info{\r
+       background-image: url(../images/infoIcon.png);\r
+       background-repeat: no-repeat;\r
+       background-position: 5px center;\r
+       padding-left: 26px;\r
+}\r
+#preview-ui-bottom-body p.warn{\r
+       background: #00ffff url(../images/warningIcon.png);\r
+       background-repeat: no-repeat;\r
+       background-position: 5px center;\r
+       padding-left: 26px;\r
+}\r
+#preview-ui-bottom-body p.error{\r
+       background: #ffffe0 url(../images/errorIcon.png);\r
+       background-repeat: no-repeat;\r
+       background-position: 5px center;\r
+       padding-left: 26px;\r
+       color: #ff0000;\r
+}\r
+\r
+\r
+#preview-ui-bottom-header div{\r
+       float: left;\r
+       margin: 9px;\r
+       color: #ffffff;\r
+       font-size: 11px;\r
+       font-weight: bolder;\r
+       font-family: "Arial";\r
+}\r
+\r
+\r
+span#wrt-help{\r
+       height: 28px;\r
+       width: 28px;\r
+       float: right;\r
+       background-repeat: no-repeat;\r
+       background-image: url(../images/wrt-help-icon.png);\r
+}\r
+\r
+span#wrt-help:hover{\r
+       background-position: -28px 0px;\r
+}
\ No newline at end of file
diff --git a/wrt/zouba/preview/data/appManager_data.js b/wrt/zouba/preview/data/appManager_data.js
new file mode 100644 (file)
index 0000000..560c549
--- /dev/null
@@ -0,0 +1,99 @@
+/**
+ * SAPI Sample Data - AppManager
+ */
+
+
+(function(){  
+       
+    var data_apps = [
+    {
+        "Path": "C:\\private\\10282822\\com.nokia.forum.widget.accuwidget\\AccuWidget\\accuwidget.xhtml",
+        "Uid": "0x2000dad2",
+        "Caption": "AccuWidget",
+        "ShortCaption": "AccuWidget"
+    }, {
+        "Path": "C:\\private\\10282822\\com.nokia.wrt.tools.sapi.CreatorWidget\\CreatorWidget\\index.html",
+        "Uid": "0x2000dadb",
+        "Caption": "Creator Widget",
+        "ShortCaption": "Creator Widget"
+       },{\r
+        "Path": "Z:\\sys\\bin\\lcapp.exe",\r
+        "Uid": "0x10283139",\r
+        "Caption": "Location",\r
+        "ShortCaption": "Location"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\javadrmmanager.exe",\r
+        "Uid": "0x1028246e",\r
+        "Caption": "javadrmmanager",\r
+        "ShortCaption": "javadrmmanager"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\iaupdater.exe",\r
+        "Uid": "0x2000f85d",\r
+        "Caption": "iaupdater",\r
+        "ShortCaption": "iaupdater"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\iaupdate.exe",\r
+        "Uid": "0x2000f85a",\r
+        "Caption": "App. update",\r
+        "ShortCaption": "App. update"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\SAFlash.exe",\r
+        "Uid": "0x101fd693",\r
+        "Caption": "Flash Lite",\r
+        "ShortCaption": "Flash Lite"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\eswt.exe",\r
+        "Uid": "0x101f9516",\r
+        "Caption": "eswt",\r
+        "ShortCaption": "eswt"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\DRMRightsManager.exe",\r
+        "Uid": "0x101f85c7",\r
+        "Caption": "Licences",\r
+        "ShortCaption": "Licences"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\RoapApp.exe",\r
+        "Uid": "0x10008d64",\r
+        "Caption": "Licence download",\r
+        "ShortCaption": "Licence download"\r
+    }, {\r
+        "Path": "Z:\\sys\\bin\\DdViewer.exe",\r
+        "Uid": "0x10008d3f",\r
+        "Caption": "Download",\r
+        "ShortCaption": "Download"\r
+       }, {
+               "Path": "Z:\\sys\\bin\\MediaGallery2.exe",
+               "Uid": "0x101f8599",
+               "Caption": "Gallery",
+               "ShortCaption": "Gallery"
+    }, {\r
+        "Path": "Z:\\sys\\bin\\CodViewer.exe",\r
+        "Uid": "0x10008d4a",\r
+        "Caption": "Download",\r
+        "ShortCaption": "Download"\r
+    }];\r
+               
+               
+               
+    var data_packages = [{\r
+        "PackageName": "Mobiola Screen Capture",\r
+        "Uid": "0x2000be16",\r
+        "Version": "3:0",\r
+        "Vendor": "Warelex LLC",\r
+        "Drive": "E"\r
+    }, {\r
+        "PackageName": "Facebook",\r
+        "Uid": "0x20011184",\r
+        "Version": "1:0",\r
+        "Vendor": "Nokia Corporation",\r
+        "Drive": "C"\r
+    }];\r
+       
+       
+       /**
+        * register data!
+        */
+       device.implementation.loadData('Service.AppManager', 'Application', data_apps);
+       device.implementation.loadData('Service.AppManager', 'UserInstalledPackage', data_packages);
+
+})()
diff --git a/wrt/zouba/preview/data/calendar_data.js b/wrt/zouba/preview/data/calendar_data.js
new file mode 100644 (file)
index 0000000..4235238
--- /dev/null
@@ -0,0 +1,136 @@
+/**
+ * SAPI Sample Data - Calendar
+ */
+
+
+(function(){  
+
+
+    var data_entries = [{\r
+        "Type": "ToDo",\r
+        "Summary": "Face head on my problems",\r
+        "Description": "Face head on my problems",\r
+        "EndTime": "Wednesday, 15 April, 2009 12:00:00 am",\r
+        "id": "ihiwykmkjzcowqEnnEbeDnJpzWhPWrgNpNgudjdwgPfisvvQscuibwwSmgkdhdiBzIfyqvfIBmiYavfklygBssoKmWpJuxftbkdLsfmuwudczlJikohlFbQecaMlbaPnwyddzqXcjrhldXignjYtWyfqfzbpcxlH",\r
+        "LocalId": "34",\r
+        "Priority": 1,\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "ToDo",\r
+        "Summary": "Believe myself first",\r
+        "Description": "Believe myself first",\r
+        "EndTime": "Sunday, 22 March, 2009 12:00:00 am",\r
+        "AlarmTime": "Saturday, 21 March, 2009 11:30:00 pm",\r
+        "id": "rjutskelXlDdoaebCyPzjopwgxMxluuLesqqsrykvIxrFLbxvuhBImBbhqwlSRfFtvWktkrvqpjfvxCoBxpsDlbgugvqjudregvyoebgtihRiSarcnryZovfwyHTcmXqZdjdrVPvSGnqroYgXdtpafqxTzrnkMKpzLihcxfaxwmdrkuGifsgbglhyfwqmtiPyzpeuxvKFfnrmhaqnrUarustDySMgKakjpFpkhtbonmTyBvhlzv",\r
+        "LocalId": "35",\r
+        "Priority": 1,\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "Meeting",\r
+        "Summary": "Meeting with the professor",\r
+        "Description": "Meeting with the professor",\r
+        "StartTime": "Monday, 23 March, 2009 11:56:00 am",\r
+        "EndTime": "Monday, 23 March, 2009 2:31:00 pm",\r
+        "AlarmTime": "Monday, 23 March, 2009 11:01:00 am",\r
+        "InstanceStartTime": "Monday, 23 March, 2009 11:56:00 am",\r
+        "InstanceEndTime": "Monday, 23 March, 2009 2:31:00 pm",\r
+        "id": "hifXqeBiUOlelbioirmeoniClarsiybNhNxdlQbqBzcngmhxtzlRoebdeYxupjaxnapugxrKnmhGjzdwtChVydzwOdwrHPokjqjvyaPwbqCjdtpukjcoyjdkjkkrndZzwjCYQPxgvereyuktnOtIndpoyimtjzPzEnkxCfzhxaDTvUgclfpsfbtgtvwk",\r
+        "LocalId": "31",\r
+        "Priority": 0,\r
+        "Organizer": {\r
+            "CommonName": "Frideswide Farprington",\r
+            "Address": "Christian.Wilbar@Melleva.com"\r
+        },\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "Meeting",\r
+        "Summary": "Work issues",\r
+        "Description": "Work issues",\r
+        "StartTime": "Saturday, 28 March, 2009 1:22:00 am",\r
+        "EndTime": "Saturday, 28 March, 2009 7:56:00 am",\r
+        "AlarmTime": "Saturday, 28 March, 2009 12:49:00 am",\r
+        "InstanceStartTime": "Saturday, 28 March, 2009 1:22:00 am",\r
+        "InstanceEndTime": "Saturday, 28 March, 2009 7:56:00 am",\r
+        "id": "symstNdkqdznkcettruqqyefdjkzikeBXmcamanzrygnusjyFYheprwaxksxzrqsdbnkTqemtsqqZbqnbbircyqtohmymWvqEc",\r
+        "LocalId": "30",\r
+        "Priority": 0,\r
+        "Organizer": {\r
+            "CommonName": "Margery Worthley",\r
+            "Address": "Grace.Wilbar@Peger.com"\r
+        },\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "Reminder",\r
+        "Summary": "Remeber to harvest corn field",\r
+        "Description": "Remeber to harvest corn field",\r
+        "StartTime": "Thursday, 02 April, 2009 12:00:00 am",\r
+        "AlarmTime": "Wednesday, 01 April, 2009 11:52:00 pm",\r
+        "id": "uwtxgvTsowwGbnsgboEprwxvmihUkkDczxeohsnsXpUzUaHgjBJmjhpfOjaoyvRrjwIkgafrcszvbCSooutemfhejtyfonHviomgouimvPtexgdWmzDgGP",\r
+        "LocalId": "36",\r
+        "Priority": 0,\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "Reminder",\r
+        "Summary": "Remeber to wax cross country skiis",\r
+        "Description": "Remeber to wax cross country skiis",\r
+        "StartTime": "Monday, 06 April, 2009 12:00:00 am",\r
+        "AlarmTime": "Sunday, 05 April, 2009 11:44:00 pm",\r
+        "id": "ivunsxcjmrsdaKkdtbqpskSIGIFOftMLwTuvCbiHmrkJnxdZgsapbqhoxNrhsbheyztgyOfvdqGrIlawVrvEwnYjnzoSlyimcxlKcSqetcruzf",\r
+        "LocalId": "37",\r
+        "Priority": 0,\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "DayEvent",\r
+        "Summary": "Go the bank",\r
+        "Description": "Go the bank",\r
+        "StartTime": "Monday, 06 April, 2009 6:16:00 pm",\r
+        "EndTime": "Monday, 06 April, 2009 7:19:00 pm",\r
+        "AlarmTime": "Monday, 06 April, 2009 6:07:00 pm",\r
+        "id": "QvcvlpXpflemwqjtniukLPsjkSengqBEfajerjclkrwysdy",\r
+        "LocalId": "33",\r
+        "Priority": 0,\r
+        "Replication": "Open"\r
+    }, {\r
+        "Type": "DayEvent",\r
+        "Summary": "School day",\r
+        "Description": "School day",\r
+        "StartTime": "Thursday, 16 April, 2009 5:27:00 pm",\r
+        "EndTime": "Thursday, 16 April, 2009 9:39:00 pm",\r
+        "AlarmTime": "Thursday, 16 April, 2009 4:35:00 pm",\r
+        "id": "zmHupjqghnkEepdfghSCcsmFnrrducaqEyqyetauTcmxscSptpchgimxeEnOzxdiyEldyrikjmxvgzibauvjQfdbzgoumlVyAjqfhqlgpTtbiffqdzgpzWrquiyAdidvccvffzZxmpgjjbjUCqyeuBiikiedtclqabbsdazAbb",\r
+        "LocalId": "32",\r
+        "Priority": 0,\r
+        "Replication": "Open"\r
+    }];\r
+       
+       
+
+       name = "C:MyCalendar";
+       id = 200;
+       localId = 20;
+               
+/** start data block **/       
+var data2 = [];
+       
+       for (var i = 1; i <= 10; i++) {
+               data2.push({
+                       Type            : 'Meeting',
+                       id                      : id++,
+                       LocalId         : localId++,
+                       CalendarName: name,
+                       StartTime       : new Date('3/'+i+'/2009'),
+                       Endtime         : new Date('3/'+(1+i)+'/2009'),
+                       Description     : 'sample meeting ' + i
+               });
+       }
+/** end data block **/ 
+
+
+
+       /**
+        * register data!
+        */
+       device.implementation.loadData('Service.Calendar', 'C:Calendar', data_entries);
+       device.implementation.loadData('Service.Calendar', 'C:MyCalendar', data2);
+
+})()
diff --git a/wrt/zouba/preview/data/contact_data.js b/wrt/zouba/preview/data/contact_data.js
new file mode 100644 (file)
index 0000000..8db8bcf
--- /dev/null
@@ -0,0 +1,158 @@
+/**
+ * SAPI Sample Data - Contacts
+ */
+
+(function(){
+
+
+       var data_contacts = [{\r
+           "id": "",\r
+           "FirstName": {\r
+               "Label": "First name",\r
+               "Value": "Alice"\r
+           },\r
+           "LastName": {\r
+               "Label": "Last name",\r
+               "Value": "Moller"\r
+           },\r
+           "LandPhoneGen": {\r
+               "Label": "Telephone",\r
+               "Value": "0230328732"\r
+           },\r
+           "SyncClass": {\r
+               "Label": "Synchronisation",\r
+               "Value": "private"\r
+           }\r
+       }, {\r
+           "id": "",\r
+           "FirstName": {\r
+               "Label": "First name",\r
+               "Value": "Amy"\r
+           },\r
+           "LastName": {\r
+               "Label": "Last name",\r
+               "Value": "Kammer"\r
+           },\r
+           "LandPhoneGen": {\r
+               "Label": "Telephone",\r
+               "Value": "0492303652"\r
+           },\r
+           "SyncClass": {\r
+               "Label": "Synchronisation",\r
+               "Value": "private"\r
+           }\r
+       }, {\r
+           "id": "",\r
+           "SyncClass": {\r
+               "Label": "Synchronisation",\r
+               "Value": "private"\r
+           },\r
+           "LastName": {\r
+               "Label": "Last name",\r
+               "Value": "Bierman"\r
+           },\r
+           "FirstName": {\r
+               "Label": "First name",\r
+               "Value": "Michael"\r
+           },\r
+           "MobilePhoneGen": {\r
+               "Label": "Mobile",\r
+               "Value": "4084256071"\r
+           }\r
+       }, {\r
+           "id": "",\r
+           "FirstName": {\r
+               "Label": "First name",\r
+               "Value": "Ralph"\r
+           },\r
+           "LastName": {\r
+               "Label": "Last name",\r
+               "Value": "Jacmor"\r
+           },\r
+           "LandPhoneGen": {\r
+               "Label": "Telephone",\r
+               "Value": "0432443343"\r
+           },\r
+           "SyncClass": {\r
+               "Label": "Synchronisation",\r
+               "Value": "private"\r
+           }\r
+       }, {\r
+           "id": "",\r
+           "FirstName": {\r
+               "Label": "First name",\r
+               "Value": "Robert"\r
+           },\r
+           "LastName": {\r
+               "Label": "Last name",\r
+               "Value": "Richards"\r
+           },\r
+           "LandPhoneGen": {\r
+               "Label": "Telephone",\r
+               "Value": "+4443433434"\r
+           },\r
+           "SyncClass": {\r
+               "Label": "Synchronisation",\r
+               "Value": "private"\r
+           }\r
+       }, {\r
+           "id": "",\r
+           "FirstName": {\r
+               "Label": "First name",\r
+               "Value": "Ursula"\r
+           },\r
+           "LastName": {\r
+               "Label": "Last name",\r
+               "Value": "West"\r
+           },\r
+           "LandPhoneGen": {\r
+               "Label": "Telephone",\r
+               "Value": "0213443434"\r
+           },\r
+           "SyncClass": {\r
+               "Label": "Synchronisation",\r
+               "Value": "private"\r
+           }\r
+       }];  
+       
+
+    var data_groups = [{\r
+        "id": "",\r
+        "GroupLabel": "TestGroupName"\r
+    }, {\r
+        "id": "",\r
+        "GroupLabel": "Silver club #5488",\r
+        "Contents": ["", "", "", "", "", ""]\r
+    }, {\r
+        "id": "",\r
+        "GroupLabel": "The buddies #9926"\r
+    }, {\r
+        "id": "",\r
+        "GroupLabel": "Football team #5940",\r
+        "Contents": ["", ""]\r
+    }, {\r
+        "id": "",\r
+        "GroupLabel": "Science group #2742",\r
+        "Contents": ["", "", "", "", "", ""]\r
+    }, {\r
+        "id": "",\r
+        "GroupLabel": "Rockers #3062",\r
+        "Contents": ["", "", "", "", "", ""]\r
+    }];\r
+               
+               
+    var data_database = [{\r
+        "DBUri": "cntdb://c:contacts.cdb"\r
+    },{
+        "DBUri": "sim://global_adn"
+       }];
+    
+    
+    /**
+     * register data!
+     */
+    device.implementation.loadData('Service.Contact', 'Contact', data_contacts);
+    device.implementation.loadData('Service.Contact', 'Group', data_groups);
+    device.implementation.loadData('Service.Contact', 'Database', data_database);
+    
+})()
diff --git a/wrt/zouba/preview/data/landmarks_data.js b/wrt/zouba/preview/data/landmarks_data.js
new file mode 100644 (file)
index 0000000..efa8bb2
--- /dev/null
@@ -0,0 +1,339 @@
+/**\r
+ * SAPI Sample Data - Landmark\r
+ */\r
+\r
+(function(){\r
+\r
+       var data_landmark =     [{\r
+               "id":"47",\r
+               "LandmarkName":"Best food ever!",\r
+               "LandmarkPosition":{\r
+                       "Latitude":-17.5423,\r
+                       "Longitude":-54.8163,\r
+                       "Altitude":82,\r
+                       "HAccuracy":2,\r
+                       "VAccuracy":4\r
+               },\r
+               "CategoryInfo":["1"],\r
+               "LandmarkDesc":"Place looks really nice.",\r
+               "LandmarkFields":{\r
+                       "Country":"Finland",\r
+                       "City":"Tokyo",\r
+                       "AreaCode":"FI-70100",\r
+                       "Street":"Plains Road",\r
+                       "Telephone":"+4443433434"\r
+               }\r
+       },{\r
+               "id":"44",\r
+               "LandmarkName":"Food store",\r
+               "LandmarkPosition":{\r
+                       "Latitude":65.4233,\r
+                       "Longitude":-93.4225,\r
+                       "Altitude":54,\r
+                       "HAccuracy":1,\r
+                       "VAccuracy":1\r
+               },\r
+               "CategoryInfo":["10"],\r
+               "LandmarkDesc":"Words are not enough to describe this landmark",\r
+               "LandmarkFields":{\r
+                       "Country":"Finland",\r
+                       "City":"St. Michel",\r
+                       "AreaCode":"11233",\r
+                       "Street":"McKenzie Avenue",\r
+                       "Telephone":"0432443343"\r
+               }\r
+       },{\r
+               "id":"40",\r
+               "LandmarkName":"Hospital",\r
+               "LandmarkPosition":{\r
+                       "Latitude":-2.4616,\r
+                       "Longitude":51.4958,\r
+                       "Altitude":43,\r
+                       "HAccuracy":3,\r
+                       "VAccuracy":3\r
+               },\r
+               "CategoryInfo":["13"],\r
+               "LandmarkDesc":"Place looks really nice.",\r
+               "LandmarkFields":{\r
+                       "Country":"United States of America",\r
+                       "City":"London",\r
+                       "AreaCode":"11233",\r
+                       "Street":"Pukershire Avenue",\r
+                       "Telephone":"0565645455"\r
+               }\r
+       },{\r
+               "id":"45",\r
+               "LandmarkName":"John’s home",\r
+               "LandmarkPosition":{\r
+                       "Latitude":36.9077,\r
+                       "Longitude":134.4066,\r
+                       "Altitude":42,\r
+                       "HAccuracy":3,\r
+                       "VAccuracy":5\r
+               },\r
+               "CategoryInfo":["14"],\r
+               "LandmarkDesc":"This is my favorite place",\r
+               "LandmarkFields":{\r
+                       "City":"Los Angeles",\r
+                       "AreaCode":"00310",\r
+                       "Street":"McKenzie Lane",\r
+                       "Telephone":"+35854553456",\r
+                       "Country":"Japan"\r
+               }\r
+       },{\r
+               "id":"48",\r
+               "LandmarkName":"John’s home",\r
+               "LandmarkPosition":{\r
+                       "Latitude":17.1817,\r
+                       "Longitude":113.4183,\r
+                       "Altitude":29,\r
+                       "HAccuracy":3,\r
+                       "VAccuracy":2\r
+               },\r
+               "CategoryInfo":["3"],\r
+               "LandmarkDesc":"Words are not enough to describe this landmark",\r
+               "LandmarkFields":{\r
+                       "Country":"Norway",\r
+                       "City":"St. Petersburg",\r
+                       "AreaCode":"FI-70100",\r
+                       "Street":"Windsor Road",\r
+                       "Telephone":"+4465665456"\r
+               }\r
+       },{\r
+               "id":"49",\r
+               "LandmarkName":"Nice beach",\r
+               "LandmarkPosition":{\r
+                       "Latitude":-22.0327,\r
+                       "Longitude":-33.0193,\r
+                       "Altitude":57,\r
+                       "HAccuracy":1,\r
+                       "VAccuracy":0\r
+               },\r
+               "CategoryInfo":["7"],\r
+               "LandmarkDesc":"This is my favorite place",\r
+               "LandmarkFields":{\r
+                       "Telephone":"+35854553456",\r
+                       "Country":"Finland",\r
+                       "City":"Bangkok",\r
+                       "AreaCode":"00310",\r
+                       "Street":"Highland Avenue Extension"\r
+               }\r
+       },{\r
+               "id":"42",\r
+               "LandmarkName":"Nice view",\r
+               "LandmarkPosition":{\r
+                       "Latitude":-1.5979999999999999,\r
+                       "Longitude":177.5871,\r
+                       "Altitude":23,\r
+                       "HAccuracy":1,\r
+                       "VAccuracy":4\r
+               },\r
+               "CategoryInfo":["5"],\r
+               "LandmarkDesc":"Words are not enough to describe this landmark",\r
+               "LandmarkFields":{\r
+                       "Country":"Thailand",\r
+                       "City":"St. Petersburg",\r
+                       "AreaCode":"00310",\r
+                       "Street":"Pukershire Avenue",\r
+                       "Telephone":"0435445454"\r
+               }\r
+       },{\r
+               "id":"41",\r
+               "LandmarkName":"Summer cottage",\r
+               "LandmarkPosition":{\r
+                       "Latitude":-80.6438,\r
+                       "Longitude":78.5627,\r
+                       "Altitude":60,\r
+                       "HAccuracy":1,\r
+                       "VAccuracy":4\r
+               },\r
+               "CategoryInfo":["11"],\r
+               "LandmarkDesc":"Place looks really nice.",\r
+               "LandmarkFields":{\r
+                       "Country":"Thailand",\r
+                       "City":"Havana",\r
+                       "AreaCode":"99002",\r
+                       "Street":"Eastman Street",\r
+                       "Telephone":"+4465665456"\r
+               }\r
+       },{\r
+               "id":"43",\r
+               "LandmarkName":"Summer cottage",\r
+               "LandmarkPosition":{\r
+                       "Latitude":23.6319,\r
+                       "Longitude":-141.5323,\r
+                       "Altitude":60,\r
+                       "HAccuracy":2,\r
+                       "VAccuracy":2\r
+               },\r
+               "CategoryInfo":["1"],\r
+               "LandmarkDesc":"This is my favorite place",\r
+               "LandmarkFields":{\r
+                       "Country":"Norway",\r
+                       "City":"Nairobi",\r
+                       "AreaCode":"FI-70100",\r
+                       "Street":"Windsor Avenue",\r
+                       "Telephone":"0785434444"\r
+               }\r
+       },{\r
+               "id":"46",\r
+               "LandmarkName":"Work place",\r
+               "LandmarkPosition":{\r
+                       "Latitude":1.7755,\r
+                       "Longitude":66.132,\r
+                       "Altitude":36,\r
+                       "HAccuracy":5,\r
+                       "VAccuracy":5\r
+               },\r
+               "CategoryInfo":["3"],\r
+               "LandmarkDesc":"Delicious strawberries sold here. Must visit again sometime!",\r
+               "LandmarkFields":{\r
+                       "Country":"Kenya",\r
+                       "City":"Havana",\r
+                       "AreaCode":"99002",\r
+                       "Street":"Barnes Street",\r
+                       "Telephone":"0342303777"\r
+               }\r
+       }];\r
+       \r
+       \r
+       var data_category =     [{\r
+               "id":"1",\r
+               "CategoryName":"Accommodation",\r
+               "GlobalId":"3000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16384,\r
+               "IconMaskIndex":16385\r
+       },{\r
+\r
+               "id":"2",\r
+               "CategoryName":"Businesses",\r
+               "GlobalId":"6000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16386,\r
+               "IconMaskIndex":16387\r
+       },{\r
+               "id":"3",\r
+               "CategoryName":"Telecommunications",\r
+               "GlobalId":"9000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16388,\r
+               "IconMaskIndex":16389\r
+       },{\r
+               "id":"4",\r
+               "CategoryName":"Education",\r
+               "GlobalId":"12000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16390,\r
+               "IconMaskIndex":16391\r
+       },{\r
+               "id":"5",\r
+               "CategoryName":"Entertainment",\r
+               "GlobalId":"15000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16392,\r
+               "IconMaskIndex":16393\r
+       },{\r
+               "id":"6",\r
+               "CategoryName":"Food and drink",\r
+               "GlobalId":"18000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16394,\r
+               "IconMaskIndex":16395\r
+       },{\r
+               "id":"7",\r
+               "CategoryName":"Geographical locations",\r
+               "GlobalId":"21000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16396,\r
+               "IconMaskIndex":16397\r
+       },{\r
+               "id":"8",\r
+               "CategoryName":"Outdoor activities",\r
+               "GlobalId":"24000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16398,\r
+               "IconMaskIndex":16399\r
+       },{\r
+               "id":"9",\r
+               "CategoryName":"People",\r
+               "GlobalId":"27000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16400,\r
+               "IconMaskIndex":16401\r
+       },{\r
+               "id":"10",\r
+               "CategoryName":"Public services",\r
+               "GlobalId":"30000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16402,\r
+               "IconMaskIndex":16403\r
+       },{\r
+               "id":"11",\r
+               "CategoryName":"Places of worship",\r
+               "GlobalId":"33000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16404,\r
+               "IconMaskIndex":16405\r
+       },{\r
+               "id":"12",\r
+               "CategoryName":"Shopping",\r
+               "GlobalId":"36000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16406,\r
+               "IconMaskIndex":16407\r
+       },{\r
+               "id":"13",\r
+               "CategoryName":"Sightseeing",\r
+               "GlobalId":"39000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16408,\r
+               "IconMaskIndex":16409\r
+       },{\r
+               "id":"14",\r
+               "CategoryName":"Sports",\r
+               "GlobalId":"42000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16410,\r
+               "IconMaskIndex":16411\r
+       },{\r
+               "id":"15",\r
+               "CategoryName":"Transport",\r
+               "GlobalId":"45000",\r
+               "IconFile":"\resource\apps\eposlmglcategories.mif",\r
+               "IconIndex":16412,\r
+               "IconMaskIndex":16413\r
+       },{\r
+               "id":"24",\r
+               "CategoryName":"All places",\r
+               "IconFile":"Z:\resource\apps\smart2go.mif",\r
+               "IconIndex":16384,\r
+               "IconMaskIndex":16385\r
+       },{\r
+               "id":"25",\r
+               "CategoryName":"Nokia maps",\r
+               "IconFile":"Z:\resource\apps\LmkUi.mif",\r
+               "IconIndex":16402,\r
+               "IconMaskIndex":16403\r
+       }];\r
+       \r
+       var data_database =     [{\r
+               "DatabaseURI":"file://C:eposlm.ldb",\r
+               "DatabaseName":"",\r
+               "DbProtocol":"file",\r
+               "DbActive":false,\r
+               "DbSize":226,\r
+               "DbDrive":"C",\r
+               "DbMedia":9\r
+       }]; \r
+\r
+\r
+    /**\r
+     * register data!\r
+     */\r
+    device.implementation.loadData('Service.Landmarks', 'Landmark', data_landmark);\r
+    device.implementation.loadData('Service.Landmarks', 'Category', data_category);\r
+    device.implementation.loadData('Service.Landmarks', 'Database', data_database);\r
+\r
+})()\r
+       
\ No newline at end of file
diff --git a/wrt/zouba/preview/data/location_data.js b/wrt/zouba/preview/data/location_data.js
new file mode 100644 (file)
index 0000000..7543bc9
--- /dev/null
@@ -0,0 +1,39 @@
+/**\r
+ * SAPI Sample Data - Location\r
+ */\r
+\r
+(function(){\r
+\r
+               \r
+var data_basicLocationInformation = {\r
+                       "Longitude":77.694589331833,\r
+                       "Latitude":12.942209068513,\r
+                       "Altitude":836.5\r
+               }\r
+               \r
+var data_genericLocationInfo = {\r
+                       "Longitude":77.694546416505,\r
+                       "Latitude":12.942233711299,\r
+                       "Altitude":836,\r
+                       "HorizontalSpeed":0.05999999865889549,\r
+                       "HorizontalSpeedError":1.0199999809265137,\r
+                       "SatelliteNumView":11,\r
+                       "SatelliteNumViewUsed":7,\r
+                       "Heading":203.89999389648438,\r
+                       "HeadingError":2.89898989898232,\r
+                       "MagneticCourse":205.89999389600000,\r
+                       "MagneticCourseError":1.09090389600000,\r
+                       "TrueCourse":203.89999389648438,\r
+                       "TrueCourseError":2.89898989898232,\r
+                       "MagneticHeading":205.89999389600000,\r
+                       "MagneticHeadingError":1.09090389600000\r
+               }; \r
+\r
+    /**\r
+     * register data!\r
+     */\r
+    device.implementation.loadData('Service.Location', 'BasicLocationInformation', data_basicLocationInformation);\r
+    device.implementation.loadData('Service.Location', 'GenericLocationInfo', data_genericLocationInfo);\r
+\r
+})()\r
+       
\ No newline at end of file
diff --git a/wrt/zouba/preview/data/logging_data.js b/wrt/zouba/preview/data/logging_data.js
new file mode 100644 (file)
index 0000000..b2de1eb
--- /dev/null
@@ -0,0 +1,377 @@
+/**\r
+ * SAPI Sample Data - Logging\r
+ */\r
+\r
+(function(){\r
+\r
+\r
+       var logging_data = [{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":5518,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:42 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"5270443",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"30",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":472,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:42 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"1247463",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"29",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":1914,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:42 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"8759891",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"28",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":3130,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:32 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"3200343",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"27",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":4128,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:32 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"2101692",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"26",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":2012,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:32 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"8813355",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"25",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:24 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"8092875",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"24",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:24 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"3702771",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"23",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:24 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"2680939",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"22",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:11 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"1075503",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"21",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:11 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"9781533",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"20",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:17:11 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"4185107",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"19",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":4,\r
+               "RemoteParty":"Mobile Office",\r
+               "EventDuration":90,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:18:37 am",\r
+               "Subject":"",\r
+               "PhoneNumber":"",\r
+               "Description":"Packet Data",\r
+               "Link":0,\r
+               "id":"18",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":4,\r
+               "RemoteParty":"Mobile Office",\r
+               "EventDuration":80,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:15:30 am",\r
+               "Subject":"",\r
+               "PhoneNumber":"",\r
+               "Description":"Packet Data",\r
+               "Link":0,\r
+               "id":"18",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":4,\r
+               "RemoteParty":"Mobile Office",\r
+               "EventDuration":16,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:12:33 am",\r
+               "Subject":"",\r
+               "PhoneNumber":"",\r
+               "Description":"Packet Data",\r
+               "Link":0,\r
+               "id":"17",\r
+               "Direction":1,\r
+               "EventData":"8303,17570"\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":2998,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:20 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"1716582",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"16",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":681,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:20 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"9888150",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"15",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":2294,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:20 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"8378283",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"14",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":4232,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:19 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"6818380",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"13",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":599,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:19 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"5933409",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"12",\r
+               "Direction":1,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":6376,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:12 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"5487982",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"11",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":6325,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:12 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"2859596",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"10",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":6571,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:12 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"2820138",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"9",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":4929,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:12 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"6356454",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"8",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":2620,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:12 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"4461166",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"7",\r
+               "Direction":0,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:02 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"8811808",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"6",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:02 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"2985843",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"5",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:02 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"9714278",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"4",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:02 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"5044910",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"3",\r
+               "Direction":5,\r
+               "EventData":""\r
+       },{\r
+               "EventType":0,\r
+               "RemoteParty":"",\r
+               "EventDuration":0,\r
+               "EventTime":"Wednesday, 08 April, 2009 11:09:02 am",\r
+               "Subject":"A",\r
+               "PhoneNumber":"6519793",\r
+               "Description":"Voice call",\r
+               "Link":0,\r
+               "id":"2",\r
+               "Direction":5,\r
+               "EventData":""\r
+       }];\r
+\r
+\r
+    /**\r
+     * register data!\r
+     */\r
+    device.implementation.loadData('Service.Logging', 'Log', logging_data);\r
+\r
+})()\r
+       
\ No newline at end of file
diff --git a/wrt/zouba/preview/data/mediaManagement_data.js b/wrt/zouba/preview/data/mediaManagement_data.js
new file mode 100644 (file)
index 0000000..e6abcf9
--- /dev/null
@@ -0,0 +1,233 @@
+/**\r
+ * SAPI Sample Data - MediaManagement\r
+ */\r
+\r
+(function(){\r
+\r
+       var music_data = [{\r
+               "FileNameAndPath":"E:\\Sounds\\Digital\\Album1\\Breathless.mp3",\r
+               "Type":"Media",\r
+               "FileName":"Breathless",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":4552794,\r
+               "Artist":"ABC",\r
+               "SongName":"Breathless",\r
+               "TrackNumber":"1",\r
+               "Album":"Album1",\r
+               "Genre":"Pop",\r
+               "Composer":"XYZ"\r
+       },{\r
+               "FileNameAndPath":"E:\\Sounds\\Digital\\Album1\\New song.mp3",\r
+               "Type":"Media",\r
+               "FileName":"New song",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":1232794,\r
+               "Artist":"ABC",\r
+               "SongName":"New song",\r
+               "TrackNumber":"2",\r
+               "Album":"Album1",\r
+               "Genre":"Pop",\r
+               "Composer":"XYZ"\r
+       },{             \r
+               "FileNameAndPath":"E:\\Sounds\\Digital\\Album1\\Classic song.mp3",\r
+               "Type":"Media",\r
+               "FileName":"Classic song",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":3212794,\r
+               "Artist":"ABC",\r
+               "SongName":"Classic song",\r
+               "TrackNumber":"3",\r
+               "Album":"Album1",\r
+               "Genre":"Pop",\r
+               "Composer":"XYZ"\r
+       },{             \r
+               "FileNameAndPath":"E:\\Sounds\\Digital\\Album1\\Folk sonk.mp3",\r
+               "Type":"Media",\r
+               "FileName":"Folk sonk",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":3412794,\r
+               "Artist":"ABC",\r
+               "SongName":"Folk sonk",\r
+               "TrackNumber":"4",\r
+               "Album":"Album1",\r
+               "Genre":"Pop",\r
+               "Composer":"XYZ"\r
+       },{             \r
+               "FileNameAndPath":"E:\\Sounds\\Digital\\Album1\\National anthem.mp3",\r
+               "Type":"Media",\r
+               "FileName":"National anthem",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":4512794,\r
+               "Artist":"ABC",\r
+               "SongName":"National anthem",\r
+               "TrackNumber":"5",\r
+               "Album":"Album1",\r
+               "Genre":"Pop",\r
+               "Composer":"XYZ"\r
+       },{\r
+               "FileNameAndPath":"E:\\Sounds\\Digital\\Album1\\Dance sequence.mp3",\r
+               "Type":"Media",\r
+               "FileName":"Dance sequence",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":9110000,\r
+               "Artist":"ABC",\r
+               "SongName":"Dance sequence",\r
+               "TrackNumber":"6",\r
+               "Album":"Album1",\r
+               "Genre":"Pop",\r
+               "Composer":"XYZ"\r
+       }];\r
+       \r
+       var sound_data = [{\r
+               "FileNameAndPath":"E:\\Sounds\\Simple\\Dance sequence-old.mp3",\r
+               "Type":"Media",\r
+               "FileName":"Dance sequence-old",\r
+               "FileExtension":".mp3",\r
+               "Drive":"E:",\r
+               "MimeType":"audio/mpeg",\r
+               "MediaType":1,\r
+               "FileDate":"Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize":1002794,\r
+       },{\r
+               "FileNameAndPath": "E:\\Sounds\\Simple\\Rooster.mp3",\r
+               "Type": "Media",\r
+               "FileName": "Rooster",\r
+               "FileExtension": ".mp3",\r
+               "Drive": "E:",\r
+               "MimeType": "audio/mpeg",\r
+               "MediaType": 1,\r
+               "FileDate": "Friday, 13 February, 2009 12:01:24 am",\r
+               "FileSize": 911000,\r
+       \r
+       }];\r
+       var image_data = [{\r
+               "FileNameAndPath":"E:\\IMAGES\\Water.JPG",\r
+               "Type":"Media",\r
+               "FileName":"Water",\r
+               "FileExtension":".JPG",\r
+               "Drive":"E:",\r
+               "MimeType":"image/jpeg",\r
+               "MediaType":3,\r
+               "FileDate":"Monday, 04 August, 2008 8:31:46 pm",\r
+               "FileSize":25275\r
+       },{\r
+               "FileNameAndPath":"E:\\IMAGES\\Beach.JPG",\r
+               "Type":"Media",\r
+               "FileName":"Beach",\r
+               "FileExtension":".JPG",\r
+               "Drive":"E:",\r
+               "MimeType":"image/jpeg",\r
+               "MediaType":3,\r
+               "FileDate":"Wednesday, 28 May, 2008 8:52:16 am",\r
+               "FileSize":35151\r
+       },{\r
+               "FileNameAndPath":"E:\\IMAGES\\CountrySide.jpg",\r
+               "Type":"Media",\r
+               "FileName":"CountrySide",\r
+               "FileExtension":".jpg",\r
+               "Drive":"E:",\r
+               "MimeType":"image/jpeg",\r
+               "MediaType":3,\r
+               "FileDate":"Monday, 24 March, 2008 12:27:32 am",\r
+               "FileSize":44318\r
+       },{\r
+               "FileNameAndPath":"E:\\IMAGES\\CoolBlue.JPG",\r
+               "Type":"Media",\r
+               "FileName":"CoolBlue",\r
+               "FileExtension":".JPG",\r
+               "Drive":"E:",\r
+               "MimeType":"image/jpeg",\r
+               "MediaType":3,\r
+               "FileDate":"Monday, 04 August, 2008 8:31:46 pm",\r
+               "FileSize":25275\r
+       },{\r
+               "FileNameAndPath":"E:\\IMAGES\\Swimming.JPG",\r
+               "Type":"Media",\r
+               "FileName":"Swimming",\r
+               "FileExtension":".JPG",\r
+               "Drive":"E:",\r
+               "MimeType":"image/jpeg",\r
+               "MediaType":3,\r
+               "FileDate":"Wednesday, 28 May, 2008 8:52:16 am",\r
+               "FileSize":35151\r
+       },{\r
+               "FileNameAndPath":"E:\\IMAGES\\Sky.jpg",\r
+               "Type":"Media",\r
+               "FileName":"Sky",\r
+               "FileExtension":".jpg",\r
+               "Drive":"E:",\r
+               "MimeType":"image/jpeg",\r
+               "MediaType":3,\r
+               "FileDate":"Monday, 24 March, 2008 12:27:32 am",\r
+               "FileSize":44318\r
+       }];\r
+\r
+       var video_data = [{\r
+               "FileNameAndPath":"C:\\Data\\Videos\\Inside water.3gp",\r
+               "Type":"Media",\r
+               "FileName":"Inside water",\r
+               "FileExtension":".3gp",\r
+               "Drive":"C:",\r
+               "MimeType":"video/3gpp",\r
+               "MediaType":4,\r
+               "FileDate":"Wednesday, 08 April, 2009 5:04:18 pm",\r
+               "FileSize":1103067\r
+       },{\r
+               "FileNameAndPath":"C:\\Data\\Videos\\Daring.mp4",\r
+               "Type":"Media",\r
+               "FileName":"Daring",\r
+               "FileExtension":".mp4",\r
+               "Drive":"C:",\r
+               "MimeType":"video/mp4",\r
+               "MediaType":4,\r
+               "FileDate":"Wednesday, 08 April, 2009 5:04:18 pm",\r
+               "FileSize":1020200\r
+       },{\r
+               "FileNameAndPath":"C:\\Data\\Videos\\On the train.mp4",\r
+               "Type":"Media",\r
+               "FileName":"On the train",\r
+               "FileExtension":".mp4",\r
+               "Drive":"C:",\r
+               "MimeType":"video/mp4",\r
+               "MediaType":4,\r
+               "FileDate":"Wednesday, 08 April, 2009 5:04:18 pm",\r
+               "FileSize":9090900\r
+       }];\r
+       \r
+       var streaming_data = [{}];      \r
+               \r
+    /**\r
+     * register data!\r
+     */\r
+    device.implementation.loadData('Service.MediaManagement', 'Music', music_data);\r
+    device.implementation.loadData('Service.MediaManagement', 'Sound', sound_data);\r
+    device.implementation.loadData('Service.MediaManagement', 'Image', image_data);\r
+    device.implementation.loadData('Service.MediaManagement', 'Video', video_data);\r
+    device.implementation.loadData('Service.MediaManagement', 'StreamingURL', streaming_data);\r
+\r
+})()\r
+       
\ No newline at end of file
diff --git a/wrt/zouba/preview/data/messaging_data.js b/wrt/zouba/preview/data/messaging_data.js
new file mode 100644 (file)
index 0000000..8598203
--- /dev/null
@@ -0,0 +1,193 @@
+/**\r
+ * SAPI Sample Data - Messaging\r
+ */\r
+\r
+(function(){\r
+\r
+\r
+var data_messaging = [{\r
+               "MessageType": "SMS",\r
+               "Sender": "0435445454",\r
+               "Subject": "Reproduction, transfer, distribu",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:32 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1048980,\r
+               "BodyText": "Reproduction, transfer, distribution or storage of"\r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "+35854553456",\r
+               "Subject": "If you place an order for a prod",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:32 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1048981,\r
+               "BodyText": "If you place an order for a product, request a ser"\r
+       },{\r
+               "MessageType": "SMS",\r
+               "Sender": "+4465655656",\r
+               "Subject": "You also agree that we have no c",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:33 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1048982,\r
+               "BodyText": "You also agree that we have no control over the co"\r
+       \r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "+4443433434",\r
+               "Subject": "We may use this information to r",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:33 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1048983,\r
+               "BodyText": "We may use this information to respond to your req"\r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "0565645455",\r
+               "Subject": "In order to respond to your ques",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:33 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1048984,\r
+               "BodyText": "In order to respond to your questions or manage in"\r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "0231343243",\r
+               "Subject": "We consents to you browsing the ",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:59 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": true,\r
+               "MessageId": 1048985,\r
+               "BodyText": "We consents to you browsing the pages on your computer or printing copies of extracts from these pag"\r
+       },{\r
+               "MessageType": "SMS",\r
+               "Sender": "0545545454",\r
+               "Subject": "If you place an order for a prod",\r
+               "Time": "Wednesday, 01 April, 2009 6:11:59 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": true,\r
+               "MessageId": 1048986,\r
+               "BodyText": "If you place an order for a product, request a service or submit content to this site, we may need t"\r
+       },{\r
+               "MessageType": "unknown",\r
+               "Sender": "Edith",\r
+               "Subject": "You will win the battle, GUARANT",\r
+               "Time": "Wednesday, 01 April, 2009 6:12:22 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": true,\r
+               "MessageId": 1048987\r
+       },{\r
+               "MessageType": "unknown",\r
+               "Sender": "Edith",\r
+               "Subject": "You will win the battle, GUARANT",\r
+               "Time": "Wednesday, 01 April, 2009 6:12:23 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": true,\r
+               "MessageId": 1048989\r
+       },{\r
+               "MessageType": "unknown",\r
+               "Sender": "+4443433434",\r
+               "Subject": "Join us at the OSGi 2003 World C",\r
+               "Time": "Wednesday, 01 April, 2009 6:14:10 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": true,\r
+               "MessageId": 1049013\r
+       },{\r
+               "MessageType": "unknown",\r
+               "Sender": "0231343243",\r
+               "Subject": "Put your subject line here",\r
+               "Time": "Wednesday, 01 April, 2009 6:14:10 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": true,\r
+               "MessageId": 1049014\r
+       },{\r
+               "MessageType": "MMS",\r
+               "Sender": "0455454454",\r
+               "Subject": "A very funny game",\r
+               "Time": "Wednesday, 01 April, 2009 6:16:01 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": true,\r
+               "Unread": true,\r
+               "MessageId": 1049043,\r
+               "BodyText": ""\r
+       },{\r
+               "MessageType": "MMS",\r
+               "Sender": "0542303286",\r
+               "Subject": "Weedmon say: call, we be open 7 ",\r
+               "Time": "Wednesday, 01 April, 2009 6:16:03 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": true,\r
+               "Unread": true,\r
+               "MessageId": 1049044,\r
+               "BodyText": ""\r
+       },{\r
+               "MessageType": "SMS",\r
+               "Sender": "+4465656565",\r
+               "Subject": "In addition, a link to a such si",\r
+               "Time": "Wednesday, 01 April, 2009 6:16:59 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1049045,\r
+               "BodyText": "In addition, a link to a such site does not imply that we endorses the site or the products or servi"\r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "0433032865",\r
+               "Subject": "The contents of these pages are ",\r
+               "Time": "Wednesday, 01 April, 2009 6:16:59 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1049046,\r
+               "BodyText": "The contents of these pages are copyrighted. Any rights not expressly granted herein are reserved. T"\r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "+4465655656",\r
+               "Subject": "We may use this information to r",\r
+               "Time": "Wednesday, 01 April, 2009 6:16:59 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1049047,\r
+               "BodyText": "We may use this information to respond to your requests, or to contact you via mail, e-mail or phone"\r
+       },{ \r
+               "MessageType": "SMS",\r
+               "Sender": "+35876653456",\r
+               "Subject": "The use of press releases and ot",\r
+               "Time": "Wednesday, 01 April, 2009 6:16:59 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1049048,\r
+               "BodyText": "The use of press releases and other documents classified as public is permitted in public communicat"\r
+       },{\r
+               "MessageType": "SMS",\r
+               "Sender": "0530328732",\r
+               "Subject": "The use of press releases and ot",\r
+               "Time": "Wednesday, 01 April, 2009 6:17:00 pm",\r
+               "Priority": "Medium",\r
+               "Attachment": false,\r
+               "Unread": false,\r
+               "MessageId": 1049054,\r
+               "BodyText": "The use of press releases and other documents classified as public is permitted in public communicat"\r
+       }];\r
+\r
+    /**\r
+     * register data!\r
+     */\r
+    device.implementation.loadData('Service.Messaging', 'Inbox', data_messaging);\r
+\r
+})()\r
+       
\ No newline at end of file
diff --git a/wrt/zouba/preview/data/sensor_data.js b/wrt/zouba/preview/data/sensor_data.js
new file mode 100644 (file)
index 0000000..7d53b5c
--- /dev/null
@@ -0,0 +1,469 @@
+/**\r
+ * SAPI Sample Data - Sensor\r
+ */\r
+\r
+(function(){\r
+\r
+var property = {\r
+       "AccelerometerAxis":{\r
+               "Availability":{\r
+                       "PropertyId":"Availability",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":1\r
+                       },\r
+               "ChannelAccuracy":{\r
+                       "PropertyId":"ChannelAccuracy",\r
+                       "PropertyDataType":1,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":10\r
+                       },\r
+               "ChannelDataFormat":\r
+               {\r
+                       "PropertyId":"ChannelDataFormat",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":2\r
+               },\r
+               "ChannelScale":\r
+               {\r
+                       "PropertyId":"ChannelScale",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "ChannelUnit":\r
+               {\r
+                       "PropertyId":"ChannelUnit",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":10\r
+               },\r
+               "ConnectionType":\r
+               {\r
+                       "PropertyId":"ConnectionType",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":1\r
+               },\r
+               "DataRate":\r
+               {\r
+                       "PropertyId":"DataRate",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "Description":\r
+               {\r
+                       "PropertyId":"Description",\r
+                       "PropertyDataType":2,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":"Accelerometer"\r
+               },\r
+               "MeasureRange":\r
+               {\r
+                       "PropertyId":"MeasureRange",\r
+                       "PropertyDataType":1,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "ScaledRange":\r
+               {\r
+                       "PropertyId":"ScaledRange",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":8\r
+               }\r
+       },\r
+       "AccelerometerDoubleTapping":\r
+       {\r
+               "Availability":\r
+               {\r
+                       "PropertyId":"Availability",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":1\r
+               },\r
+               "ChannelAccuracy":\r
+               {\r
+                       "PropertyId":"ChannelAccuracy",\r
+                       "PropertyDataType":1,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":10\r
+               },\r
+               "ChannelDataFormat":\r
+               {\r
+                       "PropertyId":"ChannelDataFormat",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":2\r
+               },\r
+               "ChannelScale":\r
+               {\r
+                       "PropertyId":"ChannelScale",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "ChannelUnit":\r
+               {\r
+                       "PropertyId":"ChannelUnit",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":10\r
+               },\r
+               "ConnectionType":\r
+               {\r
+                       "PropertyId":"ConnectionType",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":1\r
+               },\r
+               "Description":\r
+               {\r
+                       "PropertyId":"Description",\r
+                       "PropertyDataType":2,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":"Accelerometer"\r
+               },\r
+               "MeasureRange":\r
+               {\r
+                       "PropertyId":"MeasureRange",\r
+                       "PropertyDataType":1,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "ScaledRange":\r
+               {\r
+                       "PropertyId":"ScaledRange",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":8\r
+               }\r
+       },\r
+       "Orientation":\r
+       {\r
+               "Availability":\r
+               {\r
+                       "PropertyId":"Availability",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":1\r
+               },\r
+               "DataRate":\r
+               {\r
+                       "PropertyId":"DataRate",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "MeasureRange":\r
+               {\r
+                       "PropertyId":"MeasureRange",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               }\r
+       },\r
+       "Rotation":\r
+       {\r
+               "Availability":\r
+               {\r
+                       "PropertyId":"Availability",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":1\r
+               },\r
+               "ChannelAccuracy":\r
+               {\r
+                       "PropertyId":"ChannelAccuracy",\r
+                       "PropertyDataType":1,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0.041666666666666664\r
+               },\r
+               "DataRate":\r
+               {\r
+                       "PropertyId":"DataRate",\r
+                       "PropertyDataType":0,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":0\r
+               },\r
+               "MeasureRange":\r
+               {\r
+                       "PropertyId":"MeasureRange",\r
+                       "PropertyDataType":1,\r
+                       "ItemIndex":-1,\r
+                       "ReadOnly":true,\r
+                       "PropertyValue":359\r
+               }\r
+       }\r
+};\r
+var data_all =[{\r
+               "ChannelId":7,\r
+               "ContextType":2,\r
+               "Quantity":10,\r
+               "ChannelType":270553214,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":24,\r
+               "ChannelDataTypeId":270553214\r
+               },\r
+               {\r
+               "ChannelId":8,\r
+               "ContextType":2,\r
+               "Quantity":11,\r
+               "ChannelType":270553217,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":16,\r
+               "ChannelDataTypeId":270553215\r
+               },\r
+               {\r
+               "ChannelId":10,\r
+               "ContextType":3,\r
+               "Quantity":12,\r
+               "ChannelType":270553224,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":16,\r
+               "ChannelDataTypeId":270553224\r
+               },\r
+               {\r
+               "ChannelId":11,\r
+               "ContextType":3,\r
+               "Quantity":13,\r
+               "ChannelType":270553225,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":24,\r
+               "ChannelDataTypeId":270553225\r
+               }];\r
+               \r
+var data_accelerometerAxis = [{\r
+               "ChannelId":7,\r
+               "ContextType":2,\r
+               "Quantity":10,\r
+               "ChannelType":270553214,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":24,\r
+               "ChannelDataTypeId":270553214\r
+               }];\r
+               \r
+var data_accelerometerDoubleTapping = [{\r
+               "ChannelId":8,\r
+               "ContextType":2,\r
+               "Quantity":11,\r
+               "ChannelType":270553217,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":16,\r
+               "ChannelDataTypeId":270553215\r
+               }];\r
+               \r
+var data_orientation = [{\r
+               "ChannelId":10,\r
+               "ContextType":3,\r
+               "Quantity":12,\r
+               "ChannelType":270553224,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":16,\r
+               "ChannelDataTypeId":270553224\r
+               }];\r
+               \r
+var data_rotation = [{\r
+               "ChannelId":11,\r
+               "ContextType":3,\r
+               "Quantity":13,\r
+               "ChannelType":270553225,\r
+               "Location":"NoLoc",\r
+               "VendorId":"Nokia",\r
+               "DataItemSize":24,\r
+               "ChannelDataTypeId":270553225\r
+               }];\r
+\r
+\r
+var dataRet_accelerometerAxis = [{\r
+               "DataType":"AxisData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XAxisData":30,\r
+               "YAxisData":30,\r
+               "ZAxisData":30\r
+               },{\r
+               "DataType":"AxisData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XAxisData":35,\r
+               "YAxisData":30,\r
+               "ZAxisData":30\r
+               },{\r
+               "DataType":"AxisData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XAxisData":30,\r
+               "YAxisData":35,\r
+               "ZAxisData":30\r
+               },{\r
+               "DataType":"AxisData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XAxisData":30,\r
+               "YAxisData":30,\r
+               "ZAxisData":35\r
+               },{\r
+               "DataType":"AxisData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XAxisData":40,\r
+               "YAxisData":30,\r
+               "ZAxisData":30\r
+               },{\r
+               "DataType":"AxisData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XAxisData":30,\r
+               "YAxisData":40,\r
+               "ZAxisData":30\r
+               }];\r
+               \r
+var dataRet_accelerometerDoubleTapping = [{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":30\r
+               },{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":40\r
+               },{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":50\r
+               },{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":60\r
+               },{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":70\r
+               },{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":80\r
+               },{\r
+               "DataType":"DoubleTappingData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",            \r
+               "DeviceDirection":90\r
+               }];\r
+               \r
+var dataRet_orientation = [{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"DisplayUp"         \r
+               },{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"DisplayDown"               \r
+               },{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"DisplayLeftUp"             \r
+               },{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"DisplayRightUp"            \r
+               },{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"DisplayUpwards"            \r
+               },{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"DisplayDownwards"          \r
+               },{\r
+               "DataType":"OrientationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "DeviceOrientation":"Undefined"         \r
+               }];\r
+               \r
+var dataRet_rotation = [{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":30,\r
+               "YRotation":35,\r
+               "ZRotation":30\r
+               },{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":35,\r
+               "YRotation":30,\r
+               "ZRotation":30\r
+               },{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":30,\r
+               "YRotation":30,\r
+               "ZRotation":35\r
+               },{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":40,\r
+               "YRotation":30,\r
+               "ZRotation":30\r
+               },{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":30,\r
+               "YRotation":40,\r
+               "ZRotation":30\r
+               },{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":30,\r
+               "YRotation":30,\r
+               "ZRotation":40\r
+               },{\r
+               "DataType":"RotationData",\r
+               "TimeStamp":"Wednesday, 15 April, 2009 12:00:00 am",\r
+               "XRotation":50,\r
+               "YRotation":50,\r
+               "ZRotation":50\r
+               }];\r
+\r
+    /**\r
+     * register data!\r
+     */\r
+       device.implementation.loadData('Service.Sensor','SensorProperty',property);\r
+    device.implementation.loadData('Service.Sensor', 'All', data_all);\r
+    device.implementation.loadData('Service.Sensor', 'AccelerometerAxis', data_accelerometerAxis);\r
+    device.implementation.loadData('Service.Sensor', 'AccelerometerDoubleTapping', data_accelerometerDoubleTapping);\r
+    device.implementation.loadData('Service.Sensor', 'Orientation', data_orientation);\r
+    device.implementation.loadData('Service.Sensor', 'Rotation', data_rotation);\r
+/*    device.implementation.loadData('Service.Sensor', 'AccelerometerAxisRet', dataRet_accelerometerAxis);\r
+    device.implementation.loadData('Service.Sensor', 'AccelerometerDoubleTappingRet', dataRet_accelerometerDoubleTapping);\r
+    device.implementation.loadData('Service.Sensor', 'OrientationRet', dataRet_orientation);\r
+    device.implementation.loadData('Service.Sensor', 'RotationRet', dataRet_rotation);*/\r
+\r
+})()\r
+       
\ No newline at end of file
diff --git a/wrt/zouba/preview/data/sysInfo_data.js b/wrt/zouba/preview/data/sysInfo_data.js
new file mode 100644 (file)
index 0000000..2d15da8
--- /dev/null
@@ -0,0 +1,345 @@
+/**
+ * SAPI Sample Data - SysInfo
+ */
+
+
+(function(){  
+
+var data_5800 = {
+                       "battery":{
+                               "batterystrength":{
+                                       "Status":85,
+                                       "Entity":"Battery",
+                                       "Key":"BatteryStrength"
+                                       },
+                               "chargingstatus":{
+                                       "Status":0,\r
+                                       "Entity":"Battery",\r
+                                       "Key":"ChargingStatus"
+                                       }
+                       },\r
+                       "connectivity":{
+                               "bluetooth":{
+                                       "Status":1,\r
+                                       "Entity":"Connectivity",\r
+                                       "Key":"BlueTooth"
+                                       },\r
+                               "infrared":{
+                                       "Status":-1,\r
+                                       "Entity":"Connectivity",\r
+                                       "Key":"InfraRed"
+                                       },
+                               "activeconnections":{
+                                       "ConnectionList":[{
+                                                               "IAPID":5,
+                                                               "IAPName":"Browser",
+                                                               "IAPConnectionName":"",
+                                                               "NetworkName":"Browser",
+                                                               "ConnectionType":7,
+                                                               "ConnectionStatus":1
+                                                               },{
+                                                               "IAPID":1,
+                                                               "IAPName":"airtelgprs.com",
+                                                               "IAPConnectionName":"Mobile Office",
+                                                               "NetworkName":"GPRS",
+                                                               "ConnectionType":6,
+                                                               "ConnectionStatus":1
+                                                               }],
+                                       "Entity":"Connectivity",
+                                       "Key":"ActiveConnections"
+                               },                                      \r
+                               "wlanmacaddress":{
+                                       "StringData":"00:21:fe:97:c5:27",\r
+                                       "Entity":"Connectivity",\r
+                                       "Key":"WLanMacAddress"
+                                       }
+                       },\r
+                       "device":{
+                               "firmwareversion":{
+                                       "StringData":"V 20.0.012 RnD\n04-03-09\nRM-356\n(c)NMP",\r
+                                       "Entity":"Device",\r
+                                       "Key":"FirmwareVersion"},\r
+                               "platformversion":{
+                                       "MajorVersion":"5",\r
+                                       "MinorVersion":"0",\r
+                                       "Entity":"Device",\r
+                                       "Key":"PlatformVersion"
+                                       },\r
+                               "producttype":{
+                                       "StringData":"RM-356",\r
+                                       "Entity":"Device",\r
+                                       "Key":"ProductType"
+                                       },\r
+                               "manufacturer":{
+                                       "StringData":"Nokia",\r
+                                       "Entity":"Device",\r
+                                       "Key":"Manufacturer"
+                                       },\r
+                               "machineid":{
+                                       "Status":536926806,\r
+                                       "Entity":"Device",\r
+                                       "Key":"MachineId"
+                                       },\r
+                               "phonemodel":{
+                                       "StringData":"5800 XpressMusic",\r
+                                       "Entity":"Device",\r
+                                       "Key":"PhoneModel"
+                                       },\r
+                               "imei":{
+                                       "StringData":"004401102480155",\r
+                                       "Entity":"Device",\r
+                                       "Key":"IMEI"
+                                       }
+                       },\r
+                       "display":{
+                               "brightness":{
+                                       "Status":50,\r
+                                       "Entity":"Display",\r
+                                       "Key":"Brightness"
+                                       },\r
+                               "screensavertimeout":{
+                                       "Status":15,\r
+                                       "Entity":"Display",\r
+                                       "Key":"ScreenSaverTimeout"
+                                       },\r
+                               "keyguardtime":{
+                                       "Status":60,\r
+                                       "Entity":"Display",\r
+                                       "Key":"KeyGuardTime"
+                                       },
+                               "keyguardtime":{
+                                       "Status":60,
+                                       "Entity":"Display",
+                                       "Key":"KeyGuardTime"
+                                       },
+                               "autolocktime":{
+                                       "Status":0,\r
+                                       "Entity":"Display",\r
+                                       "Key":"AutoLockTime"
+                                       },\r
+                               "autolockstatus":{
+                                       "Status":0,\r
+                                       "Entity":"Display",\r
+                                       "Key":"AutoLockStatus"
+                                       },\r
+                               "lighttimeout":{
+                                       "Status":45,\r
+                                       "Entity":"Display",\r
+                                       "Key":"LightTimeout"
+                                       },\r
+                               "displayresolution":{
+                                       "XPixels":640,\r
+                                       "YPixels":360,\r
+                                       "Entity":"Display",\r
+                                       "Key":"DisplayResolution"
+                                       },\r
+                               "displayorientation":{
+                                       "Status":3,\r
+                                       "Entity":"Display",\r
+                                       "Key":"DisplayOrientation"
+                                       },
+                               "wallpaper":{
+                                       "StringData":"C://Data//Others//wallpaper.jpeg",
+                                       "Entity":"Display",
+                                       "Key":"Wallpaper"
+                                       }
+                               
+                       },\r
+                       "features":{
+                               "bluetooth":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"BlueTooth"
+                                       },\r
+                               "infrared":{
+                                       "Status":0,\r
+                                       "Entity":"Features",\r
+                                       "Key":"InfraRed"
+                                       },\r
+                               "camera":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"CAMERA"
+                                       },\r
+                               "memorycard":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"MemoryCard"
+                                       },\r
+                               "fmradio":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"FMRADIO"
+                                       },\r
+                               "qwerty":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"QWERTY"
+                                       },\r
+                               "wlan":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"WLAN"
+                                       },\r
+                               "usb":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"USB"
+                                       },\r
+                               "pen":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"Pen"
+                                       },\r
+                               "led":{
+                                       "Status":0,\r
+                                       "Entity":"Features",\r
+                                       "Key":"LED"
+                                       },\r
+                               "coverui":{
+                                       "Status":0,\r
+                                       "Entity":"Features",\r
+                                       "Key":"CoverUI"
+                                       },\r
+                               "sidevolumekeys":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"SideVolumeKeys"
+                                       },\r
+                               "vibra":{
+                                       "Status":1,\r
+                                       "Entity":"Features",\r
+                                       "Key":"Vibra"
+                                       }
+                       },\r
+                       "general":{
+                               "connectedaccessories":{
+                                       "AccessoryList":[{"AccessoryType":0,"AccessoryState":1}],\r
+                                       "Entity":"General",\r
+                                       "Key":"ConnectedAccessories"
+                                       },
+                               "accessorystatus":{
+                                       "AccessoryInfo":{"AccessoryType":0,"AccessoryState":0},
+                                       "Entity":"General",
+                                       "Key":"AccessoryStatus"
+                                       },
+                               "inputlanguage":{
+                                       "Status":1,\r
+                                       "Entity":"General",\r
+                                       "Key":"InputLanguage"
+                                       },\r
+                               "supportedlanguages":{
+                                       "LanguageList":[1,2,3,5,13,4],\r
+                                       "Entity":"General",\r
+                                       "Key":"SupportedLanguages"
+                                       },\r
+                               "predictivetext":{
+                                       "Status":0,\r
+                                       "Entity":"General",\r
+                                       "Key":"PredictiveText"
+                                       },\r
+                               "vibraactive":{
+                                       "Status":1,\r
+                                       "Entity":"General",\r
+                                       "Key":"VibraActive"
+                                       },\r
+                               "availableusbmodes":{
+                                       "StringList":["PC Suite","Mass storage","Image transfer","Media transfer"],\r
+                                       "Entity":"General",\r
+                                       "Key":"AvailableUSBModes"
+                                       },\r
+                               "activeusbmode":{
+                                       "StringData":"Mass storage",\r
+                                       "Entity":"General",\r
+                                       "Key":"ActiveUSBMode"
+                                       },\r
+                               "flipstatus":{
+                                       "Status":-1,\r
+                                       "Entity":"General",\r
+                                       "Key":"FlipStatus"
+                                       },\r
+                               "gripstatus":{
+                                       "Status":1,\r
+                                       "Entity":"General",\r
+                                       "Key":"GripStatus"
+                                       }
+                       },\r
+                       "memory":{
+                               "listdrives":{
+                                       "DriveList":["C:\\","D:\\","E:\\","Z:\\"],\r
+                                       "Entity":"Memory",\r
+                                       "Key":"ListDrives"
+                                       },\r
+                               "memorycard":{
+                                       "Status":1,\r
+                                       "Entity":"Memory",\r
+                                       "Key":"MemoryCard"
+                                       },
+                               "driveinfo":{
+                                       "Drive": {
+                                                       "C:\\": {
+                                                               "Drive": "C:\\",
+                                                               "CriticalSpace": 131072,
+                                                               "MediaType": 9,
+                                                               "TotalSpace": 90210304,
+                                                               "FreeSpace": 79319040,
+                                                               "DriveName": "",
+                                                               "BatterState": 0
+                                                               },
+                                                       "D:\\": {
+                                                               "Drive": "D:\\",
+                                                               "CriticalSpace": 2700000,
+                                                               "MediaType": 5,
+                                                               "TotalSpace": 52469760,
+                                                               "FreeSpace": 52457472,
+                                                               "DriveName": "",
+                                                               "BatterState": 0
+                                                               },
+                                                       "Z:\\": {
+                                                               "Drive": "Z:\\",
+                                                               "CriticalSpace": 131072,
+                                                               "MediaType": 7,
+                                                               "TotalSpace": 0,
+                                                               "FreeSpace": 0,
+                                                               "DriveName": "RomDrive",
+                                                               "BatterState": 0
+                                                               }
+                                                       },
+                                       "Entity":"Memory",
+                                       "Key":"DriveInfo"
+                                       }
+                       },\r
+                       "network":{
+                               "registrationstatus":{
+                                       "Status":4,\r
+                                       "Entity":"Network",\r
+                                       "Key":"RegistrationStatus"
+                                       },\r
+                               "networkmode":{
+                                       "Status":0,\r
+                                       "Entity":"Network",\r
+                                       "Key":"NetworkMode"
+                                       },
+                               "signalstrength":{
+                                       "Status":61,
+                                       "Entity":"Network",
+                                       "Key":"SignalStrength"
+                                       },
+                               "currentnetwork":{
+                                       "NetworkName":"Airtel",
+                                       "NetworkStatus":1,
+                                       "NetworkMode":1,
+                                       "CountryCode":"404",
+                                       "NetworkCode":"45",
+                                       "LocationStatus":false,
+                                       "Entity":"Network",
+                                       "Key":"CurrentNetwork"
+                                       }
+                       }
+       }; 
+       /**
+        * register data!
+        */
+       device.implementation.loadData('Service.SysInfo', '', data_5800);
+
+})()
diff --git a/wrt/zouba/preview/images/BrowserNotificationBar-Toogle.gif b/wrt/zouba/preview/images/BrowserNotificationBar-Toogle.gif
new file mode 100644 (file)
index 0000000..ebe7f61
Binary files /dev/null and b/wrt/zouba/preview/images/BrowserNotificationBar-Toogle.gif differ
diff --git a/wrt/zouba/preview/images/Gradient0Background.png b/wrt/zouba/preview/images/Gradient0Background.png
new file mode 100644 (file)
index 0000000..4faaeeb
Binary files /dev/null and b/wrt/zouba/preview/images/Gradient0Background.png differ
diff --git a/wrt/zouba/preview/images/IconArea-hover.png b/wrt/zouba/preview/images/IconArea-hover.png
new file mode 100644 (file)
index 0000000..44feae1
Binary files /dev/null and b/wrt/zouba/preview/images/IconArea-hover.png differ
diff --git a/wrt/zouba/preview/images/TransperantImage.png b/wrt/zouba/preview/images/TransperantImage.png
new file mode 100644 (file)
index 0000000..d5cdd1f
Binary files /dev/null and b/wrt/zouba/preview/images/TransperantImage.png differ
diff --git a/wrt/zouba/preview/images/active-orientation-icon.png b/wrt/zouba/preview/images/active-orientation-icon.png
new file mode 100644 (file)
index 0000000..4572534
Binary files /dev/null and b/wrt/zouba/preview/images/active-orientation-icon.png differ
diff --git a/wrt/zouba/preview/images/battery-icon.png b/wrt/zouba/preview/images/battery-icon.png
new file mode 100644 (file)
index 0000000..ba874cd
Binary files /dev/null and b/wrt/zouba/preview/images/battery-icon.png differ
diff --git a/wrt/zouba/preview/images/console-clear-button.png b/wrt/zouba/preview/images/console-clear-button.png
new file mode 100644 (file)
index 0000000..6d84eff
Binary files /dev/null and b/wrt/zouba/preview/images/console-clear-button.png differ
diff --git a/wrt/zouba/preview/images/console-close-icon.png b/wrt/zouba/preview/images/console-close-icon.png
new file mode 100644 (file)
index 0000000..3dd7d85
Binary files /dev/null and b/wrt/zouba/preview/images/console-close-icon.png differ
diff --git a/wrt/zouba/preview/images/console-icon.gif b/wrt/zouba/preview/images/console-icon.gif
new file mode 100644 (file)
index 0000000..b785b3f
Binary files /dev/null and b/wrt/zouba/preview/images/console-icon.gif differ
diff --git a/wrt/zouba/preview/images/console-open-icon.png b/wrt/zouba/preview/images/console-open-icon.png
new file mode 100644 (file)
index 0000000..065e0df
Binary files /dev/null and b/wrt/zouba/preview/images/console-open-icon.png differ
diff --git a/wrt/zouba/preview/images/default-Icon.png b/wrt/zouba/preview/images/default-Icon.png
new file mode 100644 (file)
index 0000000..7225970
Binary files /dev/null and b/wrt/zouba/preview/images/default-Icon.png differ
diff --git a/wrt/zouba/preview/images/device/240x320/Landscape.png b/wrt/zouba/preview/images/device/240x320/Landscape.png
new file mode 100644 (file)
index 0000000..976e906
Binary files /dev/null and b/wrt/zouba/preview/images/device/240x320/Landscape.png differ
diff --git a/wrt/zouba/preview/images/device/240x320/Portrait.png b/wrt/zouba/preview/images/device/240x320/Portrait.png
new file mode 100644 (file)
index 0000000..31de173
Binary files /dev/null and b/wrt/zouba/preview/images/device/240x320/Portrait.png differ
diff --git a/wrt/zouba/preview/images/device/320x240/Landscape.png b/wrt/zouba/preview/images/device/320x240/Landscape.png
new file mode 100644 (file)
index 0000000..162d69d
Binary files /dev/null and b/wrt/zouba/preview/images/device/320x240/Landscape.png differ
diff --git a/wrt/zouba/preview/images/device/320x240/Portrait.png b/wrt/zouba/preview/images/device/320x240/Portrait.png
new file mode 100644 (file)
index 0000000..58dffb7
Binary files /dev/null and b/wrt/zouba/preview/images/device/320x240/Portrait.png differ
diff --git a/wrt/zouba/preview/images/device/360x640/Landscape.png b/wrt/zouba/preview/images/device/360x640/Landscape.png
new file mode 100644 (file)
index 0000000..fbb081e
Binary files /dev/null and b/wrt/zouba/preview/images/device/360x640/Landscape.png differ
diff --git a/wrt/zouba/preview/images/device/360x640/Portrait.png b/wrt/zouba/preview/images/device/360x640/Portrait.png
new file mode 100644 (file)
index 0000000..ba5dfb7
Binary files /dev/null and b/wrt/zouba/preview/images/device/360x640/Portrait.png differ
diff --git a/wrt/zouba/preview/images/device/360x640/hs-landscape.png b/wrt/zouba/preview/images/device/360x640/hs-landscape.png
new file mode 100644 (file)
index 0000000..cb5ae48
Binary files /dev/null and b/wrt/zouba/preview/images/device/360x640/hs-landscape.png differ
diff --git a/wrt/zouba/preview/images/device/360x640/hs-portrait.png b/wrt/zouba/preview/images/device/360x640/hs-portrait.png
new file mode 100644 (file)
index 0000000..7525815
Binary files /dev/null and b/wrt/zouba/preview/images/device/360x640/hs-portrait.png differ
diff --git a/wrt/zouba/preview/images/device/800x352/Landscape.png b/wrt/zouba/preview/images/device/800x352/Landscape.png
new file mode 100644 (file)
index 0000000..afcc45a
Binary files /dev/null and b/wrt/zouba/preview/images/device/800x352/Landscape.png differ
diff --git a/wrt/zouba/preview/images/device/MenuItem-keys-Bg2.png b/wrt/zouba/preview/images/device/MenuItem-keys-Bg2.png
new file mode 100644 (file)
index 0000000..6700144
Binary files /dev/null and b/wrt/zouba/preview/images/device/MenuItem-keys-Bg2.png differ
diff --git a/wrt/zouba/preview/images/device/menuKeys-bg.png b/wrt/zouba/preview/images/device/menuKeys-bg.png
new file mode 100644 (file)
index 0000000..2d74cd8
Binary files /dev/null and b/wrt/zouba/preview/images/device/menuKeys-bg.png differ
diff --git a/wrt/zouba/preview/images/errorIcon.png b/wrt/zouba/preview/images/errorIcon.png
new file mode 100644 (file)
index 0000000..2d75261
Binary files /dev/null and b/wrt/zouba/preview/images/errorIcon.png differ
diff --git a/wrt/zouba/preview/images/gradient-bg.png b/wrt/zouba/preview/images/gradient-bg.png
new file mode 100644 (file)
index 0000000..6a49674
Binary files /dev/null and b/wrt/zouba/preview/images/gradient-bg.png differ
diff --git a/wrt/zouba/preview/images/hs-iframeMask.png b/wrt/zouba/preview/images/hs-iframeMask.png
new file mode 100644 (file)
index 0000000..62f442b
Binary files /dev/null and b/wrt/zouba/preview/images/hs-iframeMask.png differ
diff --git a/wrt/zouba/preview/images/infoIcon.png b/wrt/zouba/preview/images/infoIcon.png
new file mode 100644 (file)
index 0000000..da1e533
Binary files /dev/null and b/wrt/zouba/preview/images/infoIcon.png differ
diff --git a/wrt/zouba/preview/images/memory-icon.png b/wrt/zouba/preview/images/memory-icon.png
new file mode 100644 (file)
index 0000000..bb24123
Binary files /dev/null and b/wrt/zouba/preview/images/memory-icon.png differ
diff --git a/wrt/zouba/preview/images/messaging-icon.png b/wrt/zouba/preview/images/messaging-icon.png
new file mode 100644 (file)
index 0000000..6313849
Binary files /dev/null and b/wrt/zouba/preview/images/messaging-icon.png differ
diff --git a/wrt/zouba/preview/images/normal-orientation-icon.png b/wrt/zouba/preview/images/normal-orientation-icon.png
new file mode 100644 (file)
index 0000000..8582a24
Binary files /dev/null and b/wrt/zouba/preview/images/normal-orientation-icon.png differ
diff --git a/wrt/zouba/preview/images/settings-icon.png b/wrt/zouba/preview/images/settings-icon.png
new file mode 100644 (file)
index 0000000..c7be390
Binary files /dev/null and b/wrt/zouba/preview/images/settings-icon.png differ
diff --git a/wrt/zouba/preview/images/statusBar_240x320.png b/wrt/zouba/preview/images/statusBar_240x320.png
new file mode 100644 (file)
index 0000000..e2f9c03
Binary files /dev/null and b/wrt/zouba/preview/images/statusBar_240x320.png differ
diff --git a/wrt/zouba/preview/images/statusBar_320x240.png b/wrt/zouba/preview/images/statusBar_320x240.png
new file mode 100644 (file)
index 0000000..fb07b18
Binary files /dev/null and b/wrt/zouba/preview/images/statusBar_320x240.png differ
diff --git a/wrt/zouba/preview/images/statusBar_360x640.png b/wrt/zouba/preview/images/statusBar_360x640.png
new file mode 100644 (file)
index 0000000..9694511
Binary files /dev/null and b/wrt/zouba/preview/images/statusBar_360x640.png differ
diff --git a/wrt/zouba/preview/images/statusBar_640x360.png b/wrt/zouba/preview/images/statusBar_640x360.png
new file mode 100644 (file)
index 0000000..4cc3d91
Binary files /dev/null and b/wrt/zouba/preview/images/statusBar_640x360.png differ
diff --git a/wrt/zouba/preview/images/statusBar_800x352.png b/wrt/zouba/preview/images/statusBar_800x352.png
new file mode 100644 (file)
index 0000000..be6d9ca
Binary files /dev/null and b/wrt/zouba/preview/images/statusBar_800x352.png differ
diff --git a/wrt/zouba/preview/images/sub-menu-arrow.png b/wrt/zouba/preview/images/sub-menu-arrow.png
new file mode 100644 (file)
index 0000000..ea3ad91
Binary files /dev/null and b/wrt/zouba/preview/images/sub-menu-arrow.png differ
diff --git a/wrt/zouba/preview/images/th-bg-gradient.png b/wrt/zouba/preview/images/th-bg-gradient.png
new file mode 100644 (file)
index 0000000..8fd0494
Binary files /dev/null and b/wrt/zouba/preview/images/th-bg-gradient.png differ
diff --git a/wrt/zouba/preview/images/warningIcon.png b/wrt/zouba/preview/images/warningIcon.png
new file mode 100644 (file)
index 0000000..de51084
Binary files /dev/null and b/wrt/zouba/preview/images/warningIcon.png differ
diff --git a/wrt/zouba/preview/images/wrt-help-icon.png b/wrt/zouba/preview/images/wrt-help-icon.png
new file mode 100644 (file)
index 0000000..647ecb0
Binary files /dev/null and b/wrt/zouba/preview/images/wrt-help-icon.png differ
diff --git a/wrt/zouba/preview/nopreview.html b/wrt/zouba/preview/nopreview.html
new file mode 100644 (file)
index 0000000..d721fa1
--- /dev/null
@@ -0,0 +1,44 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+<style type="text/css">\r
+body {\r
+       background-image: url(images/Gradient0Background.png);\r
+       background-repeat: repeat-x;\r
+       font-family: "Nokia Sans", "Nokia Sans SemiBold", "Arial Narrow";\r
+       overflow: hidden;\r
+       color: #FFFFFF;\r
+}\r
+div {\r
+       text-align: center;\r
+       padding: 20px;\r
+       margin-top: 50px;\r
+       margin-right: auto;\r
+       margin-left: auto;\r
+       width: 500px;\r
+       font-size: x-large;\r
+       font-weight: normal;\r
+       background-color: #CC3300;\r
+       border-top-width: 2px;\r
+       border-right-width: 2px;\r
+       border-bottom-width: 2px;\r
+       border-left-width: 2px;\r
+       border-top-style: solid;\r
+       border-right-style: solid;\r
+       border-bottom-style: solid;\r
+       border-left-style: solid;\r
+       border-top-color: #FF3300;\r
+       border-right-color: #710000;\r
+       border-bottom-color: #710000;\r
+       border-left-color: #FF3300;\r
+}\r
+strong {\r
+       color: #FFCC00;\r
+}\r
+</style>\r
+</head>\r
+<body>\r
+<div> Widget preview is not available for this file, it is not the <strong>MainHtml</strong> file for the widget.\r
+</div>\r
+</body>\r
+</html>\r
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/000000_40x100_textures_05_inset_soft_25.png b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/000000_40x100_textures_05_inset_soft_25.png
new file mode 100644 (file)
index 0000000..d97a0a6
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/000000_40x100_textures_05_inset_soft_25.png differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png
new file mode 100644 (file)
index 0000000..a7b87eb
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/0078a3_40x100_textures_02_glass_40.png differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_leftright.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_leftright.gif
new file mode 100644 (file)
index 0000000..b26780a
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_leftright.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_updown.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_updown.gif
new file mode 100644 (file)
index 0000000..69eb077
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_arrows_updown.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_close.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_close.gif
new file mode 100644 (file)
index 0000000..ff1ab99
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_close.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_doc.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_doc.gif
new file mode 100644 (file)
index 0000000..26db434
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_doc.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_closed.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_closed.gif
new file mode 100644 (file)
index 0000000..4efed68
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_closed.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_open.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_open.gif
new file mode 100644 (file)
index 0000000..0032ff6
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_folder_open.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_minus.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_minus.gif
new file mode 100644 (file)
index 0000000..6851f39
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_minus.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_plus.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_plus.gif
new file mode 100644 (file)
index 0000000..74ac5cb
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_11x11_icon_plus.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_down.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_down.gif
new file mode 100644 (file)
index 0000000..29c6c70
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_down.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_left.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_left.gif
new file mode 100644 (file)
index 0000000..9f95efa
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_left.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_right.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_right.gif
new file mode 100644 (file)
index 0000000..bc02050
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_right.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_up.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_up.gif
new file mode 100644 (file)
index 0000000..28169eb
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/222222_7x7_arrow_up.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/555555_40x100_textures_02_glass_20.png b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/555555_40x100_textures_02_glass_20.png
new file mode 100644 (file)
index 0000000..ed90c7e
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/555555_40x100_textures_02_glass_20.png differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_leftright.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_leftright.gif
new file mode 100644 (file)
index 0000000..7037706
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_leftright.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_updown.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_updown.gif
new file mode 100644 (file)
index 0000000..cbedced
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_arrows_updown.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_close.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_close.gif
new file mode 100644 (file)
index 0000000..7c35291
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_close.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_doc.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_doc.gif
new file mode 100644 (file)
index 0000000..a7d7712
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_doc.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_closed.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_closed.gif
new file mode 100644 (file)
index 0000000..dcc03f6
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_closed.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_open.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_open.gif
new file mode 100644 (file)
index 0000000..d26dd77
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_folder_open.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_minus.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_minus.gif
new file mode 100644 (file)
index 0000000..575d40b
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_minus.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_plus.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_plus.gif
new file mode 100644 (file)
index 0000000..e47eb96
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_plus.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_resize_se.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_resize_se.gif
new file mode 100644 (file)
index 0000000..bab7e3d
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_11x11_icon_resize_se.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_down.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_down.gif
new file mode 100644 (file)
index 0000000..4e5b7d8
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_down.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_left.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_left.gif
new file mode 100644 (file)
index 0000000..10d6f24
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_left.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_right.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_right.gif
new file mode 100644 (file)
index 0000000..3c14c5a
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_right.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_up.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_up.gif
new file mode 100644 (file)
index 0000000..7806bec
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/cccccc_7x7_arrow_up.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/f58400_40x100_textures_05_inset_soft_30.png b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/f58400_40x100_textures_05_inset_soft_30.png
new file mode 100644 (file)
index 0000000..301f49e
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/f58400_40x100_textures_05_inset_soft_30.png differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_leftright.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_leftright.gif
new file mode 100644 (file)
index 0000000..b23fdec
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_leftright.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_updown.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_updown.gif
new file mode 100644 (file)
index 0000000..71733b7
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_arrows_updown.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_close.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_close.gif
new file mode 100644 (file)
index 0000000..2cdf72f
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_close.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_doc.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_doc.gif
new file mode 100644 (file)
index 0000000..586b716
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_doc.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_closed.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_closed.gif
new file mode 100644 (file)
index 0000000..8e4108e
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_closed.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_open.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_open.gif
new file mode 100644 (file)
index 0000000..5f849a2
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_folder_open.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_minus.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_minus.gif
new file mode 100644 (file)
index 0000000..900461f
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_minus.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_plus.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_plus.gif
new file mode 100644 (file)
index 0000000..5047f3d
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_11x11_icon_plus.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_down.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_down.gif
new file mode 100644 (file)
index 0000000..43b59a1
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_down.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_left.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_left.gif
new file mode 100644 (file)
index 0000000..c501d76
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_left.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_right.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_right.gif
new file mode 100644 (file)
index 0000000..ab14178
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_right.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_up.gif b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_up.gif
new file mode 100644 (file)
index 0000000..957d108
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/ffffff_7x7_arrow_up.gif differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/slider-handle.png b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/slider-handle.png
new file mode 100644 (file)
index 0000000..de7dbbd
Binary files /dev/null and b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/images/slider-handle.png differ
diff --git a/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/ui.all.css b/wrt/zouba/preview/script/jquery-ui/css/ui-darkness/ui.all.css
new file mode 100644 (file)
index 0000000..39b7b79
--- /dev/null
@@ -0,0 +1,630 @@
+/*
+ * jQuery UI screen structure and presentation
+ * This CSS file was generated by ThemeRoller, a Filament Group Project for jQuery UI
+ * Author: Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com
+ * Visit ThemeRoller.com
+*/
+
+/*
+ * Note: If your ThemeRoller settings have a font size set in ems, your components will scale according to their parent element's font size.
+ * As a rule of thumb, set your body's font size to 62.5% to make 1em = 10px.
+ * body {font-size: 62.5%;}
+*/
+
+
+
+/*UI accordion*/
+.ui-accordion {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       font-size: 0.8em;
+       border-bottom: 1px solid #666666;
+}
+.ui-accordion-group {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       border: 1px solid #666666;
+       border-bottom: none;
+}
+.ui-accordion-header {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       cursor: pointer;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+}
+.ui-accordion-header a {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       display: block;
+       font-size: 0.8em;
+       font-weight: bold;
+       text-decoration: none;
+       padding: .5em .5em .5em 1.7em;
+       color: #eeeeee;
+       background: url(images/cccccc_7x7_arrow_right.gif) .5em 50% no-repeat;
+}
+.ui-accordion-header a:hover {
+       background: url(images/ffffff_7x7_arrow_right.gif) .5em 50% no-repeat;
+       color: #ffffff;
+}
+.ui-accordion-header:hover {
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+       color: #ffffff;
+}
+.selected .ui-accordion-header, .selected .ui-accordion-header:hover {
+       background: #f58400 url(images/f58400_40x100_textures_05_inset_soft_30.png) 0 50% repeat-x;
+}
+.selected .ui-accordion-header a, .selected .ui-accordion-header a:hover {
+       color: #ffffff;
+       background: url(images/222222_7x7_arrow_down.gif) .5em 50% no-repeat;
+}
+.ui-accordion-content {
+       background: #000000 url(images/000000_40x100_textures_05_inset_soft_25.png) 0 bottom repeat-x;
+       color: #ffffff;
+       font-size: 0.8em;
+}
+.ui-accordion-content p {
+       padding: 0.8em 1.7em 0.6em;
+}
+
+
+
+
+
+
+/*UI tabs*/
+.ui-tabs-nav {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       font-size: 1.0.8em;
+/*
+       float: left;
+
+*/     position: relative;
+       z-index: 1;
+/*
+       border-right: 1px solid #666666;
+*/
+       bottom: -1px;
+}
+.ui-tabs-nav ul {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+}
+.ui-tabs-nav li {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       float: left;
+       border: 1px solid #666666;
+       border-right: none;
+}
+.ui-tabs-nav li a {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       float: left;
+       font-size: 0.8em;
+       font-weight: bold;
+       text-decoration: none;
+       padding: .5em 1.7em;
+       color: #eeeeee;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+}
+.ui-tabs-nav li a:hover {
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+       color: #ffffff;
+}
+.ui-tabs-nav li.ui-tabs-selected {
+       border-bottom-color: #f58400;
+}
+.ui-tabs-nav li.ui-tabs-selected a, .ui-tabs-nav li.ui-tabs-selected a:hover {
+       background: #f58400 url(images/f58400_40x100_textures_05_inset_soft_30.png) 0 50% repeat-x;
+       color: #ffffff;
+}
+.ui-tabs-panel {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       clear:left;
+       border-top: 1px solid #666666;
+/*
+       background: #000000 url(images/000000_40x100_textures_05_inset_soft_25.png) 0 bottom repeat-x;
+
+*/     color: #ffffff;
+       padding: 15px;  
+       font-size: 1.0.8em;
+}
+.ui-tabs-hide {
+       display: none;/* for accessible hiding: position: absolute; left: -99999999px*/;
+}
+
+
+
+
+
+/*slider*/
+.ui-slider {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       font-size: 1.0.8em;
+       background: #000000 url(images/000000_40x100_textures_05_inset_soft_25.png) 0 bottom repeat-x;
+       border: 1px solid #666666;
+       height: .8em;
+       position: relative;
+}
+.ui-slider-handle {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       position: absolute;
+       z-index: 2;
+       top: -7px;
+/*     width: 1.2em;
+       height: 1.2em;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+       border: 1px solid #666666;
+*/
+       background-image: url(images/slider-handle.png);
+       background-repeat: no-repeat;
+       background-position: 0px 0px;
+       height: 19px;
+       width: 17px;
+}
+.ui-slider-handle:hover {
+       background-position: 0px -19px;
+}
+.ui-slider-handle-active, .ui-slider-handle-active:hover {
+       background-position: 0px -38px;
+}
+.ui-slider-range {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       height: .8em;
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+       position: absolute;
+       border: 1px solid #666666;
+       border-left: 0;
+       border-right: 0;
+       top: -1px;
+       z-index: 1;
+       opacity:.7;
+/*
+       filter:Alpha(Opacity=70);
+
+*/}
+
+
+
+
+
+
+/*dialog*/
+.ui-dialog {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       font-size: 0.9em;
+       background: #000000 url(images/000000_40x100_textures_05_inset_soft_25.png) 0 bottom repeat-x;
+       color: #ffffff;
+       border: 4px solid #666666;
+       position: relative;
+}
+.ui-resizable-handle {
+       position: absolute;
+       font-size: 0.1px;
+       z-index: 99999;
+}
+.ui-resizable .ui-resizable-handle {
+       display: block; 
+}
+body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
+body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
+.ui-resizable-n { 
+       cursor: n-resize; 
+       height: 7px; 
+       width: 100%; 
+       top: -5px; 
+       left: 0px;  
+}
+.ui-resizable-s { 
+       cursor: s-resize; 
+       height: 7px; 
+       width: 100%; 
+       bottom: -5px; 
+       left: 0px; 
+}
+.ui-resizable-e { 
+       cursor: e-resize; 
+       width: 7px; 
+       right: -5px; 
+       top: 0px; 
+       height: 100%; 
+}
+.ui-resizable-w { 
+       cursor: w-resize; 
+       width: 7px; 
+       left: -5px; 
+       top: 0px; 
+       height: 100%;
+}
+.ui-resizable-se { 
+       cursor: se-resize; 
+       width: 13px; 
+       height: 13px; 
+       right: 0px; 
+       bottom: 0px; 
+       background: url(images/cccccc_11x11_icon_resize_se.gif) no-repeat 0 0;
+}
+.ui-resizable-sw { 
+       cursor: sw-resize; 
+       width: 9px; 
+       height: 9px; 
+       left: 0px; 
+       bottom: 0px;  
+}
+.ui-resizable-nw { 
+       cursor: nw-resize; 
+       width: 9px; 
+       height: 9px; 
+       left: 0px; 
+       top: 0px; 
+}
+.ui-resizable-ne { 
+       cursor: ne-resize; 
+       width: 9px; 
+       height: 9px; 
+       right: 0px; 
+       top: 0px; 
+}
+.ui-dialog-titlebar {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       padding: .5em 1.5em .5em 0.8em;
+       color: #eeeeee;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+       border-bottom: 1px solid #666666;
+       font-size: 0.8em;
+       font-weight: bold;
+       position: relative;
+}
+.ui-dialog-title {}
+.ui-dialog-titlebar-close {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       background: url(images/cccccc_11x11_icon_close.gif) 0 0 no-repeat;
+       position: absolute;
+       right: 8px;
+       top: .7em;
+       width: 11px;
+       height: 11px;
+       z-index: 100;
+       cursor: pointer !important;
+}
+.ui-dialog-titlebar-close-hover, .ui-dialog-titlebar-close:hover {
+       background: url(images/ffffff_11x11_icon_close.gif) 0 0 no-repeat;
+}
+.ui-dialog-titlebar-close:active {
+       background: url(images/222222_11x11_icon_close.gif) 0 0 no-repeat;
+}
+.ui-dialog-titlebar-close span {
+       display: none;
+}
+.ui-dialog-content {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       color: #ffffff;
+/*
+       padding: 1.5em 1.7em;   
+*/
+       padding-left: 1px;
+}
+.ui-dialog-buttonpane {
+       position: absolute;
+       bottom: 0;
+       width: 100%;
+       text-align: left;
+       border-top: 1px solid #666666;
+       background: #000000;
+}
+.ui-dialog-buttonpane button {
+       margin: .5em 8px .5em 0;
+       color: #eeeeee;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+       font-size: 0.8em;
+       font-weight: bolder;
+       border: 1px solid #666666;
+       cursor: pointer;
+       padding: .2em .6em .3em .6em;
+       line-height: 1.4em;
+       float: right;
+}
+.ui-dialog-buttonpane button:hover {
+       color: #ffffff;
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+       border: 1px solid #4bd94b;
+}
+.ui-dialog-buttonpane button:active {
+       color: #ffffff;
+       background: #f58400 url(images/f58400_40x100_textures_05_inset_soft_30.png) 0 50% repeat-x;
+       border: 1px solid #ffaf0f;
+}
+/* This file skins dialog */
+.ui-dialog.ui-draggable .ui-dialog-titlebar,
+.ui-dialog.ui-draggable .ui-dialog-titlebar {
+       cursor: move;
+}
+
+
+
+
+
+
+
+/*datepicker*/
+/* Main Style Sheet for jQuery UI date picker */
+.ui-datepicker-div, .ui-datepicker-inline, #ui-datepicker-div {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       background: #000000 url(images/000000_40x100_textures_05_inset_soft_25.png) 0 bottom repeat-x;
+       font-size: 1.0.8em;
+       border: 4px solid #666666;
+       width: 15.5em;
+       padding: 2.5em .5em .5em .5em;
+       position: relative;
+}
+.ui-datepicker-div, #ui-datepicker-div {
+       z-index: 9999; /*must have*/
+       display: none;
+}
+.ui-datepicker-inline {
+       float: left;
+       display: block;
+}
+.ui-datepicker-control {
+       display: none;
+}
+.ui-datepicker-current {
+       display: none;
+}
+.ui-datepicker-next, .ui-datepicker-prev {
+       position: absolute;
+       left: .5em;
+       top: .5em;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+}
+.ui-datepicker-next {
+       left: 14.6em;
+}
+.ui-datepicker-next:hover, .ui-datepicker-prev:hover {
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+}
+.ui-datepicker-next a, .ui-datepicker-prev a {
+       text-indent: -999999px;
+       width: 1.3em;
+       height: 1.4em;
+       display: block;
+       font-size: 0.8em;
+       background: url(images/cccccc_7x7_arrow_left.gif) 50% 50% no-repeat;
+       border: 1px solid #666666;
+       cursor: pointer;
+}
+.ui-datepicker-next a {
+       background: url(images/cccccc_7x7_arrow_right.gif) 50% 50% no-repeat;
+}
+.ui-datepicker-prev a:hover {
+       background: url(images/ffffff_7x7_arrow_left.gif) 50% 50% no-repeat;
+}
+.ui-datepicker-next a:hover {
+       background: url(images/ffffff_7x7_arrow_right.gif) 50% 50% no-repeat;
+}
+.ui-datepicker-prev a:active {
+       background: url(images/222222_7x7_arrow_left.gif) 50% 50% no-repeat;
+}
+.ui-datepicker-next a:active {
+       background: url(images/222222_7x7_arrow_right.gif) 50% 50% no-repeat;
+}
+.ui-datepicker-header select {
+       border: 1px solid #666666;
+       color: #eeeeee;
+       background: #555555;
+       font-size: 0.8em;
+       line-height: 1.4em;
+       position: absolute;
+       top: .5em;
+       margin: 0 !important;
+}
+.ui-datepicker-header option:focus, .ui-datepicker-header option:hover {
+       background: #0078a3;
+}
+.ui-datepicker-header select.ui-datepicker-new-month {
+       width: 7em;
+       left: 2.2em;
+}
+.ui-datepicker-header select.ui-datepicker-new-year {
+       width: 5em;
+       left: 9.4em;
+}
+table.ui-datepicker {
+       width: 15.5em;
+       text-align: right;
+}
+table.ui-datepicker td a {
+       padding: .0.8em .3em .0.8em 0;
+       display: block;
+       color: #eeeeee;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+       cursor: pointer;
+       border: 1px solid #000000;
+}
+table.ui-datepicker td a:hover {
+       border: 1px solid #4bd94b;
+       color: #ffffff;
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+}
+table.ui-datepicker td a:active {
+       border: 1px solid #ffaf0f;
+       color: #ffffff;
+       background: #f58400 url(images/f58400_40x100_textures_05_inset_soft_30.png) 0 50% repeat-x;
+}
+table.ui-datepicker .ui-datepicker-title-row td {
+       padding: .3em 0;
+       text-align: center;
+       font-size: .9em;
+       color: #ffffff;
+       text-transform: uppercase;
+}
+table.ui-datepicker .ui-datepicker-title-row td a {
+       color: #ffffff;
+}
+.ui-datepicker-cover {
+       display: none;
+       display: block;
+       position: absolute;
+       z-index: -1;
+/*
+       filter: mask();
+
+*/     top: -4px;
+       left: -4px;
+       width: 193px;
+       height: 200px;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/*
+Generic ThemeRoller Classes
+>> Make your jQuery Components ThemeRoller-Compatible!
+*/
+
+/*component global class*/
+.ui-component {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+       font-family: Segoe UI, Arial, sans-serif;
+       font-size: 1.0.8em;
+}
+/*component content styles*/
+.ui-component-content {
+       border: 1px solid #666666;
+       background: #000000 url(images/000000_40x100_textures_05_inset_soft_25.png) 0 bottom repeat-x;
+       color: #ffffff;
+}
+.ui-component-content a {
+       color: #ffffff;
+       text-decoration: underline;
+}
+/*component states*/
+.ui-default-state {
+       border: 1px solid #666666;
+       background: #555555 url(images/555555_40x100_textures_02_glass_20.png) 0 50% repeat-x;
+       font-weight: bold;
+       color: #eeeeee !important;
+}
+.ui-default-state a {
+       color: #eeeeee;
+}
+.ui-default-state:hover, .ui-hover-state {
+       border: 1px solid #4bd94b;
+       background: #0078a3 url(images/0078a3_40x100_textures_02_glass_40.png) 0 50% repeat-x;
+       font-weight: bold;
+       color: #ffffff !important;
+}
+.ui-hover-state a {
+       color: #ffffff;
+}
+.ui-default-state:active, .ui-active-state {
+       border: 1px solid #ffaf0f;
+       background: #f58400 url(images/f58400_40x100_textures_05_inset_soft_30.png) 0 50% repeat-x;
+       font-weight: bold;
+       color: #ffffff !important;
+       outline: none;
+}
+.ui-active-state a {
+       color: #ffffff;
+       outline: none;
+}
+/*icons*/
+.ui-arrow-right-default {background: url(images/cccccc_7x7_arrow_right.gif) no-repeat 50% 50%;}
+.ui-arrow-right-default:hover, .ui-arrow-right-hover {background: url(images/ffffff_7x7_arrow_right.gif) no-repeat 50% 50%;}
+.ui-arrow-right-default:active, .ui-arrow-right-active {background: url(images/222222_7x7_arrow_right.gif) no-repeat 50% 50%;}
+.ui-arrow-right-content {background: url(images/cccccc_7x7_arrow_right.gif) no-repeat 50% 50%;}
+
+.ui-arrow-left-default {background: url(images/cccccc_7x7_arrow_left.gif) no-repeat 50% 50%;}
+.ui-arrow-left-default:hover, .ui-arrow-left-hover {background: url(images/ffffff_7x7_arrow_left.gif) no-repeat 50% 50%;}
+.ui-arrow-left-default:active, .ui-arrow-left-active {background: url(images/222222_7x7_arrow_left.gif) no-repeat 50% 50%;}
+.ui-arrow-left-content {background: url(images/cccccc_7x7_arrow_left.gif) no-repeat 50% 50%;}
+
+.ui-arrow-down-default {background: url(images/cccccc_7x7_arrow_down.gif) no-repeat 50% 50%;}
+.ui-arrow-down-default:hover, .ui-arrow-down-hover {background: url(images/ffffff_7x7_arrow_down.gif) no-repeat 50% 50%;}
+.ui-arrow-down-default:active, .ui-arrow-down-active {background: url(images/222222_7x7_arrow_down.gif) no-repeat 50% 50%;}
+.ui-arrow-down-content {background: url(images/cccccc_7x7_arrow_down.gif) no-repeat 50% 50%;}
+
+.ui-arrow-up-default {background: url(images/cccccc_7x7_arrow_up.gif) no-repeat 50% 50%;}
+.ui-arrow-up-default:hover, .ui-arrow-up-hover {background: url(images/ffffff_7x7_arrow_up.gif) no-repeat 50% 50%;}
+.ui-arrow-up-default:active, .ui-arrow-up-active {background: url(images/222222_7x7_arrow_up.gif) no-repeat 50% 50%;}
+.ui-arrow-up-content {background: url(images/cccccc_7x7_arrow_up.gif) no-repeat 50% 50%;}
+
+.ui-close-default {background: url(images/cccccc_11x11_icon_close.gif) no-repeat 50% 50%;}
+.ui-close-default:hover, .ui-close-hover {background: url(images/ffffff_11x11_icon_close.gif) no-repeat 50% 50%;}
+.ui-close-default:active, .ui-close-active {background: url(images/222222_11x11_icon_close.gif) no-repeat 50% 50%;}
+.ui-close-content {background: url(images/222222_11x11_icon_close.gif) no-repeat 50% 50%;}
+
+.ui-folder-closed-default {background: url(images/cccccc_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
+.ui-folder-closed-default:hover, .ui-folder-closed-hover {background: url(images/ffffff_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
+.ui-folder-closed-default:active, .ui-folder-closed-active {background: url(images/222222_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
+.ui-folder-closed-content {background: url(images/cccccc_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
+
+.ui-folder-open-default {background: url(images/cccccc_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
+.ui-folder-open-default:hover, .ui-folder-open-hover {background: url(images/ffffff_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
+.ui-folder-open-default:active, .ui-folder-open-active {background: url(images/222222_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
+.ui-folder-open-content {background: url(images/222222_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
+
+.ui-doc-default {background: url(images/cccccc_11x11_icon_doc.gif) no-repeat 50% 50%;}
+.ui-doc-default:hover, .ui-doc-hover {background: url(images/ffffff_11x11_icon_doc.gif) no-repeat 50% 50%;}
+.ui-doc-default:active, .ui-doc-active {background: url(images/222222_11x11_icon_doc.gif) no-repeat 50% 50%;}
+.ui-doc-content {background: url(images/cccccc_11x11_icon_doc.gif) no-repeat 50% 50%;}
+
+.ui-arrows-leftright-default {background: url(images/cccccc_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
+.ui-arrows-leftright-default:hover, .ui-arrows-leftright-hover {background: url(images/ffffff_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
+.ui-arrows-leftright-default:active, .ui-arrows-leftright-active {background: url(images/222222_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
+.ui-arrows-leftright-content {background: url(images/cccccc_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
+
+.ui-arrows-updown-default {background: url(images/cccccc_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
+.ui-arrows-updown-default:hover, .ui-arrows-updown-hover {background: url(images/ffffff_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
+.ui-arrows-updown-default:active, .ui-arrows-updown-active {background: url(images/222222_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
+.ui-arrows-updown-content {background: url(images/cccccc_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
+
+.ui-minus-default {background: url(images/cccccc_11x11_icon_minus.gif) no-repeat 50% 50%;}
+.ui-minus-default:hover, .ui-minus-hover {background: url(images/ffffff_11x11_icon_minus.gif) no-repeat 50% 50%;}
+.ui-minus-default:active, .ui-minus-active {background: url(images/222222_11x11_icon_minus.gif) no-repeat 50% 50%;}
+.ui-minus-content {background: url(images/cccccc_11x11_icon_minus.gif) no-repeat 50% 50%;}
+
+.ui-plus-default {background: url(images/cccccc_11x11_icon_plus.gif) no-repeat 50% 50%;}
+.ui-plus-default:hover, .ui-plus-hover {background: url(images/ffffff_11x11_icon_plus.gif) no-repeat 50% 50%;}
+.ui-plus-default:active, .ui-plus-active {background: url(images/222222_11x11_icon_plus.gif) no-repeat 50% 50%;}
+.ui-plus-content {background: url(images/cccccc_11x11_icon_plus.gif) no-repeat 50% 50%;}
+
+/*hidden elements*/
+.ui-hidden {
+       display: none;/* for accessible hiding: position: absolute; left: -99999999px*/;
+}
+.ui-accessible-hidden {
+        position: absolute; left: -99999999px;
+}
+/*reset styles*/
+.ui-reset {
+       /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
+}
+/*clearfix class*/
+.ui-clearfix:after {
+    content: "."; 
+    display: block; 
+    height: 0; 
+    clear: both; 
+    visibility: hidden;
+}
+.ui-clearfix {display: block;}
+/* Hides from IE-mac \*/
+* html .ui-clearfix {height: 1%;}
+.ui-clearfix {display: block;}
+/* End hide from IE-mac */
+
+/* Note: for resizable styles, use the styles listed above in the dialog section */
+
+
diff --git a/wrt/zouba/preview/script/jquery-ui/js/jquery-1.2.6.min.js b/wrt/zouba/preview/script/jquery-ui/js/jquery-1.2.6.min.js
new file mode 100644 (file)
index 0000000..82b98e1
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * jQuery 1.2.6 - New Wave Javascript
+ *
+ * Copyright (c) 2008 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
+ * $Rev: 5685 $
+ */
+(function(){var _jQuery=window.jQuery,_$=window.$;var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);};var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;if(selector.nodeType){this[0]=selector;this.length=1;return this;}if(typeof selector=="string"){var match=quickExpr.exec(selector);if(match&&(match[1]||!context)){if(match[1])selector=jQuery.clean([match[1]],context);else{var elem=document.getElementById(match[3]);if(elem){if(elem.id!=match[3])return jQuery().find(selector);return jQuery(elem);}selector=[];}}else
+return jQuery(context).find(selector);}else if(jQuery.isFunction(selector))return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);return this.setArray(jQuery.makeArray(selector));},jquery:"1.2.6",size:function(){return this.length;},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];},pushStack:function(elems){var ret=jQuery(elems);ret.prevObject=this;return ret;},setArray:function(elems){this.length=0;Array.prototype.push.apply(this,elems);return this;},each:function(callback,args){return jQuery.each(this,callback,args);},index:function(elem){var ret=-1;return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);},attr:function(name,value,type){var options=name;if(name.constructor==String)if(value===undefined)return this[0]&&jQuery[type||"attr"](this[0],name);else{options={};options[name]=value;}return this.each(function(i){for(name in options)jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));});},css:function(key,value){if((key=='width'||key=='height')&&parseFloat(value)<0)value=undefined;return this.attr(key,value,"curCSS");},text:function(text){if(typeof text!="object"&&text!=null)return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));var ret="";jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8)ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);});});return ret;},wrapAll:function(html){if(this[0])jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;while(elem.firstChild)elem=elem.firstChild;return elem;}).append(this);return this;},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);});},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);});},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1)this.appendChild(elem);});},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1)this.insertBefore(elem,this.firstChild);});},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);});},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);});},end:function(){return this.prevObject||jQuery([]);},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);});return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");container.appendChild(clone);return jQuery.clean([container.innerHTML])[0];}else
+return this.cloneNode(true);});var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined)this[expando]=null;});if(events===true)this.find("*").andSelf().each(function(i){if(this.nodeType==3)return;var events=jQuery.data(this,"events");for(var type in events)for(var handler in events[type])jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);});return ret;},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);})||jQuery.multiFilter(selector,this));},not:function(selector){if(selector.constructor==String)if(isSimple.test(selector))return this.pushStack(jQuery.multiFilter(selector,this,true));else
+selector=jQuery.multiFilter(selector,this);var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;});},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=='string'?jQuery(selector):jQuery.makeArray(selector))));},is:function(selector){return!!selector&&jQuery.multiFilter(selector,this).length>0;},hasClass:function(selector){return this.is("."+selector);},val:function(value){if(value==undefined){if(this.length){var elem=this[0];if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";if(index<0)return null;for(var i=one?index:0,max=one?index+1:options.length;i<max;i++){var option=options[i];if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;if(one)return value;values.push(value);}}return values;}else
+return(this[0].value||"").replace(/\r/g,"");}return undefined;}if(value.constructor==Number)value+='';return this.each(function(){if(this.nodeType!=1)return;if(value.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);else if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);});if(!values.length)this.selectedIndex=-1;}else
+this.value=value;});},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);},replaceWith:function(value){return this.after(value).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},data:function(key,value){var parts=key.split(".");parts[1]=parts[1]?"."+parts[1]:"";if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);if(data===undefined&&this.length)data=jQuery.data(this[0],key);return data===undefined&&parts[1]?this.data(parts[0]):data;}else
+return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);});},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);});},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);if(reverse)elems.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));var scripts=jQuery([]);jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;if(jQuery.nodeName(elem,"script"))scripts=scripts.add(elem);else{if(elem.nodeType==1)scripts=scripts.add(jQuery("script",elem).remove());callback.call(obj,elem);}});scripts.each(evalScript);});}};jQuery.fn.init.prototype=jQuery.fn;function evalScript(i,elem){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
+jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}function now(){return+new Date;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};i=2;}if(typeof target!="object"&&typeof target!="function")target={};if(length==i){target=this;--i;}for(;i<length;i++)if((options=arguments[i])!=null)for(var name in options){var src=target[name],copy=options[name];if(target===copy)continue;if(deep&&copy&&typeof copy=="object"&&!copy.nodeType)target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);else if(copy!==undefined)target[name]=copy;}return target;};var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");script.type="text/javascript";if(jQuery.browser.msie)script.text=data;else
+script.appendChild(document.createTextNode(data));head.insertBefore(script,head.firstChild);head.removeChild(script);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!==undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?windowData:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(object,callback,args){var name,i=0,length=object.length;if(args){if(length==undefined){for(name in object)if(callback.apply(object[name],args)===false)break;}else
+for(;i<length;)if(callback.apply(object[i++],args)===false)break;}else{if(length==undefined){for(name in object)if(callback.call(object[name],name,object[name])===false)break;}else
+for(var value=object[0];i<length&&callback.call(value,i,value)!==false;value=object[++i]){}}return object;},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value))value=value.call(elem,i);return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className))elem.className+=(elem.className?" ":"")+className;});},remove:function(elem,classNames){if(elem.nodeType==1)elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return!jQuery.className.has(classNames,className);}).join(" "):"";},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;}},swap:function(elem,options,callback){var old={};for(var name in options){old[name]=elem.style[name];elem.style[name]=options[name];}callback.call(elem);for(var name in options)elem.style[name]=old[name];},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;var padding=0,border=0;jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});val-=Math.round(padding+border);}if(jQuery(elem).is(":visible"))getWH();else
+jQuery.swap(elem,props,getWH);return Math.max(0,val);}return jQuery.curCSS(elem,name,force);},curCSS:function(elem,name,force){var ret,style=elem.style;function color(elem){if(!jQuery.browser.safari)return false;var ret=defaultView.getComputedStyle(elem,null);return!ret||ret.getPropertyValue("color")=="";}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");return ret==""?"1":ret;}if(jQuery.browser.opera&&name=="display"){var save=style.outline;style.outline="0 solid black";style.outline=save;}if(name.match(/float/i))name=styleFloat;if(!force&&style&&style[name])ret=style[name];else if(defaultView.getComputedStyle){if(name.match(/float/i))name="float";name=name.replace(/([A-Z])/g,"-$1").toLowerCase();var computedStyle=defaultView.getComputedStyle(elem,null);if(computedStyle&&!color(elem))ret=computedStyle.getPropertyValue(name);else{var swap=[],stack=[],a=elem,i=0;for(;a&&color(a);a=a.parentNode)stack.unshift(a);for(;i<stack.length;i++)if(color(stack[i])){swap[i]=stack[i].style.display;stack[i].style.display="block";}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";for(i=0;i<swap.length;i++)if(swap[i]!=null)stack[i].style.display=swap[i];}if(name=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();});ret=elem.currentStyle[name]||elem.currentStyle[camelCase];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;style.left=ret||0;ret=style.pixelLeft+"px";style.left=left;elem.runtimeStyle.left=rsLeft;}}return ret;},clean:function(elems,context){var ret=[];context=context||document;if(typeof context.createElement=='undefined')context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;jQuery.each(elems,function(i,elem){if(!elem)return;if(elem.constructor==Number)elem+='';if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";});var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];div.innerHTML=wrap[1]+elem+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];for(var j=tbody.length-1;j>=0;--j)if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length)tbody[j].parentNode.removeChild(tbody[j]);if(/^\s/.test(elem))div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);}elem=jQuery.makeArray(div.childNodes);}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select")))return;if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options)ret.push(elem);else
+ret=jQuery.merge(ret,elem);});return ret;},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8)return undefined;var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;name=notxml&&jQuery.props[name]||name;if(elem.tagName){var special=/href|src|style/.test(name);if(name=="selected"&&jQuery.browser.safari)elem.parentNode.selectedIndex;if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode)throw"type property can't be changed";elem[name]=value;}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name))return elem.getAttributeNode(name).nodeValue;return elem[name];}if(msie&&notxml&&name=="style")return jQuery.attr(elem.style,"cssText",value);if(set)elem.setAttribute(name,""+value);var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);return attr===null?undefined:attr;}if(msie&&name=="opacity"){if(set){elem.zoom=1;elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+''=="NaN"?"":"alpha(opacity="+value*100+")");}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+'':"";}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();});if(set)elem[name]=value;return elem[name];},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");},makeArray:function(array){var ret=[];if(array!=null){var i=array.length;if(i==null||array.split||array.setInterval||array.call)ret[0]=array;else
+while(i)ret[--i]=array[i];}return ret;},inArray:function(elem,array){for(var i=0,length=array.length;i<length;i++)if(array[i]===elem)return i;return-1;},merge:function(first,second){var i=0,elem,pos=first.length;if(jQuery.browser.msie){while(elem=second[i++])if(elem.nodeType!=8)first[pos++]=elem;}else
+while(elem=second[i++])first[pos++]=elem;return first;},unique:function(array){var ret=[],done={};try{for(var i=0,length=array.length;i<length;i++){var id=jQuery.data(array[i]);if(!done[id]){done[id]=true;ret.push(array[i]);}}}catch(e){ret=array;}return ret;},grep:function(elems,callback,inv){var ret=[];for(var i=0,length=elems.length;i<length;i++)if(!inv!=!callback(elems[i],i))ret.push(elems[i]);return ret;},map:function(elems,callback){var ret=[];for(var i=0,length=elems.length;i<length;i++){var value=callback(elems[i],i);if(value!=null)ret[ret.length]=value;}return ret.concat.apply([],ret);}});var userAgent=navigator.userAgent.toLowerCase();jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});jQuery.each({parent:function(elem){return elem.parentNode;},parents:function(elem){return jQuery.dir(elem,"parentNode");},next:function(elem){return jQuery.nth(elem,2,"nextSibling");},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},children:function(elem){return jQuery.sibling(elem.firstChild);},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);if(selector&&typeof selector=="string")ret=jQuery.multiFilter(selector,ret);return this.pushStack(jQuery.unique(ret));};});jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;return this.each(function(){for(var i=0,length=args.length;i<length;i++)jQuery(args[i])[original](this);});};});jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");if(this.nodeType==1)this.removeAttribute(name);},addClass:function(classNames){jQuery.className.add(this,classNames);},removeClass:function(classNames){jQuery.className.remove(this,classNames);},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);jQuery.removeData(this);});if(this.parentNode)this.parentNode.removeChild(this);}},empty:function(){jQuery(">*",this).remove();while(this.firstChild)this.removeChild(this.firstChild);}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);};});jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");};});function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},"#":function(a,i,m){return a.getAttribute("id")==m[2];},":":{lt:function(a,i,m){return i<m[3]-0;},gt:function(a,i,m){return i>m[3]-0;},nth:function(a,i,m){return m[3]-0==i;},eq:function(a,i,m){return m[3]-0==i;},first:function(a,i){return i==0;},last:function(a,i,m,r){return i==r.length-1;},even:function(a,i){return i%2==0;},odd:function(a,i){return i%2;},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},"only-child":function(a){return!jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},parent:function(a){return a.firstChild;},empty:function(a){return!a.firstChild;},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},enabled:function(a){return!a.disabled;},disabled:function(a){return a.disabled;},checked:function(a){return a.checked;},selected:function(a){return a.selected||jQuery.attr(a,"selected");},text:function(a){return"text"==a.type;},radio:function(a){return"radio"==a.type;},checkbox:function(a){return"checkbox"==a.type;},file:function(a){return"file"==a.type;},password:function(a){return"password"==a.type;},submit:function(a){return"submit"==a.type;},image:function(a){return"image"==a.type;},reset:function(a){return"reset"==a.type;},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);},has:function(a,i,m){return jQuery.find(m[3],a).length;},header:function(a){return/h\d/i.test(a.nodeName);},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQuery.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQuery.merge(cur,f.r);}return cur;},find:function(t,context){if(typeof t!="string")return[t];if(context&&context.nodeType!=1&&context.nodeType!=9)return[];context=context||document;var ret=[context],done=[],last,nodeName;while(t&&last!=t){var r=[];last=t;t=jQuery.trim(t);var foundToken=false,re=quickChild,m=re.exec(t);if(m){nodeName=m[1].toUpperCase();for(var i=0;ret[i];i++)for(var c=ret[i].firstChild;c;c=c.nextSibling)if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName))r.push(c);ret=r;t=t.replace(re,"");if(t.indexOf(" ")==0)continue;foundToken=true;}else{re=/^([>+~])\s*(\w*)/i;if((m=re.exec(t))!=null){r=[];var merge={};nodeName=m[2].toUpperCase();m=m[1];for(var j=0,rl=ret.length;j<rl;j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;for(;n;n=n.nextSibling)if(n.nodeType==1){var id=jQuery.data(n);if(m=="~"&&merge[id])break;if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~")merge[id]=true;r.push(n);}if(m=="+")break;}}ret=r;t=jQuery.trim(t.replace(re,""));foundToken=true;}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0])ret.shift();done=jQuery.merge(done,ret);r=ret=[context];t=" "+t.substr(1,t.length);}else{var re2=quickID;var m=re2.exec(t);if(m){m=[0,m[2],m[3],m[1]];}else{re2=quickClass;m=re2.exec(t);}m[2]=m[2].replace(/\\/g,"");var elem=ret[ret.length-1];if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2])oid=jQuery('[@id="'+m[2]+'"]',elem)[0];ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];}else{for(var i=0;ret[i];i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object")tag="param";r=jQuery.merge(r,ret[i].getElementsByTagName(tag));}if(m[1]==".")r=jQuery.classFilter(r,m[2]);if(m[1]=="#"){var tmp=[];for(var i=0;r[i];i++)if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];break;}r=tmp;}ret=r;}t=t.replace(re2,"");}}if(t){var val=jQuery.filter(t,r);ret=r=val.r;t=jQuery.trim(val.t);}}if(t)ret=[];if(ret&&context==ret[0])ret.shift();done=jQuery.merge(done,ret);return done;},classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQuery.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g,"");break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);else if(m[1]==".")r=jQuery.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQuery.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==0){if(node.nodeIndex==last)add=true;}else if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var fn=jQuery.expr[m[1]];if(typeof fn=="object")fn=fn[m[2]];if(typeof fn=="string")fn=eval("false||function(a,i){return "+fn+";}");r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);},not);}}return{r:r,t:t};},dir:function(elem,dir){var matched=[],cur=elem[dir];while(cur&&cur!=document){if(cur.nodeType==1)matched.push(cur);cur=cur[dir];}return matched;},nth:function(cur,result,dir,elem){result=result||1;var num=0;for(;cur;cur=cur[dir])if(cur.nodeType==1&&++num==result)break;return cur;},sibling:function(n,elem){var r=[];for(;n;n=n.nextSibling){if(n.nodeType==1&&n!=elem)r.push(n);}return r;}});jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8)return;if(jQuery.browser.msie&&elem.setInterval)elem=window;if(!handler.guid)handler.guid=this.guid++;if(data!=undefined){var fn=handler;handler=this.proxy(fn,function(){return fn.apply(this,arguments);});handler.data=data;}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered)return jQuery.event.handle.apply(arguments.callee.elem,arguments);});handle.elem=elem;jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];handler.type=parts[1];var handlers=events[type];if(!handlers){handlers=events[type]={};if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener)elem.addEventListener(type,handle,false);else if(elem.attachEvent)elem.attachEvent("on"+type,handle);}}handlers[handler.guid]=handler;jQuery.event.global[type]=true;});elem=null;},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8)return;var events=jQuery.data(elem,"events"),ret,index;if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)=="."))for(var type in events)this.remove(elem,type+(types||""));else{if(types.type){handler=types.handler;types=types.type;}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");type=parts[0];if(events[type]){if(handler)delete events[type][handler.guid];else
+for(handler in events[type])if(!parts[1]||events[type][handler].type==parts[1])delete events[type][handler];for(ret in events[type])break;if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener)elem.removeEventListener(type,jQuery.data(elem,"handle"),false);else if(elem.detachEvent)elem.detachEvent("on"+type,jQuery.data(elem,"handle"));}ret=null;delete events[type];}}});}for(ret in events)break;if(!ret){var handle=jQuery.data(elem,"handle");if(handle)handle.elem=null;jQuery.removeData(elem,"events");jQuery.removeData(elem,"handle");}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);if(type.indexOf("!")>=0){type=type.slice(0,-1);var exclusive=true;}if(!elem){if(this.global[type])jQuery("*").add([window,document]).trigger(type,data);}else{if(elem.nodeType==3||elem.nodeType==8)return undefined;var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});data[0][expando]=true;}data[0].type=type;if(exclusive)data[0].exclusive=true;var handle=jQuery.data(elem,"handle");if(handle)val=handle.apply(elem,data);if((!fn||(jQuery.nodeName(elem,'a')&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false)val=false;if(event)data.shift();if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));if(ret!==undefined)val=ret;}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,'a')&&type=="click")){this.triggered=true;try{elem[type]();}catch(e){}}this.triggered=false;}return val;},handle:function(event){var val,ret,namespace,all,handlers;event=arguments[0]=jQuery.event.fix(event||window.event);namespace=event.type.split(".");event.type=namespace[0];namespace=namespace[1];all=!namespace&&!event.exclusive;handlers=(jQuery.data(this,"events")||{})[event.type];for(var j in handlers){var handler=handlers[j];if(all||handler.type==namespace){event.handler=handler;event.data=handler.data;ret=handler.apply(this,arguments);if(val!==false)val=ret;if(ret===false){event.preventDefault();event.stopPropagation();}}}return val;},fix:function(event){if(event[expando]==true)return event;var originalEvent=event;event={originalEvent:originalEvent};var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");for(var i=props.length;i;i--)event[props[i]]=originalEvent[props[i]];event[expando]=true;event.preventDefault=function(){if(originalEvent.preventDefault)originalEvent.preventDefault();originalEvent.returnValue=false;};event.stopPropagation=function(){if(originalEvent.stopPropagation)originalEvent.stopPropagation();originalEvent.cancelBubble=true;};event.timeStamp=event.timeStamp||now();if(!event.target)event.target=event.srcElement||document;if(event.target.nodeType==3)event.target=event.target.parentNode;if(!event.relatedTarget&&event.fromElement)event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode))event.which=event.charCode||event.keyCode;if(!event.metaKey&&event.ctrlKey)event.metaKey=event.ctrlKey;if(!event.which&&event.button)event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));return event;},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;return proxy;},special:{ready:{setup:function(){bindReady();return;},teardown:function(){return;}},mouseenter:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseenter";return jQuery.event.handle.apply(this,arguments);}},mouseleave:{setup:function(){if(jQuery.browser.msie)return false;jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);return true;},teardown:function(){if(jQuery.browser.msie)return false;jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);return true;},handler:function(event){if(withinElement(event,this))return true;event.type="mouseleave";return jQuery.event.handle.apply(this,arguments);}}}};jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);});},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);return(fn||data).apply(this,arguments);});return this.each(function(){jQuery.event.add(this,type,one,fn&&data);});},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);});},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);});},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);},toggle:function(fn){var args=arguments,i=1;while(i<args.length)jQuery.event.proxy(fn,args[i++]);return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;event.preventDefault();return args[this.lastToggle++].apply(this,arguments)||false;}));},hover:function(fnOver,fnOut){return this.bind('mouseenter',fnOver).bind('mouseleave',fnOut);},ready:function(fn){bindReady();if(jQuery.isReady)fn.call(document,jQuery);else
+jQuery.readyList.push(function(){return fn.call(this,jQuery);});return this;}});jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);});jQuery.readyList=null;}jQuery(document).triggerHandler("ready");}}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(document.addEventListener&&!jQuery.browser.opera)document.addEventListener("DOMContentLoaded",jQuery.ready,false);if(jQuery.browser.msie&&window==top)(function(){if(jQuery.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;}jQuery.ready();})();if(jQuery.browser.opera)document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady)return;for(var i=0;i<document.styleSheets.length;i++)if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);return;}jQuery.ready();},false);if(jQuery.browser.safari){var numStyles;(function(){if(jQuery.isReady)return;if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);return;}if(numStyles===undefined)numStyles=jQuery("style, link[rel=stylesheet]").length;if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);return;}jQuery.ready();})();}jQuery.event.add(window,"load",jQuery.ready);}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);};});var withinElement=function(event,elem){var parent=event.relatedTarget;while(parent&&parent!=elem)try{parent=parent.parentNode;}catch(error){parent=elem;}return parent==elem;};jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();});jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!='string')return this._load(url);var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}callback=callback||function(){};var type="GET";if(params)if(jQuery.isFunction(params)){callback=params;params=null;}else{params=jQuery.param(params);type="POST";}var self=this;jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified")self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);self.each(callback,[res.responseText,status,res]);}});return this;},serialize:function(){return jQuery.param(this.serializeArray());},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));}).map(function(i,elem){var val=jQuery(this).val();return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};}):{name:elem.name,value:val};}).get();}});jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);};});var jsc=now();jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data=null;}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;data={};}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();if(s.data&&s.processData&&typeof s.data!="string")s.data=jQuery.param(s.data);if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre))s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";}else if(!s.data||!s.data.match(jsre))s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";s.dataType="json";}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;if(s.data)s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");s.url=s.url.replace(jsre,"="+jsonp+"$1");s.dataType="script";window[jsonp]=function(tmp){data=tmp;success();complete();window[jsonp]=undefined;try{delete window[jsonp];}catch(e){}if(head)head.removeChild(script);};}if(s.dataType=="script"&&s.cache==null)s.cache=false;if(s.cache===false&&type=="GET"){var ts=now();var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;s.data=null;}if(s.global&&!jQuery.active++)jQuery.event.trigger("ajaxStart");var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.src=s.url;if(s.scriptCharset)script.charset=s.scriptCharset;if(!jsonp){var done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;success();complete();head.removeChild(script);}};}head.appendChild(script);return undefined;}var requestDone=false;var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();if(s.username)xhr.open(type,s.url,s.async,s.username,s.password);else
+xhr.open(type,s.url,s.async);try{if(s.data)xhr.setRequestHeader("Content-Type",s.contentType);if(s.ifModified)xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;xhr.abort();return false;}if(s.global)jQuery.event.trigger("ajaxSend",[xhr,s]);var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;if(ival){clearInterval(ival);ival=null;}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);}catch(e){status="parsererror";}}if(status=="success"){var modRes;try{modRes=xhr.getResponseHeader("Last-Modified");}catch(e){}if(s.ifModified&&modRes)jQuery.lastModified[s.url]=modRes;if(!jsonp)success();}else
+jQuery.handleError(s,xhr,status);complete();if(s.async)xhr=null;}};if(s.async){var ival=setInterval(onreadystatechange,13);if(s.timeout>0)setTimeout(function(){if(xhr){xhr.abort();if(!requestDone)onreadystatechange("timeout");}},s.timeout);}try{xhr.send(s.data);}catch(e){jQuery.handleError(s,xhr,null,e);}if(!s.async)onreadystatechange();function success(){if(s.success)s.success(data,status);if(s.global)jQuery.event.trigger("ajaxSuccess",[xhr,s]);}function complete(){if(s.complete)s.complete(xhr,status);if(s.global)jQuery.event.trigger("ajaxComplete",[xhr,s]);if(s.global&&!--jQuery.active)jQuery.event.trigger("ajaxStop");}return xhr;},handleError:function(s,xhr,status,e){if(s.error)s.error(xhr,status,e);if(s.global)jQuery.event.trigger("ajaxError",[xhr,s,e]);},active:0,httpSuccess:function(xhr){try{return!xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;}catch(e){}return false;},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.tagName=="parsererror")throw"parsererror";if(filter)data=filter(data,type);if(type=="script")jQuery.globalEval(data);if(type=="json")data=eval("("+data+")");return data;},param:function(a){var s=[];if(a.constructor==Array||a.jquery)jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));});else
+for(var j in a)if(a[j]&&a[j].constructor==Array)jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));});else
+s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));return s.join("&").replace(/%20/g,"+");}});jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");this.style.display=elem.css("display");if(this.style.display=="none")this.style.display="block";elem.remove();}}).end();},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");this.style.display="none";}).end();},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();});},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1)return false;var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return opt.complete.call(this);if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQuery.extend({},prop);jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=(end||1)+unit;start=((end||1)/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-="?-1:1)*end)+start;e.custom(start,end,unit);}else
+e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;type="fx";}if(!type||(typeof type=="string"&&!fn))return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.call(this);}});},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;if(clearQueue)this.queue([]);this.each(function(){for(var i=timers.length-1;i>=0;i--)if(timers[i].elem==this){if(gotoEnd)timers[i](true);timers.splice(i,1);}});if(!gotoEnd)this.dequeue();return this;}});var queue=function(elem,type,array){if(elem){type=type||"fx";var q=jQuery.data(elem,type+"queue");if(!q||array)q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));}return q;};jQuery.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].call(this);});};jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;opt.old=opt.complete;opt.complete=function(){if(opt.queue!==false)jQuery(this).dequeue();if(jQuery.isFunction(opt.old))opt.old.call(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQuery.fx.prototype={update:function(){if(this.options.step)this.options.step.call(this.elem,this.now,this);(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQuery.css(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=now();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(gotoEnd){return self.step(gotoEnd);}t.elem=this.elem;jQuery.timers.push(t);if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length){clearInterval(jQuery.timerId);jQuery.timerId=null;}},13);}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQuery(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(gotoEnd){var t=now();if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQuery.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQuery.attr(this.elem.style,p,this.options.orig[p]);}if(done)this.options.complete.call(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();}return true;}};jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}}});jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;if(elem)with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);}else{add(elem.offsetLeft,elem.offsetTop);while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2)border(offsetParent);if(!fixed&&css(offsetParent,"position")=="fixed")fixed=true;offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;offsetParent=offsetParent.offsetParent;}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display")))add(-parent.scrollLeft,-parent.scrollTop);if(mozilla&&css(parent,"overflow")!="visible")border(parent);parent=parent.parentNode;}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute"))add(-doc.body.offsetLeft,-doc.body.offsetTop);if(fixed)add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));}results={top:top,left:left};}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));}function add(l,t){left+=parseInt(l,10)||0;top+=parseInt(t,10)||0;}return results;};jQuery.fn.extend({position:function(){var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,'marginTop');offset.left-=num(this,'marginLeft');parentOffset.top+=num(offsetParent,'borderTopWidth');parentOffset.left+=num(offsetParent,'borderLeftWidth');results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;},offsetParent:function(){var offsetParent=this[0].offsetParent;while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,'position')=='static'))offsetParent=offsetParent.offsetParent;return jQuery(offsetParent);}});jQuery.each(['Left','Top'],function(i,name){var method='scroll'+name;jQuery.fn[method]=function(val){if(!this[0])return;return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;}):this[0]==window||this[0]==document?self[i?'pageYOffset':'pageXOffset']||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];};});jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);};jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);};});})();
\ No newline at end of file
diff --git a/wrt/zouba/preview/script/jquery-ui/js/jquery-ui-1.6.custom.min.js b/wrt/zouba/preview/script/jquery-ui/js/jquery-ui-1.6.custom.min.js
new file mode 100644 (file)
index 0000000..56de588
--- /dev/null
@@ -0,0 +1,78 @@
+/*\r
+ * jQuery UI 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI\r
+ */\r(function(C){var I=C.fn.remove,D=C.browser.mozilla&&(parseFloat(C.browser.version)<1.9);C.ui={version:"1.6",plugin:{add:function(K,L,N){var M=C.ui[K].prototype;for(var J in N){M.plugins[J]=M.plugins[J]||[];M.plugins[J].push([L,N[J]])}},call:function(J,L,K){var N=J.plugins[L];if(!N){return }for(var M=0;M<N.length;M++){if(J.options[N[M][0]]){N[M][1].apply(J.element,K)}}}},contains:function(L,K){var J=C.browser.safari&&C.browser.version<522;if(L.contains&&!J){return L.contains(K)}if(L.compareDocumentPosition){return !!(L.compareDocumentPosition(K)&16)}while(K=K.parentNode){if(K==L){return true}}return false},cssCache:{},css:function(J){if(C.ui.cssCache[J]){return C.ui.cssCache[J]}var K=C('<div class="ui-gen">').addClass(J).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");C.ui.cssCache[J]=!!((!(/auto|default/).test(K.css("cursor"))||(/^[1-9]/).test(K.css("height"))||(/^[1-9]/).test(K.css("width"))||!(/none/).test(K.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(K.css("backgroundColor"))));try{C("body").get(0).removeChild(K.get(0))}catch(L){}return C.ui.cssCache[J]},hasScroll:function(M,K){if(C(M).css("overflow")=="hidden"){return false}var J=(K&&K=="left")?"scrollLeft":"scrollTop",L=false;if(M[J]>0){return true}M[J]=1;L=(M[J]>0);M[J]=0;return L},isOverAxis:function(K,J,L){return(K>J)&&(K<(J+L))},isOver:function(O,K,N,M,J,L){return C.ui.isOverAxis(O,N,J)&&C.ui.isOverAxis(K,M,L)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(D){var F=C.attr,E=C.fn.removeAttr,H="http://www.w3.org/2005/07/aaa",A=/^aria-/,B=/^wairole:/;C.attr=function(K,J,L){var M=L!==undefined;return(J=="role"?(M?F.call(this,K,J,"wairole:"+L):(F.apply(this,arguments)||"").replace(B,"")):(A.test(J)?(M?K.setAttributeNS(H,J.replace(A,"aaa:"),L):F.call(this,K,J.replace(A,"aaa:"))):F.apply(this,arguments)))};C.fn.removeAttr=function(J){return(A.test(J)?this.each(function(){this.removeAttributeNS(H,J.replace(A,""))}):E.call(this,J))}}C.fn.extend({remove:function(){C("*",this).add(this).each(function(){C(this).triggerHandler("remove")});return I.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var J;if((C.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){J=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(C.curCSS(this,"position",1))&&(/(auto|scroll)/).test(C.curCSS(this,"overflow",1)+C.curCSS(this,"overflow-y",1)+C.curCSS(this,"overflow-x",1))}).eq(0)}else{J=this.parents().filter(function(){return(/(auto|scroll)/).test(C.curCSS(this,"overflow",1)+C.curCSS(this,"overflow-y",1)+C.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!J.length?C(document):J}});C.extend(C.expr[":"],{data:function(K,L,J){return C.data(K,J[3])},tabbable:function(L,M,K){var N=L.nodeName.toLowerCase();function J(O){return !(C(O).is(":hidden")||C(O).parents(":hidden").length)}return(L.tabIndex>=0&&(("a"==N&&L.href)||(/input|select|textarea|button/.test(N)&&"hidden"!=L.type&&!L.disabled))&&J(L))}});function G(M,N,O,L){function K(Q){var P=C[M][N][Q]||[];return(typeof P=="string"?P.split(/,?\s+/):P)}var J=K("getter");if(L.length==1&&typeof L[0]=="string"){J=J.concat(K("getterSetter"))}return(C.inArray(O,J)!=-1)}C.widget=function(K,J){var L=K.split(".")[0];K=K.split(".")[1];C.fn[K]=function(P){var N=(typeof P=="string"),O=Array.prototype.slice.call(arguments,1);if(N&&P.substring(0,1)=="_"){return this}if(N&&G(L,K,P,O)){var M=C.data(this[0],K);return(M?M[P].apply(M,O):undefined)}return this.each(function(){var Q=C.data(this,K);(!Q&&!N&&C.data(this,K,new C[L][K](this,P)));(Q&&N&&C.isFunction(Q[P])&&Q[P].apply(Q,O))})};C[L]=C[L]||{};C[L][K]=function(O,N){var M=this;this.widgetName=K;this.widgetEventPrefix=C[L][K].eventPrefix||K;this.widgetBaseClass=L+"-"+K;this.options=C.extend({},C.widget.defaults,C[L][K].defaults,C.metadata&&C.metadata.get(O)[K],N);this.element=C(O).bind("setData."+K,function(Q,P,R){return M._setData(P,R)}).bind("getData."+K,function(Q,P){return M._getData(P)}).bind("remove",function(){return M.destroy()});this._init()};C[L][K].prototype=C.extend({},C.widget.prototype,J);C[L][K].getterSetter="option"};C.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName)},option:function(L,M){var K=L,J=this;if(typeof L=="string"){if(M===undefined){return this._getData(L)}K={};K[L]=M}C.each(K,function(N,O){J._setData(N,O)})},_getData:function(J){return this.options[J]},_setData:function(J,K){this.options[J]=K;if(J=="disabled"){this.element[K?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(K,L,M){var J=(K==this.widgetEventPrefix?K:this.widgetEventPrefix+K);L=L||C.event.fix({type:J,target:this.element[0]});return this.element.triggerHandler(J,[L,M],this.options[K])}};C.widget.defaults={disabled:false};C.ui.mouse={_mouseInit:function(){var J=this;this.element.bind("mousedown."+this.widgetName,function(K){return J._mouseDown(K)}).bind("click."+this.widgetName,function(K){if(J._preventClickEvent){J._preventClickEvent=false;return false}});if(C.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(C.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(L){(this._mouseStarted&&this._mouseUp(L));this._mouseDownEvent=L;var K=this,M=(L.which==1),J=(typeof this.options.cancel=="string"?C(L.target).parents().add(L.target).filter(this.options.cancel).length:false);if(!M||J||!this._mouseCapture(L)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){K.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(L)&&this._mouseDelayMet(L)){this._mouseStarted=(this._mouseStart(L)!==false);if(!this._mouseStarted){L.preventDefault();return true}}this._mouseMoveDelegate=function(N){return K._mouseMove(N)};this._mouseUpDelegate=function(N){return K._mouseUp(N)};C(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);if(!C.browser.safari){L.preventDefault()}return true},_mouseMove:function(J){if(C.browser.msie&&!J.button){return this._mouseUp(J)}if(this._mouseStarted){this._mouseDrag(J);return J.preventDefault()}if(this._mouseDistanceMet(J)&&this._mouseDelayMet(J)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,J)!==false);(this._mouseStarted?this._mouseDrag(J):this._mouseUp(J))}return !this._mouseStarted},_mouseUp:function(J){C(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=true;this._mouseStop(J)}return false},_mouseDistanceMet:function(J){return(Math.max(Math.abs(this._mouseDownEvent.pageX-J.pageX),Math.abs(this._mouseDownEvent.pageY-J.pageY))>=this.options.distance)},_mouseDelayMet:function(J){return this.mouseDelayMet},_mouseStart:function(J){},_mouseDrag:function(J){},_mouseStop:function(J){},_mouseCapture:function(J){return true}};C.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);/*\r
+ * jQuery UI Draggable 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI/Draggables\r
+ *\r
+ * Depends:\r
+ *     ui.core.js\r
+ */\r(function(A){A.widget("ui.draggable",A.extend({},A.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return }this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(B){var C=this.options;if(this.helper||C.disabled||A(B.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(B);if(!this.handle){return false}return true},_mouseStart:function(B){var C=this.options;this.helper=this._createHelper(B);this._cacheHelperProportions();if(A.ui.ddmanager){A.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};A.extend(this.offset,{click:{left:B.pageX-this.offset.left,top:B.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});if(C.cursorAt){this._adjustOffsetFromHelper(C.cursorAt)}this.originalPosition=this._generatePosition(B);if(C.containment){this._setContainment()}this._propagate("start",B);this._cacheHelperProportions();if(A.ui.ddmanager&&!C.dropBehaviour){A.ui.ddmanager.prepareOffsets(this,B)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(B,true);return true},_mouseDrag:function(B,C){this.position=this._generatePosition(B);this.positionAbs=this._convertPositionTo("absolute");if(!C){this.position=this._propagate("drag",B)||this.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(A.ui.ddmanager){A.ui.ddmanager.drag(this,B)}return false},_mouseStop:function(C){var D=false;if(A.ui.ddmanager&&!this.options.dropBehaviour){var D=A.ui.ddmanager.drop(this,C)}if((this.options.revert=="invalid"&&!D)||(this.options.revert=="valid"&&D)||this.options.revert===true||(A.isFunction(this.options.revert)&&this.options.revert.call(this.element,D))){var B=this;A(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){B._propagate("stop",C);B._clear()})}else{this._propagate("stop",C);this._clear()}return false},_getHandle:function(B){var C=!this.options.handle||!A(this.options.handle,this.element).length?true:false;A(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==B.target){C=true}});return C},_createHelper:function(C){var D=this.options;var B=A.isFunction(D.helper)?A(D.helper.apply(this.element[0],[C])):(D.helper=="clone"?this.element.clone():this.element);if(!B.parents("body").length){B.appendTo((D.appendTo=="parent"?this.element[0].parentNode:D.appendTo))}if(B[0]!=this.element[0]&&!(/(fixed|absolute)/).test(B.css("position"))){B.css("position","absolute")}return B},_adjustOffsetFromHelper:function(B){if(B.left!=undefined){this.offset.click.left=B.left+this.margins.left}if(B.right!=undefined){this.offset.click.left=this.helperProportions.width-B.right+this.margins.left}if(B.top!=undefined){this.offset.click.top=B.top+this.margins.top}if(B.bottom!=undefined){this.offset.click.top=this.helperProportions.height-B.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var B=this.offsetParent.offset();if((this.offsetParent[0]==document.body&&A.browser.mozilla)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&A.browser.msie)){B={top:0,left:0}}return{top:B.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:B.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var B=this.element.position();return{top:B.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:B.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var E=this.options;if(E.containment=="parent"){E.containment=this.helper[0].parentNode}if(E.containment=="document"||E.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,A(E.containment=="document"?document:window).width()-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left-(parseInt(this.element.css("marginRight"),10)||0),(A(E.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top-(parseInt(this.element.css("marginBottom"),10)||0)]}if(!(/^(document|window|parent)$/).test(E.containment)){var C=A(E.containment)[0];var D=A(E.containment).offset();var B=(A(C).css("overflow")!="hidden");this.containment=[D.left+(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.margins.left,D.top+(parseInt(A(C).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.margins.top,D.left+(B?Math.max(C.scrollWidth,C.offsetWidth):C.offsetWidth)-(parseInt(A(C).css("borderLeftWidth"),10)||0)-this.offset.relative.left-this.offset.parent.left-this.helperProportions.width-this.margins.left,D.top+(B?Math.max(C.scrollHeight,C.offsetHeight):C.offsetHeight)-(parseInt(A(C).css("borderTopWidth"),10)||0)-this.offset.relative.top-this.offset.parent.top-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(D,F){if(!F){F=this.position}var C=D=="absolute"?1:-1;var B=this[(this.cssPosition=="absolute"?"offset":"scroll")+"Parent"],E=(/(html|body)/i).test(B[0].tagName);return{top:(F.top+this.offset.relative.top*C+this.offset.parent.top*C+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(E?0:B.scrollTop()))*C+this.margins.top*C),left:(F.left+this.offset.relative.left*C+this.offset.parent.left*C+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():(E?0:B.scrollLeft()))*C+this.margins.left*C)}},_generatePosition:function(D){var G=this.options,C=this[(this.cssPosition=="absolute"?"offset":"scroll")+"Parent"],H=(/(html|body)/i).test(C[0].tagName);var B={top:(D.pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(H?0:C.scrollTop()))),left:(D.pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():H?0:C.scrollLeft()))};if(!this.originalPosition){return B}if(this.containment){if(B.left<this.containment[0]){B.left=this.containment[0]}if(B.top<this.containment[1]){B.top=this.containment[1]}if(B.left>this.containment[2]){B.left=this.containment[2]}if(B.top>this.containment[3]){B.top=this.containment[3]}}if(G.grid){var F=this.originalPosition.top+Math.round((B.top-this.originalPosition.top)/G.grid[1])*G.grid[1];B.top=this.containment?(!(F<this.containment[1]||F>this.containment[3])?F:(!(F<this.containment[1])?F-G.grid[1]:F+G.grid[1])):F;var E=this.originalPosition.left+Math.round((B.left-this.originalPosition.left)/G.grid[0])*G.grid[0];B.left=this.containment?(!(E<this.containment[0]||E>this.containment[2])?E:(!(E<this.containment[0])?E-G.grid[0]:E+G.grid[0])):E}return B},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_propagate:function(C,B){A.ui.plugin.call(this,C,[B,this._uiHash()]);if(C=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return this.element.triggerHandler(C=="drag"?C:"drag"+C,[B,this._uiHash()],this.options[C])},plugins:{},_uiHash:function(B){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,options:this.options}}}));A.extend(A.ui.draggable,{version:"1.6",defaults:{appendTo:"parent",axis:false,cancel:":input",connectToSortable:false,containment:false,cssNamespace:"ui",cursor:"default",cursorAt:null,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:1,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:null}});A.ui.plugin.add("draggable","connectToSortable",{start:function(B,D){var C=A(this).data("draggable");C.sortables=[];A(D.options.connectToSortable).each(function(){A(this+"").each(function(){if(A.data(this,"sortable")){var E=A.data(this,"sortable");C.sortables.push({instance:E,shouldRevert:E.options.revert});E._refreshItems();E._propagate("activate",B,C)}})})},stop:function(B,D){var C=A(this).data("draggable");A.each(C.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;C.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(B);this.instance.element.triggerHandler("sortreceive",[B,A.extend(this.instance._ui(),{sender:C.element})],this.instance.options["receive"]);this.instance.options.helper=this.instance.options._helper;if(C.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._propagate("deactivate",B,C)}})},drag:function(C,F){var E=A(this).data("draggable"),B=this;var D=function(I){var N=this.offset.click.top,M=this.offset.click.left;var G=this.positionAbs.top,K=this.positionAbs.left;var J=I.height,L=I.width;var O=I.top,H=I.left;return A.ui.isOver(G+N,K+M,O,H,J,L)};A.each(E.sortables,function(G){if(D.call(E,this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=A(B).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return F.helper[0]};C.target=this.instance.currentItem[0];this.instance._mouseCapture(C,true);this.instance._mouseStart(C,true,true);this.instance.offset.click.top=E.offset.click.top;this.instance.offset.click.left=E.offset.click.left;this.instance.offset.parent.left-=E.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=E.offset.parent.top-this.instance.offset.parent.top;E._propagate("toSortable",C)}if(this.instance.currentItem){this.instance._mouseDrag(C)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._mouseStop(C,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}E._propagate("fromSortable",C)}}})}});A.ui.plugin.add("draggable","cursor",{start:function(C,D){var B=A("body");if(B.css("cursor")){D.options._cursor=B.css("cursor")}B.css("cursor",D.options.cursor)},stop:function(B,C){if(C.options._cursor){A("body").css("cursor",C.options._cursor)}}});A.ui.plugin.add("draggable","iframeFix",{start:function(B,C){A(C.options.iframeFix===true?"iframe":C.options.iframeFix).each(function(){A('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(A(this).offset()).appendTo("body")})},stop:function(B,C){A("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});A.ui.plugin.add("draggable","opacity",{start:function(C,D){var B=A(D.helper);if(B.css("opacity")){D.options._opacity=B.css("opacity")}B.css("opacity",D.options.opacity)},stop:function(B,C){if(C.options._opacity){A(C.helper).css("opacity",C.options._opacity)}}});A.ui.plugin.add("draggable","scroll",{start:function(C,D){var E=D.options;var B=A(this).data("draggable");if(B.scrollParent[0]!=document&&B.scrollParent[0].tagName!="HTML"){B.overflowOffset=B.scrollParent.offset()}},drag:function(D,E){var F=E.options,B=false;var C=A(this).data("draggable");if(C.scrollParent[0]!=document&&C.scrollParent[0].tagName!="HTML"){if((C.overflowOffset.top+C.scrollParent[0].offsetHeight)-D.pageY<F.scrollSensitivity){C.scrollParent[0].scrollTop=B=C.scrollParent[0].scrollTop+F.scrollSpeed}else{if(D.pageY-C.overflowOffset.top<F.scrollSensitivity){C.scrollParent[0].scrollTop=B=C.scrollParent[0].scrollTop-F.scrollSpeed}}if((C.overflowOffset.left+C.scrollParent[0].offsetWidth)-D.pageX<F.scrollSensitivity){C.scrollParent[0].scrollLeft=B=C.scrollParent[0].scrollLeft+F.scrollSpeed}else{if(D.pageX-C.overflowOffset.left<F.scrollSensitivity){C.scrollParent[0].scrollLeft=B=C.scrollParent[0].scrollLeft-F.scrollSpeed}}}else{if(D.pageY-A(document).scrollTop()<F.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()-F.scrollSpeed)}else{if(A(window).height()-(D.pageY-A(document).scrollTop())<F.scrollSensitivity){B=A(document).scrollTop(A(document).scrollTop()+F.scrollSpeed)}}if(D.pageX-A(document).scrollLeft()<F.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()-F.scrollSpeed)}else{if(A(window).width()-(D.pageX-A(document).scrollLeft())<F.scrollSensitivity){B=A(document).scrollLeft(A(document).scrollLeft()+F.scrollSpeed)}}}if(B!==false&&A.ui.ddmanager&&!F.dropBehaviour){A.ui.ddmanager.prepareOffsets(C,D)}if(B!==false&&C.cssPosition=="absolute"&&C.scrollParent[0]!=document&&A.ui.contains(C.scrollParent[0],C.offsetParent[0])){C.offset.parent=C._getParentOffset()}if(B!==false&&C.cssPosition=="relative"&&!(C.scrollParent[0]!=document&&C.scrollParent[0]!=C.offsetParent[0])){C.offset.relative=C._getRelativeOffset()}}});A.ui.plugin.add("draggable","snap",{start:function(B,D){var C=A(this).data("draggable");C.snapElements=[];A(D.options.snap.constructor!=String?(D.options.snap.items||":data(draggable)"):D.options.snap).each(function(){var F=A(this);var E=F.offset();if(this!=C.element[0]){C.snapElements.push({item:this,width:F.outerWidth(),height:F.outerHeight(),top:E.top,left:E.left})}})},drag:function(M,K){var E=A(this).data("draggable");var Q=K.options.snapTolerance;var P=K.absolutePosition.left,O=P+E.helperProportions.width,D=K.absolutePosition.top,C=D+E.helperProportions.height;for(var N=E.snapElements.length-1;N>=0;N--){var L=E.snapElements[N].left,J=L+E.snapElements[N].width,I=E.snapElements[N].top,S=I+E.snapElements[N].height;if(!((L-Q<P&&P<J+Q&&I-Q<D&&D<S+Q)||(L-Q<P&&P<J+Q&&I-Q<C&&C<S+Q)||(L-Q<O&&O<J+Q&&I-Q<D&&D<S+Q)||(L-Q<O&&O<J+Q&&I-Q<C&&C<S+Q))){if(E.snapElements[N].snapping){(E.options.snap.release&&E.options.snap.release.call(E.element,M,A.extend(E._uiHash(),{snapItem:E.snapElements[N].item})))}E.snapElements[N].snapping=false;continue}if(K.options.snapMode!="inner"){var B=Math.abs(I-C)<=Q;var R=Math.abs(S-D)<=Q;var G=Math.abs(L-O)<=Q;var H=Math.abs(J-P)<=Q;if(B){K.position.top=E._convertPositionTo("relative",{top:I-E.helperProportions.height,left:0}).top}if(R){K.position.top=E._convertPositionTo("relative",{top:S,left:0}).top}if(G){K.position.left=E._convertPositionTo("relative",{top:0,left:L-E.helperProportions.width}).left}if(H){K.position.left=E._convertPositionTo("relative",{top:0,left:J}).left}}var F=(B||R||G||H);if(K.options.snapMode!="outer"){var B=Math.abs(I-D)<=Q;var R=Math.abs(S-C)<=Q;var G=Math.abs(L-P)<=Q;var H=Math.abs(J-O)<=Q;if(B){K.position.top=E._convertPositionTo("relative",{top:I,left:0}).top}if(R){K.position.top=E._convertPositionTo("relative",{top:S-E.helperProportions.height,left:0}).top}if(G){K.position.left=E._convertPositionTo("relative",{top:0,left:L}).left}if(H){K.position.left=E._convertPositionTo("relative",{top:0,left:J-E.helperProportions.width}).left}}if(!E.snapElements[N].snapping&&(B||R||G||H||F)){(E.options.snap.snap&&E.options.snap.snap.call(E.element,M,A.extend(E._uiHash(),{snapItem:E.snapElements[N].item})))}E.snapElements[N].snapping=(B||R||G||H||F)}}});A.ui.plugin.add("draggable","stack",{start:function(B,C){var D=A.makeArray(A(C.options.stack.group)).sort(function(F,E){return(parseInt(A(F).css("zIndex"),10)||C.options.stack.min)-(parseInt(A(E).css("zIndex"),10)||C.options.stack.min)});A(D).each(function(E){this.style.zIndex=C.options.stack.min+E});this[0].style.zIndex=C.options.stack.min+D.length}});A.ui.plugin.add("draggable","zIndex",{start:function(C,D){var B=A(D.helper);if(B.css("zIndex")){D.options._zIndex=B.css("zIndex")}B.css("zIndex",D.options.zIndex)},stop:function(B,C){if(C.options._zIndex){A(C.helper).css("zIndex",C.options._zIndex)}}})})(jQuery);/*\r
+ * jQuery UI Droppable 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI/Droppables\r
+ *\r
+ * Depends:\r
+ *     ui.core.js\r
+ *     ui.draggable.js\r
+ */\r(function(A){A.widget("ui.droppable",{_init:function(){var C=this.options,B=C.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&A.isFunction(this.options.accept)?this.options.accept:function(D){return D.is(B)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};A.ui.ddmanager.droppables[this.options.scope]=A.ui.ddmanager.droppables[this.options.scope]||[];A.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.cssNamespace&&this.element.addClass(this.options.cssNamespace+"-droppable"))},destroy:function(){var B=A.ui.ddmanager.droppables[this.options.scope];for(var C=0;C<B.length;C++){if(B[C]==this){B.splice(C,1)}}this.element.removeClass("ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(B,C){if(B=="accept"){this.options.accept=C&&A.isFunction(C)?C:function(D){return D.is(accept)}}else{A.widget.prototype._setData.apply(this,arguments)}},_activate:function(C){var B=A.ui.ddmanager.current;A.ui.plugin.call(this,"activate",[C,this.ui(B)]);if(B){this.element.triggerHandler("dropactivate",[C,this.ui(B)],this.options.activate)}},_deactivate:function(C){var B=A.ui.ddmanager.current;A.ui.plugin.call(this,"deactivate",[C,this.ui(B)]);if(B){this.element.triggerHandler("dropdeactivate",[C,this.ui(B)],this.options.deactivate)}},_over:function(C){var B=A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element,(B.currentItem||B.element))){A.ui.plugin.call(this,"over",[C,this.ui(B)]);this.element.triggerHandler("dropover",[C,this.ui(B)],this.options.over)}},_out:function(C){var B=A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return }if(this.options.accept.call(this.element,(B.currentItem||B.element))){A.ui.plugin.call(this,"out",[C,this.ui(B)]);this.element.triggerHandler("dropout",[C,this.ui(B)],this.options.out)}},_drop:function(C,D){var B=D||A.ui.ddmanager.current;if(!B||(B.currentItem||B.element)[0]==this.element[0]){return false}var E=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var F=A.data(this,"droppable");if(F.options.greedy&&A.ui.intersect(B,A.extend(F,{offset:F.element.offset()}),F.options.tolerance)){E=true;return false}});if(E){return false}if(this.options.accept.call(this.element,(B.currentItem||B.element))){A.ui.plugin.call(this,"drop",[C,this.ui(B)]);this.element.triggerHandler("drop",[C,this.ui(B)],this.options.drop);return this.element}return false},plugins:{},ui:function(B){return{draggable:(B.currentItem||B.element),helper:B.helper,position:B.position,absolutePosition:B.positionAbs,options:this.options,element:this.element}}});A.extend(A.ui.droppable,{version:"1.6",defaults:{accept:"*",activeClass:null,cssNamespace:"ui",greedy:false,hoverClass:null,scope:"default",tolerance:"intersect"}});A.ui.intersect=function(O,I,M){if(!I.offset){return false}var D=(O.positionAbs||O.position.absolute).left,C=D+O.helperProportions.width,L=(O.positionAbs||O.position.absolute).top,K=L+O.helperProportions.height;var F=I.offset.left,B=F+I.proportions.width,N=I.offset.top,J=N+I.proportions.height;switch(M){case"fit":return(F<D&&C<B&&N<L&&K<J);break;case"intersect":return(F<D+(O.helperProportions.width/2)&&C-(O.helperProportions.width/2)<B&&N<L+(O.helperProportions.height/2)&&K-(O.helperProportions.height/2)<J);break;case"pointer":var G=((O.positionAbs||O.position.absolute).left+(O.clickOffset||O.offset.click).left),H=((O.positionAbs||O.position.absolute).top+(O.clickOffset||O.offset.click).top),E=A.ui.isOver(H,G,N,F,I.proportions.height,I.proportions.width);return E;break;case"touch":return((L>=N&&L<=J)||(K>=N&&K<=J)||(L<N&&K>J))&&((D>=F&&D<=B)||(C>=F&&C<=B)||(D<F&&C>B));break;default:return false;break}};A.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(E,G){var B=A.ui.ddmanager.droppables[E.options.scope];var F=G?G.type:null;var H=(E.currentItem||E.element).find(":data(droppable)").andSelf();droppablesLoop:for(var D=0;D<B.length;D++){if(B[D].options.disabled||(E&&!B[D].options.accept.call(B[D].element,(E.currentItem||E.element)))){continue}for(var C=0;C<H.length;C++){if(H[C]==B[D].element[0]){B[D].proportions.height=0;continue droppablesLoop}}B[D].visible=B[D].element.css("display")!="none";if(!B[D].visible){continue}B[D].offset=B[D].element.offset();B[D].proportions={width:B[D].element[0].offsetWidth,height:B[D].element[0].offsetHeight};if(F=="dragstart"||F=="sortactivate"){B[D]._activate.call(B[D],G)}}},drop:function(B,C){var D=false;A.each(A.ui.ddmanager.droppables[B.options.scope],function(){if(!this.options){return }if(!this.options.disabled&&this.visible&&A.ui.intersect(B,this,this.options.tolerance)){D=this._drop.call(this,C)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element,(B.currentItem||B.element))){this.isout=1;this.isover=0;this._deactivate.call(this,C)}});return D},drag:function(B,C){if(B.options.refreshPositions){A.ui.ddmanager.prepareOffsets(B,C)}A.each(A.ui.ddmanager.droppables[B.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return }var E=A.ui.intersect(B,this,this.options.tolerance);var G=!E&&this.isover==1?"isout":(E&&this.isover==0?"isover":null);if(!G){return }var F;if(this.options.greedy){var D=this.element.parents(":data(droppable):eq(0)");if(D.length){F=A.data(D[0],"droppable");F.greedyChild=(G=="isover"?1:0)}}if(F&&G=="isover"){F["isover"]=0;F["isout"]=1;F._out.call(F,C)}this[G]=1;this[G=="isout"?"isover":"isout"]=0;this[G=="isover"?"_over":"_out"].call(this,C);if(F&&G=="isout"){F["isout"]=0;F["isover"]=1;F._over.call(F,C)}})}};A.ui.plugin.add("droppable","activeClass",{activate:function(B,C){A(this).addClass(C.options.activeClass)},deactivate:function(B,C){A(this).removeClass(C.options.activeClass)},drop:function(B,C){A(this).removeClass(C.options.activeClass)}});A.ui.plugin.add("droppable","hoverClass",{over:function(B,C){A(this).addClass(C.options.hoverClass)},out:function(B,C){A(this).removeClass(C.options.hoverClass)},drop:function(B,C){A(this).removeClass(C.options.hoverClass)}})})(jQuery);/*\r
+ * jQuery UI Accordion 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI/Accordion\r
+ *\r
+ * Depends:\r
+ *     ui.core.js\r
+ */\r(function(E){E.widget("ui.accordion",{_init:function(){var H=this.options;if(H.navigation){var K=this.element.find("a").filter(H.navigationFilter);if(K.length){if(K.filter(H.header).length){H.active=K}else{H.active=K.parent().parent().prev();K.addClass("current")}}}H.headers=this.element.find(H.header);H.active=C(H.headers,H.active);if(E.browser.msie){this.element.find("a").css("zoom","1")}if(!this.element.hasClass("ui-accordion")){this.element.addClass("ui-accordion");E('<span class="ui-accordion-left"></span>').insertBefore(H.headers);E('<span class="ui-accordion-right"></span>').appendTo(H.headers);H.headers.addClass("ui-accordion-header")}var J;if(H.fillSpace){J=this.element.parent().height();H.headers.each(function(){J-=E(this).outerHeight()});var I=0;H.headers.next().each(function(){I=Math.max(I,E(this).innerHeight()-E(this).height())}).height(J-I)}else{if(H.autoHeight){J=0;H.headers.next().each(function(){J=Math.max(J,E(this).outerHeight())}).height(J)}}this.element.attr("role","tablist");var G=this;H.headers.attr("role","tab").bind("keydown",function(L){return G._keydown(L)}).next().attr("role","tabpanel");H.headers.not(H.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!H.active.length){H.headers.eq(0).attr("tabIndex","0")}else{H.active.attr("aria-expanded","true").attr("tabIndex","0").parent().andSelf().addClass(H.selectedClass)}if(!E.browser.safari){H.headers.find("a").attr("tabIndex","-1")}if(H.event){this.element.bind((H.event)+".accordion",F)}},destroy:function(){this.options.headers.parent().andSelf().removeClass(this.options.selectedClass);this.options.headers.prev(".ui-accordion-left").remove();this.options.headers.children(".ui-accordion-right").remove();this.options.headers.next().css("display","");if(this.options.fillSpace||this.options.autoHeight){this.options.headers.next().css("height","")}E.removeData(this.element[0],"accordion");this.element.removeClass("ui-accordion").unbind(".accordion")},_keydown:function(J){if(this.options.disabled||J.altKey||J.ctrlKey){return }var K=E.ui.keyCode;var I=this.options.headers.length;var G=this.options.headers.index(J.target);var H=false;switch(J.keyCode){case K.RIGHT:case K.DOWN:H=this.options.headers[(G+1)%I];break;case K.LEFT:case K.UP:H=this.options.headers[(G-1+I)%I];break;case K.SPACE:case K.ENTER:return F.call(this.element[0],{target:J.target})}if(H){E(J.target).attr("tabIndex","-1");E(H).attr("tabIndex","0");H.focus();return false}return true},activate:function(G){F.call(this.element[0],{target:C(this.options.headers,G)[0]})}});function B(H,G){return function(){return H.apply(G,arguments)}}function D(I){if(!E.data(this,"accordion")){return }var G=E.data(this,"accordion");var H=G.options;H.running=I?0:--H.running;if(H.running){return }if(H.clearStyle){H.toShow.add(H.toHide).css({height:"",overflow:""})}G._trigger("change",null,H.data)}function A(G,N,K,L,O){var Q=E.data(this,"accordion").options;Q.toShow=G;Q.toHide=N;Q.data=K;var H=B(D,this);E.data(this,"accordion")._trigger("changestart",null,Q.data);Q.running=N.size()===0?G.size():N.size();if(Q.animated){var J={};if(!Q.alwaysOpen&&L){J={toShow:E([]),toHide:N,complete:H,down:O,autoHeight:Q.autoHeight}}else{J={toShow:G,toHide:N,complete:H,down:O,autoHeight:Q.autoHeight}}if(!Q.proxied){Q.proxied=Q.animated}if(!Q.proxiedDuration){Q.proxiedDuration=Q.duration}Q.animated=E.isFunction(Q.proxied)?Q.proxied(J):Q.proxied;Q.duration=E.isFunction(Q.proxiedDuration)?Q.proxiedDuration(J):Q.proxiedDuration;var P=E.ui.accordion.animations,I=Q.duration,M=Q.animated;if(!P[M]){P[M]=function(R){this.slide(R,{easing:M,duration:I||700})}}P[M](J)}else{if(!Q.alwaysOpen&&L){G.toggle()}else{N.hide();G.show()}H(true)}N.prev().attr("aria-expanded","false").attr("tabIndex","-1");G.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()}function F(L){var J=E.data(this,"accordion").options;if(J.disabled){return false}if(!L.target&&!J.alwaysOpen){J.active.parent().andSelf().toggleClass(J.selectedClass);var I=J.active.next(),M={options:J,newHeader:E([]),oldHeader:J.active,newContent:E([]),oldContent:I},G=(J.active=E([]));A.call(this,G,I,M);return false}var K=E(L.target);K=E(K.parents(J.header)[0]||K);var H=K[0]==J.active[0];if(J.running||(J.alwaysOpen&&H)){return false}if(!K.is(J.header)){return }J.active.parent().andSelf().toggleClass(J.selectedClass);if(!H){K.parent().andSelf().addClass(J.selectedClass)}var G=K.next(),I=J.active.next(),M={options:J,newHeader:H&&!J.alwaysOpen?E([]):K,oldHeader:J.active,newContent:H&&!J.alwaysOpen?E([]):G,oldContent:I},N=J.headers.index(J.active[0])>J.headers.index(K[0]);J.active=H?E([]):K;A.call(this,G,I,M,H,N);return false}function C(H,G){return G?typeof G=="number"?H.filter(":eq("+G+")"):H.not(H.not(G)):G===false?E([]):H.filter(":eq(0)")}E.extend(E.ui.accordion,{version:"1.6",defaults:{autoHeight:true,alwaysOpen:true,animated:"slide",event:"click",header:"a",navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()},running:0,selectedClass:"selected"},animations:{slide:function(G,J){G=E.extend({easing:"swing",duration:300},G,J);if(!G.toHide.size()){G.toShow.animate({height:"show"},G);return }var I=G.toHide.height(),L=G.toShow.height(),N=L/I,K=G.toShow.outerHeight()-G.toShow.height(),H=G.toShow.css("marginBottom"),M=G.toShow.css("overflow");tmargin=G.toShow.css("marginTop");G.toShow.css({height:0,overflow:"hidden",marginTop:0,marginBottom:-K}).show();G.toHide.filter(":hidden").each(G.complete).end().filter(":visible").animate({height:"hide"},{step:function(O){var P=(I-O)*N;if(E.browser.msie||E.browser.opera){P=Math.ceil(P)}G.toShow.height(P)},duration:G.duration,easing:G.easing,complete:function(){if(!G.autoHeight){G.toShow.css("height","auto")}G.toShow.css({marginTop:tmargin,marginBottom:H,overflow:M});G.complete()}})},bounceslide:function(G){this.slide(G,{easing:G.down?"easeOutBounce":"swing",duration:G.down?1000:200})},easeslide:function(G){this.slide(G,{easing:"easeinout",duration:700})}}})})(jQuery);/*\r
+ * jQuery UI Dialog 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI/Dialog\r
+ *\r
+ * Depends:\r
+ *     ui.core.js\r
+ *     ui.draggable.js\r
+ *     ui.resizable.js\r
+ */\r(function(B){var A={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"};B.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");this.options.title=this.options.title||this.originalTitle;var M=this,N=this.options,F=this.element.removeAttr("title").addClass("ui-dialog-content").wrap("<div></div>").wrap("<div></div>"),I=(this.uiDialogContainer=F.parent()).addClass("ui-dialog-container").css({position:"relative",width:"100%",height:"100%"}),E=(this.uiDialogTitlebar=B("<div></div>")).addClass("ui-dialog-titlebar").mousedown(function(){M.moveToTop()}).prependTo(I),J=B('<a href="#"/>').addClass("ui-dialog-titlebar-close").attr("role","button").appendTo(E),G=(this.uiDialogTitlebarCloseText=B("<span/>")).text(N.closeText).appendTo(J),L=N.title||"&nbsp;",D=B.ui.dialog.getTitleId(this.element),C=B("<span/>").addClass("ui-dialog-title").attr("id",D).html(L).prependTo(E),K=(this.uiDialog=I.parent()).appendTo(document.body).hide().addClass("ui-dialog").addClass(N.dialogClass).css({position:"absolute",width:N.width,height:N.height,overflow:"hidden",zIndex:N.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(O){(N.closeOnEscape&&O.keyCode&&O.keyCode==B.ui.keyCode.ESCAPE&&M.close())}).attr({role:"dialog","aria-labelledby":D}).mouseup(function(){M.moveToTop()}),H=(this.uiDialogButtonPane=B("<div></div>")).addClass("ui-dialog-buttonpane").css({position:"absolute",bottom:0}).appendTo(K),J=B(".ui-dialog-titlebar-close",E).hover(function(){B(this).addClass("ui-dialog-titlebar-close-hover")},function(){B(this).removeClass("ui-dialog-titlebar-close-hover")}).mousedown(function(O){O.stopPropagation()}).click(function(){M.close();return false});E.find("*").add(E).disableSelection();(N.draggable&&B.fn.draggable&&this._makeDraggable());(N.resizable&&B.fn.resizable&&this._makeResizable());this._createButtons(N.buttons);this._isOpen=false;(N.bgiframe&&B.fn.bgiframe&&K.bgiframe());(N.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(){if(false===this._trigger("beforeclose",null,{options:this.options})){return }(this.overlay&&this.overlay.destroy());this.uiDialog.hide(this.options.hide).unbind("keypress.ui-dialog");this._trigger("close",null,{options:this.options});B.ui.dialog.overlay.resize();this._isOpen=false},isOpen:function(){return this._isOpen},moveToTop:function(F){if((this.options.modal&&!F)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",null,{options:this.options})}var E=this.options.zIndex,D=this.options;B(".ui-dialog:visible").each(function(){E=Math.max(E,parseInt(B(this).css("z-index"),10)||D.zIndex)});(this.overlay&&this.overlay.$el.css("z-index",++E));var C={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++E);this.element.attr(C);this._trigger("focus",null,{options:this.options})},open:function(){if(this._isOpen){return }this.overlay=this.options.modal?new B.ui.dialog.overlay(this):null;(this.uiDialog.next().length&&this.uiDialog.appendTo("body"));this._position(this.options.position);this.uiDialog.show(this.options.show);(this.options.autoResize&&this._size());this.moveToTop(true);(this.options.modal&&this.uiDialog.bind("keypress.ui-dialog",function(E){if(E.keyCode!=B.ui.keyCode.TAB){return }var D=B(":tabbable",this),F=D.filter(":first")[0],C=D.filter(":last")[0];if(E.target==C&&!E.shiftKey){setTimeout(function(){F.focus()},1)}else{if(E.target==F&&E.shiftKey){setTimeout(function(){C.focus()},1)}}}));this.uiDialog.find(":tabbable:first").focus();this._trigger("open",null,{options:this.options});this._isOpen=true},_createButtons:function(F){var E=this,C=false,D=this.uiDialogButtonPane;D.empty().hide();B.each(F,function(){return !(C=true)});if(C){D.show();B.each(F,function(G,H){B('<button type="button"></button>').text(G).click(function(){H.apply(E.element[0],arguments)}).appendTo(D)})}},_makeDraggable:function(){var C=this,D=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content",helper:D.dragHelper,handle:".ui-dialog-titlebar",start:function(){C.moveToTop();(D.dragStart&&D.dragStart.apply(C.element[0],arguments))},drag:function(){(D.drag&&D.drag.apply(C.element[0],arguments))},stop:function(){(D.dragStop&&D.dragStop.apply(C.element[0],arguments));B.ui.dialog.overlay.resize()}})},_makeResizable:function(F){F=(F===undefined?this.options.resizable:F);var C=this,E=this.options,D=typeof F=="string"?F:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",helper:E.resizeHelper,maxWidth:E.maxWidth,maxHeight:E.maxHeight,minWidth:E.minWidth,minHeight:E.minHeight,start:function(){(E.resizeStart&&E.resizeStart.apply(C.element[0],arguments))},resize:function(){(E.autoResize&&C._size.apply(C));(E.resize&&E.resize.apply(C.element[0],arguments))},handles:D,stop:function(){(E.autoResize&&C._size.apply(C));(E.resizeStop&&E.resizeStop.apply(C.element[0],arguments));B.ui.dialog.overlay.resize()}})},_position:function(H){var D=B(window),E=B(document),F=E.scrollTop(),C=E.scrollLeft(),G=F;if(B.inArray(H,["center","top","right","bottom","left"])>=0){H=[H=="right"||H=="left"?H:"center",H=="top"||H=="bottom"?H:"middle"]}if(H.constructor!=Array){H=["center","middle"]}if(H[0].constructor==Number){C+=H[0]}else{switch(H[0]){case"left":C+=0;break;case"right":C+=D.width()-this.uiDialog.outerWidth();break;default:case"center":C+=(D.width()-this.uiDialog.outerWidth())/2}}if(H[1].constructor==Number){F+=H[1]}else{switch(H[1]){case"top":F+=0;break;case"bottom":F+=(B.browser.opera?window.innerHeight:D.height())-this.uiDialog.outerHeight();break;default:case"middle":F+=((B.browser.opera?window.innerHeight:D.height())-this.uiDialog.outerHeight())/2}}F=Math.max(F,G);this.uiDialog.css({top:F,left:C})},_setData:function(D,E){(A[D]&&this.uiDialog.data(A[D],E));switch(D){case"buttons":this._createButtons(E);break;case"closeText":this.uiDialogTitlebarCloseText.text(E);break;case"draggable":(E?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(E);break;case"position":this._position(E);break;case"resizable":var C=this.uiDialog,F=this.uiDialog.is(":data(resizable)");(F&&!E&&C.resizable("destroy"));(F&&typeof E=="string"&&C.resizable("option","handles",E));(F||this._makeResizable(E));break;case"title":B(".ui-dialog-title",this.uiDialogTitlebar).html(E||"&nbsp;");break;case"width":this.uiDialog.width(E);break}B.widget.prototype._setData.apply(this,arguments)},_size:function(){var D=this.uiDialogContainer,G=this.uiDialogTitlebar,E=this.element,F=(parseInt(E.css("margin-top"),10)||0)+(parseInt(E.css("margin-bottom"),10)||0),C=(parseInt(E.css("margin-left"),10)||0)+(parseInt(E.css("margin-right"),10)||0);E.height(D.height()-G.outerHeight()-F);E.width(D.width()-C)}});B.extend(B.ui.dialog,{version:"1.6",defaults:{autoOpen:true,autoResize:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",draggable:true,height:200,minHeight:100,minWidth:150,modal:false,overlay:{},position:"center",resizable:true,stack:true,width:300,zIndex:1000},getter:"isOpen",uuid:0,getTitleId:function(C){return"ui-dialog-title-"+(C.attr("id")||++this.uuid)},overlay:function(C){this.$el=B.ui.dialog.overlay.create(C)}});B.extend(B.ui.dialog.overlay,{instances:[],events:B.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(C){return C+".dialog-overlay"}).join(" "),create:function(D){if(this.instances.length===0){setTimeout(function(){B("a, :input").bind(B.ui.dialog.overlay.events,function(){var F=false;var H=B(this).parents(".ui-dialog");if(H.length){var E=B(".ui-dialog-overlay");if(E.length){var G=parseInt(E.css("z-index"),10);E.each(function(){G=Math.max(G,parseInt(B(this).css("z-index"),10))});F=parseInt(H.css("z-index"),10)>G}else{F=true}}return F})},1);B(document).bind("keydown.dialog-overlay",function(E){(D.options.closeOnEscape&&E.keyCode&&E.keyCode==B.ui.keyCode.ESCAPE&&D.close())});B(window).bind("resize.dialog-overlay",B.ui.dialog.overlay.resize)}var C=B("<div></div>").appendTo(document.body).addClass("ui-dialog-overlay").css(B.extend({borderWidth:0,margin:0,padding:0,position:"absolute",top:0,left:0,width:this.width(),height:this.height()},D.options.overlay));(D.options.bgiframe&&B.fn.bgiframe&&C.bgiframe());this.instances.push(C);return C},destroy:function(C){this.instances.splice(B.inArray(this.instances,C),1);if(this.instances.length===0){B("a, :input").add([document,window]).unbind(".dialog-overlay")}C.remove()},height:function(){if(B.browser.msie&&B.browser.version<7){var D=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var C=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(D<C){return B(window).height()+"px"}else{return D+"px"}}else{if(B.browser.opera){return Math.max(window.innerHeight,B(document).height())+"px"}else{return B(document).height()+"px"}}},width:function(){if(B.browser.msie&&B.browser.version<7){var C=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var D=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(C<D){return B(window).width()+"px"}else{return C+"px"}}else{if(B.browser.opera){return Math.max(window.innerWidth,B(document).width())+"px"}else{return B(document).width()+"px"}}},resize:function(){var C=B([]);B.each(B.ui.dialog.overlay.instances,function(){C=C.add(this)});C.css({width:0,height:0}).css({width:B.ui.dialog.overlay.width(),height:B.ui.dialog.overlay.height()})}});B.extend(B.ui.dialog.overlay.prototype,{destroy:function(){B.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);/*\r
+ * jQuery UI Slider 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI/Slider\r
+ *\r
+ * Depends:\r
+ *     ui.core.js\r
+ */\r(function(A){A.fn.unwrap=A.fn.unwrap||function(B){return this.each(function(){A(this).parents(B).eq(0).after(this).remove()})};A.widget("ui.slider",{_init:function(){var B=this;this.element.addClass("ui-slider");this._initBoundaries();this.handle=A(this.options.handle,this.element);if(!this.handle.length){B.handle=B.generated=A(B.options.handles||[0]).map(function(){var D=A("<div/>").addClass("ui-slider-handle").appendTo(B.element);if(this.id){D.attr("id",this.id)}return D[0]})}var C=function(D){this.element=A(D);this.element.data("mouse",this);this.options=B.options;this.element.bind("mousedown",function(){if(B.currentHandle){this.blur(B.currentHandle)}B._focus(this,true)});this._mouseInit()};A.extend(C.prototype,A.ui.mouse,{_mouseCapture:function(){return true},_mouseStart:function(D){return B._start.call(B,D,this.element[0])},_mouseDrag:function(D){return B._drag.call(B,D,this.element[0])},_mouseStop:function(D){return B._stop.call(B,D,this.element[0])},trigger:function(D){this._mouseDown(D)}});A(this.handle).each(function(){new C(this)}).wrap('<a href="#" style="outline:none;border:none;"></a>').parent().bind("click",function(){return false}).bind("focus",function(D){B._focus(this.firstChild)}).bind("blur",function(D){B._blur(this.firstChild)}).bind("keydown",function(D){if(!B.options.noKeyboard){return B._keydown(D.keyCode,this.firstChild)}});this.element.bind("mousedown.slider",function(D){if(A(D.target).is(".ui-slider-handle")){return }B._click.apply(B,[D]);B.currentHandle.data("mouse").trigger(D);B.firstValue=B.firstValue+1});A.each(this.options.handles||[],function(D,E){B.moveTo(E.start,D,true)});if(!isNaN(this.options.startValue)){this.moveTo(this.options.startValue,0,true)}this.previousHandle=A(this.handle[0]);if(this.handle.length==2&&this.options.range){this._createRange()}},destroy:function(){this.element.removeClass("ui-slider ui-slider-disabled").removeData("slider").unbind(".slider");if(this.handle&&this.handle.length){this.handle.unwrap("a");this.handle.each(function(){var B=A(this).data("mouse");B&&B._mouseDestroy()})}this.generated&&this.generated.remove()},_start:function(B,C){var D=this.options;if(D.disabled){return false}this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};if(!this.currentHandle){this._focus(this.previousHandle,true)}this.offset=this.element.offset();this.handleOffset=this.currentHandle.offset();this.clickOffset={top:B.pageY-this.handleOffset.top,left:B.pageX-this.handleOffset.left};this.firstValue=this.value();this._propagate("start",B);this._drag(B,C);return true},_drag:function(C,E){var F=this.options;var B={top:C.pageY-this.offset.top-this.clickOffset.top,left:C.pageX-this.offset.left-this.clickOffset.left};if(!this.currentHandle){this._focus(this.previousHandle,true)}B.left=this._translateLimits(B.left,"x");B.top=this._translateLimits(B.top,"y");if(F.stepping.x){var D=this._convertValue(B.left,"x");D=this._round(D/F.stepping.x)*F.stepping.x;B.left=this._translateValue(D,"x")}if(F.stepping.y){var D=this._convertValue(B.top,"y");D=this._round(D/F.stepping.y)*F.stepping.y;B.top=this._translateValue(D,"y")}B.left=this._translateRange(B.left,"x");B.top=this._translateRange(B.top,"y");if(F.axis!="vertical"){this.currentHandle.css({left:B.left})}if(F.axis!="horizontal"){this.currentHandle.css({top:B.top})}this.currentHandle.data("mouse").sliderValue={x:this._round(this._convertValue(B.left,"x"))||0,y:this._round(this._convertValue(B.top,"y"))||0};if(this.rangeElement){this._updateRange()}this._propagate("slide",C);return false},_stop:function(B){this._propagate("stop",B);if(this.firstValue!=this.value()){this._propagate("change",B)}this._focus(this.currentHandle,true);return false},_round:function(B){return this.options.round?parseInt(B,10):parseFloat(B)},_setData:function(B,C){A.widget.prototype._setData.apply(this,arguments);if(/min|max|steps/.test(B)){this._initBoundaries()}if(B=="range"){C?this.handle.length==2&&this._createRange():this._removeRange()}},_initBoundaries:function(){var B=this.element[0],C=this.options;this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};A.extend(C,{axis:C.axis||(B.offsetWidth<B.offsetHeight?"vertical":"horizontal"),max:!isNaN(parseInt(C.max,10))?{x:parseInt(C.max,10),y:parseInt(C.max,10)}:({x:C.max&&C.max.x||100,y:C.max&&C.max.y||100}),min:!isNaN(parseInt(C.min,10))?{x:parseInt(C.min,10),y:parseInt(C.min,10)}:({x:C.min&&C.min.x||0,y:C.min&&C.min.y||0})});C.realMax={x:C.max.x-C.min.x,y:C.max.y-C.min.y};C.stepping={x:C.stepping&&C.stepping.x||parseInt(C.stepping,10)||(C.steps?C.realMax.x/(C.steps.x||parseInt(C.steps,10)||C.realMax.x):0),y:C.stepping&&C.stepping.y||parseInt(C.stepping,10)||(C.steps?C.realMax.y/(C.steps.y||parseInt(C.steps,10)||C.realMax.y):0)}},_keydown:function(F,E){if(this.options.disabled){return }var C=F;if(/(33|34|35|36|37|38|39|40)/.test(C)){var G=this.options,B,I;if(/(35|36)/.test(C)){B=(C==35)?G.max.x:G.min.x;I=(C==35)?G.max.y:G.min.y}else{var H=/(34|37|40)/.test(C)?"-=":"+=";var D=/(37|38|39|40)/.test(C)?"_oneStep":"_pageStep";B=H+this[D]("x");I=H+this[D]("y")}this.moveTo({x:B,y:I},E);return false}return true},_focus:function(B,C){this.currentHandle=A(B).addClass("ui-slider-handle-active");if(C){this.currentHandle.parent()[0].focus()}},_blur:function(B){A(B).removeClass("ui-slider-handle-active");if(this.currentHandle&&this.currentHandle[0]==B){this.previousHandle=this.currentHandle;this.currentHandle=null}},_click:function(C){var D=[C.pageX,C.pageY];var B=false;this.handle.each(function(){if(this==C.target){B=true}});if(B||this.options.disabled||!(this.currentHandle||this.previousHandle)){return }if(!this.currentHandle&&this.previousHandle){this._focus(this.previousHandle,true)}this.offset=this.element.offset();this.moveTo({y:this._convertValue(C.pageY-this.offset.top-this.currentHandle[0].offsetHeight/2,"y"),x:this._convertValue(C.pageX-this.offset.left-this.currentHandle[0].offsetWidth/2,"x")},null,!this.options.distance)},_createRange:function(){if(this.rangeElement){return }this.rangeElement=A("<div></div>").addClass("ui-slider-range").css({position:"absolute"}).appendTo(this.element);this._updateRange()},_removeRange:function(){this.rangeElement.remove();this.rangeElement=null},_updateRange:function(){var C=this.options.axis=="vertical"?"top":"left";var B=this.options.axis=="vertical"?"height":"width";this.rangeElement.css(C,(this._round(A(this.handle[0]).css(C))||0)+this._handleSize(0,this.options.axis=="vertical"?"y":"x")/2);this.rangeElement.css(B,(this._round(A(this.handle[1]).css(C))||0)-(this._round(A(this.handle[0]).css(C))||0))},_getRange:function(){return this.rangeElement?this._convertValue(this._round(this.rangeElement.css(this.options.axis=="vertical"?"height":"width")),this.options.axis=="vertical"?"y":"x"):null},_handleIndex:function(){return this.handle.index(this.currentHandle[0])},value:function(D,B){if(this.handle.length==1){this.currentHandle=this.handle}if(!B){B=this.options.axis=="vertical"?"y":"x"}var C=A(D!=undefined&&D!==null?this.handle[D]||D:this.currentHandle);if(C.data("mouse").sliderValue){return this._round(C.data("mouse").sliderValue[B])}else{return this._round(((this._round(C.css(B=="x"?"left":"top"))/(this.actualSize[B=="x"?"width":"height"]-this._handleSize(D,B)))*this.options.realMax[B])+this.options.min[B])}},_convertValue:function(C,B){return this.options.min[B]+(C/(this.actualSize[B=="x"?"width":"height"]-this._handleSize(null,B)))*this.options.realMax[B]},_translateValue:function(C,B){return((C-this.options.min[B])/this.options.realMax[B])*(this.actualSize[B=="x"?"width":"height"]-this._handleSize(null,B))},_translateRange:function(D,B){if(this.rangeElement){if(this.currentHandle[0]==this.handle[0]&&D>=this._translateValue(this.value(1),B)){D=this._translateValue(this.value(1,B)-this._oneStep(B),B)}if(this.currentHandle[0]==this.handle[1]&&D<=this._translateValue(this.value(0),B)){D=this._translateValue(this.value(0,B)+this._oneStep(B),B)}}if(this.options.handles){var C=this.options.handles[this._handleIndex()];if(D<this._translateValue(C.min,B)){D=this._translateValue(C.min,B)}else{if(D>this._translateValue(C.max,B)){D=this._translateValue(C.max,B)}}}return D},_translateLimits:function(C,B){if(C>=this.actualSize[B=="x"?"width":"height"]-this._handleSize(null,B)){C=this.actualSize[B=="x"?"width":"height"]-this._handleSize(null,B)}if(C<=0){C=0}return C},_handleSize:function(C,B){return A(C!=undefined&&C!==null?this.handle[C]:this.currentHandle)[0]["offset"+(B=="x"?"Width":"Height")]},_oneStep:function(B){return this.options.stepping[B]||1},_pageStep:function(B){return 10},moveTo:function(F,E,G){var H=this.options;this.actualSize={width:this.element.outerWidth(),height:this.element.outerHeight()};if(E==undefined&&!this.currentHandle&&this.handle.length!=1){return false}if(E==undefined&&!this.currentHandle){E=0}if(E!=undefined){this.currentHandle=this.previousHandle=A(this.handle[E]||E)}if(F.x!==undefined&&F.y!==undefined){var B=F.x,I=F.y}else{var B=F,I=F}if(B!==undefined&&B.constructor!=Number){var D=/^\-\=/.test(B),C=/^\+\=/.test(B);if(D||C){B=this.value(null,"x")+this._round(B.replace(D?"=":"+=",""))}else{B=isNaN(this._round(B))?undefined:this._round(B)}}if(I!==undefined&&I.constructor!=Number){var D=/^\-\=/.test(I),C=/^\+\=/.test(I);if(D||C){I=this.value(null,"y")+this._round(I.replace(D?"=":"+=",""))}else{I=isNaN(this._round(I))?undefined:this._round(I)}}if(H.axis!="vertical"&&B!==undefined){if(H.stepping.x){B=this._round(B/H.stepping.x)*H.stepping.x}B=this._translateValue(B,"x");B=this._translateLimits(B,"x");B=this._translateRange(B,"x");H.animate?this.currentHandle.stop().animate({left:B},(Math.abs(parseInt(this.currentHandle.css("left"),10)-B))*(!isNaN(parseInt(H.animate,10))?H.animate:5)):this.currentHandle.css({left:B})}if(H.axis!="horizontal"&&I!==undefined){if(H.stepping.y){I=this._round(I/H.stepping.y)*H.stepping.y}I=this._translateValue(I,"y");I=this._translateLimits(I,"y");I=this._translateRange(I,"y");H.animate?this.currentHandle.stop().animate({top:I},(Math.abs(parseInt(this.currentHandle.css("top"),10)-I))*(!isNaN(parseInt(H.animate,10))?H.animate:5)):this.currentHandle.css({top:I})}if(this.rangeElement){this._updateRange()}this.currentHandle.data("mouse").sliderValue={x:this._round(this._convertValue(B,"x"))||0,y:this._round(this._convertValue(I,"y"))||0};if(!G){this._propagate("start",null);this._propagate("slide",null);this._propagate("stop",null);this._propagate("change",null)}},_propagate:function(C,B){A.ui.plugin.call(this,C,[B,this.ui()]);this.element.triggerHandler(C=="slide"?C:"slide"+C,[B,this.ui()],this.options[C])},plugins:{},ui:function(B){return{options:this.options,handle:this.currentHandle,value:this.options.axis!="both"||!this.options.axis?this._round(this.value(null,this.options.axis=="vertical"?"y":"x")):{x:this._round(this.value(null,"x")),y:this._round(this.value(null,"y"))},range:this._getRange()}}});A.extend(A.ui.slider,{getter:"value",version:"1.6",defaults:{animate:false,distance:1,handle:".ui-slider-handle",round:true}})})(jQuery);/*\r
+ * jQuery UI Tabs 1.6\r
+ *\r
+ * Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)\r
+ * Dual licensed under the MIT (MIT-LICENSE.txt)\r
+ * and GPL (GPL-LICENSE.txt) licenses.\r
+ *\r
+ * http://docs.jquery.com/UI/Tabs\r
+ *\r
+ * Depends:\r
+ *     ui.core.js\r
+ */\r(function(A){A.widget("ui.tabs",{_init:function(){this._tabify(true)},destroy:function(){var B=this.options;this.element.unbind(".tabs").removeClass(B.navClass).removeData("tabs");this.$tabs.each(function(){var C=A.data(this,"href.tabs");if(C){this.href=C}var D=A(this).unbind(".tabs");A.each(["href","load","cache"],function(E,F){D.removeData(F+".tabs")})});this.$lis.add(this.$panels).each(function(){if(A.data(this,"destroy.tabs")){A(this).remove()}else{A(this).removeClass([B.selectedClass,B.deselectableClass,B.disabledClass,B.panelClass,B.hideClass].join(" "))}});if(B.cookie){this._cookie(null,B.cookie)}},_setData:function(B,C){if((/^selected/).test(B)){this.select(C)}else{this.options[B]=C;this._tabify()}},length:function(){return this.$tabs.length},_tabId:function(B){return B.title&&B.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+A.data(B)},_sanitizeSelector:function(B){return B.replace(/:/g,"\\:")},_cookie:function(){var B=this.cookie||(this.cookie="ui-tabs-"+A.data(this.element[0]));return A.cookie.apply(null,[B].concat(A.makeArray(arguments)))},_tabify:function(N){this.$lis=A("li:has(a[href])",this.element);this.$tabs=this.$lis.map(function(){return A("a",this)[0]});this.$panels=A([]);var O=this,C=this.options;this.$tabs.each(function(Q,P){if(P.hash&&P.hash.replace("#","")){O.$panels=O.$panels.add(O._sanitizeSelector(P.hash))}else{if(A(P).attr("href")!="#"){A.data(P,"href.tabs",P.href);A.data(P,"load.tabs",P.href);var S=O._tabId(P);P.href="#"+S;var R=A("#"+S);if(!R.length){R=A(C.panelTemplate).attr("id",S).addClass(C.panelClass).insertAfter(O.$panels[Q-1]||O.element);R.data("destroy.tabs",true)}O.$panels=O.$panels.add(R)}else{C.disabled.push(Q+1)}}});if(N){this.element.addClass(C.navClass);this.$panels.addClass(C.panelClass);if(C.selected===undefined){if(location.hash){this.$tabs.each(function(Q,P){if(P.hash==location.hash){C.selected=Q;return false}})}else{if(C.cookie){var I=parseInt(O._cookie(),10);if(I&&O.$tabs[I]){C.selected=I}}else{if(O.$lis.filter("."+C.selectedClass).length){C.selected=O.$lis.index(O.$lis.filter("."+C.selectedClass)[0])}}}}C.selected=C.selected===null||C.selected!==undefined?C.selected:0;C.disabled=A.unique(C.disabled.concat(A.map(this.$lis.filter("."+C.disabledClass),function(Q,P){return O.$lis.index(Q)}))).sort();if(A.inArray(C.selected,C.disabled)!=-1){C.disabled.splice(A.inArray(C.selected,C.disabled),1)}this.$panels.addClass(C.hideClass);this.$lis.removeClass(C.selectedClass);if(C.selected!==null){this.$panels.eq(C.selected).removeClass(C.hideClass);var E=[C.selectedClass];if(C.deselectable){E.push(C.deselectableClass)}this.$lis.eq(C.selected).addClass(E.join(" "));var J=function(){O._trigger("show",null,O.ui(O.$tabs[C.selected],O.$panels[C.selected]))};if(A.data(this.$tabs[C.selected],"load.tabs")){this.load(C.selected,J)}else{J()}}A(window).bind("unload",function(){O.$tabs.unbind(".tabs");O.$lis=O.$tabs=O.$panels=null})}else{C.selected=this.$lis.index(this.$lis.filter("."+C.selectedClass)[0])}if(C.cookie){this._cookie(C.selected,C.cookie)}for(var G=0,M;M=this.$lis[G];G++){A(M)[A.inArray(G,C.disabled)!=-1&&!A(M).hasClass(C.selectedClass)?"addClass":"removeClass"](C.disabledClass)}if(C.cache===false){this.$tabs.removeData("cache.tabs")}var B,H;if(C.fx){if(C.fx.constructor==Array){B=C.fx[0];H=C.fx[1]}else{B=H=C.fx}}function D(P,Q){P.css({display:""});if(A.browser.msie&&Q.opacity){P[0].style.removeAttribute("filter")}}var K=H?function(P,Q){Q.animate(H,H.duration||"normal",function(){Q.removeClass(C.hideClass);D(Q,H);O._trigger("show",null,O.ui(P,Q[0]))})}:function(P,Q){Q.removeClass(C.hideClass);O._trigger("show",null,O.ui(P,Q[0]))};var L=B?function(Q,P,R){P.animate(B,B.duration||"normal",function(){P.addClass(C.hideClass);D(P,B);if(R){K(Q,R,P)}})}:function(Q,P,R){P.addClass(C.hideClass);if(R){K(Q,R)}};function F(R,T,P,S){var Q=[C.selectedClass];if(C.deselectable){Q.push(C.deselectableClass)}T.addClass(Q.join(" ")).siblings().removeClass(Q.join(" "));L(R,P,S)}this.$tabs.unbind(".tabs").bind(C.event+".tabs",function(){var S=A(this).parents("li:eq(0)"),P=O.$panels.filter(":visible"),R=A(O._sanitizeSelector(this.hash));if((S.hasClass(C.selectedClass)&&!C.deselectable)||S.hasClass(C.disabledClass)||A(this).hasClass(C.loadingClass)||O._trigger("select",null,O.ui(this,R[0]))===false){this.blur();return false}C.selected=O.$tabs.index(this);if(C.deselectable){if(S.hasClass(C.selectedClass)){O.options.selected=null;S.removeClass([C.selectedClass,C.deselectableClass].join(" "));O.$panels.stop();L(this,P);this.blur();return false}else{if(!P.length){O.$panels.stop();var Q=this;O.load(O.$tabs.index(this),function(){S.addClass([C.selectedClass,C.deselectableClass].join(" "));K(Q,R)});this.blur();return false}}}if(C.cookie){O._cookie(C.selected,C.cookie)}O.$panels.stop();if(R.length){var Q=this;O.load(O.$tabs.index(this),P.length?function(){F(Q,S,P,R)}:function(){S.addClass(C.selectedClass);K(Q,R)})}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(A.browser.msie){this.blur()}return false});if(C.event!="click"){this.$tabs.bind("click.tabs",function(){return false})}},add:function(E,D,C){if(C==undefined){C=this.$tabs.length}var G=this.options;var I=A(G.tabTemplate.replace(/#\{href\}/g,E).replace(/#\{label\}/g,D));I.data("destroy.tabs",true);var H=E.indexOf("#")==0?E.replace("#",""):this._tabId(A("a:first-child",I)[0]);var F=A("#"+H);if(!F.length){F=A(G.panelTemplate).attr("id",H).addClass(G.hideClass).data("destroy.tabs",true)}F.addClass(G.panelClass);if(C>=this.$lis.length){I.appendTo(this.element);F.appendTo(this.element[0].parentNode)}else{I.insertBefore(this.$lis[C]);F.insertBefore(this.$panels[C])}G.disabled=A.map(G.disabled,function(K,J){return K>=C?++K:K});this._tabify();if(this.$tabs.length==1){I.addClass(G.selectedClass);F.removeClass(G.hideClass);var B=A.data(this.$tabs[0],"load.tabs");if(B){this.load(C,B)}}this._trigger("add",null,this.ui(this.$tabs[C],this.$panels[C]))},remove:function(B){var D=this.options,E=this.$lis.eq(B).remove(),C=this.$panels.eq(B).remove();if(E.hasClass(D.selectedClass)&&this.$tabs.length>1){this.select(B+(B+1<this.$tabs.length?1:-1))}D.disabled=A.map(A.grep(D.disabled,function(G,F){return G!=B}),function(G,F){return G>=B?--G:G});this._tabify();this._trigger("remove",null,this.ui(E.find("a")[0],C[0]))},enable:function(B){var C=this.options;if(A.inArray(B,C.disabled)==-1){return }var D=this.$lis.eq(B).removeClass(C.disabledClass);if(A.browser.safari){D.css("display","inline-block");setTimeout(function(){D.css("display","block")},0)}C.disabled=A.grep(C.disabled,function(F,E){return F!=B});this._trigger("enable",null,this.ui(this.$tabs[B],this.$panels[B]))},disable:function(C){var B=this,D=this.options;if(C!=D.selected){this.$lis.eq(C).addClass(D.disabledClass);D.disabled.push(C);D.disabled.sort();this._trigger("disable",null,this.ui(this.$tabs[C],this.$panels[C]))}},select:function(B){if(typeof B=="string"){B=this.$tabs.index(this.$tabs.filter("[href$="+B+"]")[0])}this.$tabs.eq(B).trigger(this.options.event+".tabs")},load:function(G,K){var L=this,D=this.options,E=this.$tabs.eq(G),J=E[0],H=K==undefined||K===false,B=E.data("load.tabs");K=K||function(){};if(!B||!H&&A.data(J,"cache.tabs")){K();return }var M=function(N){var O=A(N),P=O.find("*:last");return P.length&&P.is(":not(img)")&&P||O};var C=function(){L.$tabs.filter("."+D.loadingClass).removeClass(D.loadingClass).each(function(){if(D.spinner){M(this).parent().html(M(this).data("label.tabs"))}});L.xhr=null};if(D.spinner){var I=M(J).html();M(J).wrapInner("<em></em>").find("em").data("label.tabs",I).html(D.spinner)}var F=A.extend({},D.ajaxOptions,{url:B,success:function(P,N){A(L._sanitizeSelector(J.hash)).html(P);C();if(D.cache){A.data(J,"cache.tabs",true)}L._trigger("load",null,L.ui(L.$tabs[G],L.$panels[G]));try{D.ajaxOptions.success(P,N)}catch(O){}K()}});if(this.xhr){this.xhr.abort();C()}E.addClass(D.loadingClass);L.xhr=A.ajax(F)},url:function(C,B){this.$tabs.eq(C).removeData("cache.tabs").data("load.tabs",B)},ui:function(C,B){return{options:this.options,tab:C,panel:B,index:this.$tabs.index(C)}}});A.extend(A.ui.tabs,{version:"1.6",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,deselectable:false,deselectableClass:"ui-tabs-deselectable",disabled:[],disabledClass:"ui-tabs-disabled",event:"click",fx:null,hideClass:"ui-tabs-hide",idPrefix:"ui-tabs-",loadingClass:"ui-tabs-loading",navClass:"ui-tabs-nav",panelClass:"ui-tabs-panel",panelTemplate:"<div></div>",selectedClass:"ui-tabs-selected",spinner:"Loading&#8230;",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});A.extend(A.ui.tabs.prototype,{rotation:null,rotate:function(C,F){F=F||false;var B=this,E=this.options.selected;function G(){B.rotation=setInterval(function(){E=++E<B.$tabs.length?E:0;B.select(E)},C)}function D(H){if(!H||H.clientX){clearInterval(B.rotation)}}if(C){G();if(!F){this.$tabs.bind(this.options.event+".tabs",D)}else{this.$tabs.bind(this.options.event+".tabs",function(){D();E=B.options.selected;G()})}}else{D();this.$tabs.unbind(this.options.event+".tabs",D)}}})})(jQuery);
\ No newline at end of file
diff --git a/wrt/zouba/preview/script/lib/console.js b/wrt/zouba/preview/script/lib/console.js
new file mode 100644 (file)
index 0000000..e36eb9f
--- /dev/null
@@ -0,0 +1,121 @@
+//     for console support\r
+if ((typeof window.parent.console == 'undefined') || ( (/AppleWebKit/i.test(navigator.userAgent)) && !(/Version/i.test(navigator.userAgent))) ){\r
+       window.console = {\r
+       \r
+                       sprintf: function(args){\r
+                               if (typeof args == 'undefined') {\r
+                                       return null;\r
+                               }\r
+                               \r
+                               if (args.length < 1) {\r
+                                       return null;\r
+                               };\r
+                               \r
+                               if (typeof args[0] != 'string') {\r
+                                       return null;\r
+                               }\r
+                               \r
+                               if (typeof RegExp == 'undefined') {\r
+                                       return null;\r
+                               }\r
+                               \r
+                               if (args.length == 1) {\r
+                                       return args[0];\r
+                               }\r
+                               \r
+                               \r
+                               var str = args[0];\r
+                               var newString = args[0];\r
+                               var arr = new Array();\r
+                               var exp = new RegExp(/[^%](%)([a-zA-Z])/g);\r
+                               var match = null;\r
+                               var lastMatch = 0;\r
+                               var argPos = 1;\r
+                               while (match = exp.exec(str) && argPos < args.length) {\r
+                                       if (str[exp.lastIndex - 1] == "%") {\r
+                                               \r
+                                       }\r
+                                       else \r
+                                               if (str[exp.lastIndex - 1] == "d") {\r
+                                                       arr.push(str.substring(lastMatch, exp.lastIndex - 2));\r
+                                                       arr.push(args[argPos++]);\r
+                                               }\r
+                                               else \r
+                                                       if (str[exp.lastIndex - 1] == "i") {\r
+                                                               arr.push(str.substring(lastMatch, exp.lastIndex - 2));\r
+                                                               arr.push(args[argPos++]);\r
+                                                       }\r
+                                                       else \r
+                                                               if (str[exp.lastIndex - 1] == "f") {\r
+                                                                       arr.push(str.substring(lastMatch, exp.lastIndex - 2));\r
+                                                                       arr.push(args[argPos++]);\r
+                                                               }\r
+                                                               else \r
+                                                                       if (str[exp.lastIndex - 1] == "s") {\r
+                                                                               arr.push(str.substring(lastMatch, exp.lastIndex - 2));\r
+                                                                               arr.push(args[argPos++]);\r
+                                                                       }\r
+                                                                       else \r
+                                                                               if (str[exp.lastIndex - 1] != "%") {\r
+                                                                                       arr.push(str.substring(lastMatch, exp.lastIndex - 2));\r
+                                                                                       arr.push("\"");\r
+                                                                                       arr.push(args[argPos++]);\r
+                                                                                       arr.push("\"");\r
+                                                                               }\r
+                                       lastMatch = exp.lastIndex;\r
+                               }\r
+                               if (lastMatch < str.length) {\r
+                                       arr.push(str.substring(lastMatch, str.length));\r
+                               }\r
+                               while (argPos < args.length) {\r
+                                       arr.push(" ");\r
+                                       arr.push(args[argPos++]);\r
+                               }\r
+                               return arr.join("").replace(/\%\%/g,"%");\r
+                       },\r
+               error: function(){\r
+                       var errorStr = console.sprintf(arguments);\r
+                       if (errorStr) {\r
+                               _BRIDGE_REF.nokia.layout.log('error', errorStr);\r
+                       }\r
+               },\r
+               info: function(){\r
+                       var errorStr = console.sprintf(arguments);\r
+                       if (errorStr) {\r
+                               _BRIDGE_REF.nokia.layout.log('info', errorStr);\r
+                       }\r
+               },\r
+               warn: function(){\r
+                       var errorStr = console.sprintf(arguments);\r
+                       if (errorStr) {\r
+                               _BRIDGE_REF.nokia.layout.log('warn', errorStr);\r
+                       }\r
+               },\r
+               log: function(){\r
+                       var errorStr = console.sprintf(arguments);\r
+                       if (errorStr) {\r
+                               _BRIDGE_REF.nokia.layout.log('log', errorStr);\r
+                       }\r
+               },\r
+               debug: function(){\r
+                       var errorStr = console.sprintf(arguments);\r
+                       if (errorStr) {\r
+                               _BRIDGE_REF.nokia.layout.log('debug', errorStr);\r
+                       }\r
+               },\r
+               assert: function(){\r
+                       var errorStr = console.sprintf(arguments);\r
+                       if (errorStr) {\r
+                               //      @todo\r
+                       }\r
+               }\r
+       }\r
+       \r
+       //      enable the Console.\r
+       _BRIDGE_REF.nokia.layout._console_enabled = true;\r
+       _BRIDGE_REF.nokia.layout.render();\r
+\r
+}\r
+\r
+//     make TRUE console.js script loaded\r
+window.parent.NOKIA.scriptsLoaded.console = true;\r
diff --git a/wrt/zouba/preview/script/lib/device.js b/wrt/zouba/preview/script/lib/device.js
new file mode 100644 (file)
index 0000000..10b62f7
--- /dev/null
@@ -0,0 +1,544 @@
+/**
+ * device.js
+ * 
+ * Nokia Web Runtime Service API emulation 
+ * WRT v1.1
+ * 
+ * Copyright 2009 Nokia Corporation. All rights reserved.
+*/
+
+
+/**
+ * device object. entry point to device service API (SAPI)
+ */
+var device = {
+       /**
+        * device API public method
+        * 
+        * @method
+        * @param {string} provider Name of service provider, eg, "Service.Calendar"
+        * @param {string} Interface Name of interface, eg, "IDataSource"
+        * @return {Object} service object  
+        */
+       getServiceObject: function(provider, Interface){
+
+               if (!device.implementation.context)
+                       throw 'device implementation object not instantiated!'
+
+               if (device.implementation.options.enabled) 
+                       return device.implementation.getInterface(provider, Interface);
+               else {
+                       device.implementation.context.notify('device SAPI is disabled.');
+                       throw 'device not defined!';
+               }
+       }
+};
+
+
+
+/**
+ * implementation of device emulation mode
+ * 
+ * @param {String}             version - version number (default: current version)
+ * @return {Object}    returns new implementation context object 
+ * @constructor                
+ */
+device.implementation = function(version){
+
+       this.version = version || '';
+       
+       // set context to current object
+       device.implementation.context = this;   
+
+       var libpath = 'preview/script/lib/',
+               datapath = 'preview/data/';
+       
+       // load implementation files
+       // this is done async by the browser engine, so be aware of sync conditions!!
+       if (version == '1')
+               loadSAPI(libpath + 'sapi1/');
+       else if (!version)
+               loadSAPI();
+       else
+               throw 'unsuppported SAPI version!';
+       
+       function loadSAPI(path){
+               var path = path || (libpath + "sapi/");
+               
+               // load API
+               loadScript(path + "AppManager.js");
+               loadScript(path + "Calendar.js");
+               loadScript(path + "Contact.js");
+               loadScript(path + "Landmarks.js");
+               loadScript(path + "Location.js");
+               loadScript(path + "Logging.js");
+               loadScript(path + "MediaManagement.js");
+               loadScript(path + "Messaging.js");
+               loadScript(path + "Sensor.js");
+               loadScript(path + "SysInfo.js");
+               
+               // load sample data
+               loadScript(datapath + "appManager_data.js");
+               loadScript(datapath + "calendar_data.js");
+               loadScript(datapath + "contact_data.js");
+               loadScript(datapath + "landmarks_data.js");
+               loadScript(datapath + "location_data.js");
+               loadScript(datapath + "logging_data.js");
+               loadScript(datapath + "mediaManagement_data.js");
+               loadScript(datapath + "messaging_data.js");
+               loadScript(datapath + "sensor_data.js");
+               loadScript(datapath + "sysInfo_data.js");
+       }
+       
+       function loadScript(src){
+               var head = document.getElementsByTagName("head")[0] || document.documentElement, 
+                       script = document.createElement("script");
+               
+               script.type = "text/javascript";
+               script.src = src;
+               head.appendChild(script);
+       }
+};
+
+(function(){
+device.implementation.prototype = {
+       
+       /**
+        * Result object
+        * 
+        * object returned by API calls
+        * 
+        * @param {Object} value
+        * @param {Integer} code
+        * @param {String} msg
+        */
+       Result : function(value, code, msg){
+               return {
+                       ReturnValue     : value,
+                       ErrorCode       : code || 0,
+                       ErrorMessage: msg || undefined
+               };
+       },
+       
+       /**
+        * AsyncResult object
+        * 
+        * object returned by API calls with callbacks
+        * 
+        * @param {Integer} transaction id
+        * @param {Integer} code
+        * @param {String} msg
+        */
+       AsyncResult : function(id, code, msg){
+               return {
+                       TransactionID   : id,
+                       ErrorCode               : code || 0,
+                       ErrorMessage    : msg || undefined
+               };
+       },
+       /**
+        * ErrorResult object
+        * 
+        * object returned by API calls when error
+        * 
+        * @param {Integer} code
+        * @param {String} msg
+        */
+       ErrorResult : function(code, msg){
+               device.implementation.context.debug(code, msg);         
+               return {
+                       ErrorCode       : code || 0,
+                       ErrorMessage: msg || undefined
+               };
+       },
+       
+       /**
+        * Iterator object
+        * 
+        * object returned as ReturnValue by some API
+        * 
+        * @param {Array} data
+        */
+       Iterator : function(data){
+               var index = 0,
+                       data = data || [];
+               return {
+                       /**
+                        * reset
+                        */
+                       reset : function(){
+                               index = 0;
+                       },
+                       
+                       /**
+                       * getNext
+                       */
+                       getNext : function(){
+                               return index < data.length ? data[index++] : undefined;
+                       }
+               }
+       },
+       
+       
+       /**
+        * internal __methods__
+        */
+       
+       $break:         {}, // 'not implemented',
+       
+       debug: function() {
+               if (device.implementation.options.debug && window.console && console.log) 
+                       console.log(arguments);
+       },
+       
+       // notify developer of api action
+       notify: function(msg){
+               if (window.console && console.warn)
+                       console.warn('API Notice -- ' + msg);
+       },
+       
+       getData : function(provider){
+               if (!device.implementation.data[provider])
+                       throw "no data defined for provider '"+provider+"'";
+               
+               if (device.implementation.data[provider]['default'])
+                       return device.implementation.data[provider]['default'];
+               else 
+                       return device.implementation.data[provider]; 
+       },      
+       
+       getUniqueID : function(){
+               return Number(''+Number(new Date())+ Math.floor(1000*Math.random()));
+       },
+       
+       callAsync : function(object, method, criteria, callback, flag){
+               flag = flag || false;
+               var tid = setTimeout(function(){
+                       var result,
+                               eventCode = {completed:2, error:4, progress:9},
+                               code = eventCode.completed;
+                       try{
+                               // call method in object's context
+                               // flag is passed to trigger the method in case of mandatory callback arg
+                               if (flag)
+                                       result = method.call(object, criteria, null, flag);
+                               else
+                                       result = method.call(object, criteria);
+                       } 
+                       catch(e){
+                               code = eventCode.error;
+                       }
+                       callback(tid, code, result);
+                       
+               }, device.implementation.options.callbackDelay);
+               
+               return this.AsyncResult(tid);
+       },
+               
+       addListener : function(provider, eventType, criteria, callback, handler){
+               if (!device.implementation.listeners[provider])
+                       device.implementation.listeners[provider] = {};
+                       
+               var tid = this.getUniqueID();
+               device.implementation.listeners[provider][eventType] = {
+                       'criteria': criteria,
+                       'callback': callback,
+                       'handler': handler,
+                       'transactionID' : tid
+               };
+               return this.AsyncResult(tid);
+       },
+
+       /*
+        * specify either eventType or transactionID
+        * return true if found and removed
+        */
+       removeListener: function(provider, eventType, transactionID){
+               transactionID = transactionID || null;
+               if (transactionID) {
+                       var allEvents = device.implementation.listeners[provider];
+                       for (var i in allEvents) {
+                               var event = allEvents[i];
+                               if (event.transactionID == transactionID) {
+                                       device.implementation.listeners[provider][i] = null;
+                                       delete device.implementation.listeners[provider][i];
+                                       return true;
+                               }
+                       }
+               }
+               else 
+                       if (eventType &&
+                       this.hasListener(provider, eventType)) {
+                               device.implementation.listeners[provider][eventType] = null;
+                               delete device.implementation.listeners[provider][eventType];
+                               return true;
+                       }
+               return false;
+       },
+
+       hasListener: function(provider, eventType) {    
+               if (!device.implementation.listeners[provider]
+                       || !device.implementation.listeners[provider][eventType])
+                       return false;
+                               
+               return true;
+       },
+
+       // pluck object properties as array     
+       keys: function(obj) {
+               var keys = [];
+               for (var p in obj)
+                       keys.push(p);
+               return keys;
+       },
+       
+       // extend object properties 
+       extend: function(root, ext) {
+               for (var p in ext)
+                       root[p] = ext[p];
+               return root;
+       },
+       
+       // extended text string functionality 
+       _t: function(str){
+               
+               str = typeof str != 'undefined' ? String(str) : '';
+               return new StringEx(str);
+       }               
+};
+
+       /**
+        * extended String object (available only within device.implementation.context through _t() method)
+        */ 
+       var StringEx = function(str){
+               // define base String non-transferrable methods!
+               this.toString = function(){return str;};
+               this.valueOf = function(){return str.valueOf();};
+       };
+       StringEx.prototype = new String();
+
+       
+       /**
+        * simple sprintf-type functionality
+        * 
+        * "string {title} %s and %s and {here} ".arg({title:'T', here:'H'}, 1, 'there')"
+        * ==> string T 1 and there and H
+        * hash (if present) must be first argument
+        *
+        * @param {Object} [hash] optional hash to replace {tags}
+        * @param {String,Number} data for %s tags
+        * @return {String} original string with tags replaced   
+        */
+       StringEx.prototype.arg = function(){
+           var pattern = /\%s|\{\w+\}/g;
+           var args = arguments, 
+                       len = arguments.length, 
+                       hash = arguments[0],
+                       i = typeof hash == 'object' && !(hash instanceof String) ? 1 : 0;
+                       
+           return this.replace(pattern, function(capture){
+                       var key = capture != '%s' && capture.match(/\w+/);
+                       if (key)
+                               return hash && hash[key] ? hash[key] : capture;
+                       else            
+                               return i < len ? args[i++] : capture;
+               });
+       }
+       
+       /**
+        * trim whitespace from beginning and end of string
+        * @return {String} trimmed string
+        */
+       StringEx.prototype.trim = function(){
+               return this.replace(/^\s+/, '').replace(/\s+$/, '');
+       }
+       
+       /**
+        * capitalize string
+        * @return {String} capitalized string
+        */
+       StringEx.prototype.capitalize = function(){
+       return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+       }
+       
+})();
+
+
+/*
+ * device.implementation static (class) properties
+ */
+
+
+/**
+ * pointer to current instantiated device.implementation object.
+ * use to access device.implemenation namespace.
+ * 
+ * @see device.implementation 
+ */
+device.implementation.context = null;  
+
+
+/**
+ * emulation settings options
+ */
+device.implementation.options = {
+       
+       /**
+        * callback delay (msec)
+        * @property {Number} 
+        */
+       callbackDelay   : 1200,
+       
+       /**
+        * debug flag
+        * @property {Boolean} 
+        */
+       debug                   : false,
+       
+       /**
+        * enabled flag
+        * @property {Boolean} 
+        */
+       enabled                 : true
+};
+
+
+/**
+ * store of interfaces (objects) in the current device implementation.
+ * format: [provider][interface]
+ * 
+ * @property {Object} 
+ */
+device.implementation.interfaces = {};
+
+
+/**
+ * store of data objects defined for current implementation.
+ * data is added useing the loadData method. 
+ * 
+ * @property {Object} format depends on data
+ */
+device.implementation.data = {};
+
+
+/**
+ * store of event listeners
+ * format: [provider][eventType]
+ */
+device.implementation.listeners = {}; 
+
+
+/*
+ * device.implementation static (class) methods
+ */
+
+
+/**
+ * Add a service provider to device implementation
+ * 
+ * @param {string} provider Name of service provider, eg, "Service.Calendar"
+ * @param {string} Interface Name of interface, eg, "IDataService"
+ * @param {Object} serviceProvider Service object
+ * @return  none
+ */
+device.implementation.extend = function(provider, Interface, serviceProvider){
+
+       if (!device.implementation.interfaces[provider])
+               device.implementation.interfaces[provider] = {}; 
+       
+       device.implementation.interfaces[provider][Interface] = serviceProvider;
+};
+
+
+/**
+ * Internal implementation to return a service provider interface object
+ * 
+ * @param {String} provider  Service provider name 
+ * @param {String} Interface   Provider interface name
+ * @exception {String} exception thrown if provider or interface is not implemented 
+ * @return {Object} the service provider interface object or 'undefined'
+ */    
+device.implementation.getInterface = function(provider, Interface){
+               
+       if (device.implementation.interfaces[provider] 
+               && typeof device.implementation.interfaces[provider][Interface] == 'object') 
+       {
+               var service = new Object();
+               service[Interface] = device.implementation.interfaces[provider][Interface];
+               return service;
+       }
+       else
+               throw 'Error: unknown error'; 
+};
+
+
+/**
+ * Loads data to the data store
+ * 
+ * @param {String} provider  Service provider name 
+ * @param {String} type Data name/label
+ * @param {Function,Object,Array} dataFactory Function to generate the data object, or array/object
+ * @return none
+ */
+device.implementation.loadData = function(provider, type, dataFactory){
+
+       type = type || 'default';
+       if (!device.implementation.data[provider]) 
+               device.implementation.data[provider] = {};
+               
+       device.implementation.data[provider][type] = 
+               typeof dataFactory == 'function' 
+                       ? dataFactory()
+                       : dataFactory;
+};
+
+
+/**
+ * trigger an event listener
+ * 
+ * @param {String} provider Service provider name
+ * @param {String} eventType event type 
+ * @param {Variant} data ReturnValue for callback function 
+ */
+device.implementation.triggerListener = function(provider, eventType, data){
+
+       if (!device.implementation.context.hasListener(provider, eventType)) {
+               device.implementation.context.notify('no listener defined for provider=' + provider + ', eventType=' + eventType);
+               return;
+       }
+       var listener = device.implementation.listeners[provider][eventType];
+
+       // call the provider's handler
+       listener.handler(listener.transactionID, listener.criteria, listener.callback, data);
+}
+
+
+
+/*
+ * ERROR CODES
+ */
+device.implementation.ERR_SUCCESS                                      = 0;
+device.implementation.ERR_INVALID_SERVICE_ARGUMENT     = 1000;
+device.implementation.ERR_UNKNOWN_ARGUMENT_NAME                = 1001;
+device.implementation.ERR_BAD_ARGUMENT_TYPE                    = 1002;
+device.implementation.ERR_MISSING_ARGUMENT                     = 1003;
+device.implementation.ERR_SERVICE_NOT_SUPPORTED                = 1004;
+device.implementation.ERR_SERVICE_IN_USE                       = 1005;
+device.implementation.ERR_SERVICE_NOT_READY            = 1006;
+device.implementation.ERR_NO_MEMORY                                    = 1007;
+device.implementation.ERR_HARDWARE_NOT_AVAILABLE       = 1008;
+device.implementation.ERR_SEVER_BUSY                           = 1009;
+device.implementation.ERR_ENTRY_EXISTS                         = 1010;
+device.implementation.ERR_ACCESS_DENIED                                = 1011;
+device.implementation.ERR_NOT_FOUND                                    = 1012;
+device.implementation.ERR_UNKNOWN_FORMAT                       = 1013;
+device.implementation.ERR_GENERAL_ERROR                                = 1014;
+device.implementation.ERR_CANCEL_SUCCESS                       = 1015;
+device.implementation.ERR_SERVICE_TIMEDOUT                     = 1016;
+device.implementation.ERR_PATH_NOT_FOUND                       = 1017;
+
+
+
+// instantiate device imlementation
+new device.implementation();
+
diff --git a/wrt/zouba/preview/script/lib/loader.js b/wrt/zouba/preview/script/lib/loader.js
new file mode 100644 (file)
index 0000000..4026d93
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * Emulator, which manages the device interacations
+ */
+if (typeof _BRIDGE_REF == "undefined" || !_BRIDGE_REF) {
+
+       var _BRIDGE_REF = {
+               parent: window.parent || false,
+               nokia: window.parent.NOKIA || false,
+               sysInfoObject : null
+       };
+
+       _BRIDGE_REF.namespace = function(name){
+               var parts = name.split('.');
+               var current = _BRIDGE_REF;
+               for (var key in parts) {
+                       if (!current[parts[key]]) {
+                               current[parts[key]] = {};
+                       }
+                       current = current[parts[key]];
+               }
+       };
+       
+       /*
+        * _BRIDGE_REF.helper functions
+        */
+       _BRIDGE_REF.namespace('helper.loadScript');
+       _BRIDGE_REF.helper = {
+               path: document.location.pathname,
+               loadScript: function(path){
+                       var head = document.getElementsByTagName("head")[0] || document.documentElement;
+                       var script = document.createElement("script");
+                       
+                       script.type = "text/javascript";
+                       script.src = path;
+                       head.appendChild(script);
+               },
+               
+               addEvent: function(obj, type, fn){
+                       if (obj.addEventListener) {
+                               obj.addEventListener(type, fn, false);
+                       }
+                       else 
+                               if (obj.attachEvent) {
+                                       obj["e" + type + fn] = fn;
+                                       obj[type + fn] = function(){
+                                               obj["e" + type + fn](window.event);
+                                       }
+                                       obj.attachEvent("on" + type, obj[type + fn]);
+                               }
+               },
+               
+               getElementsLengthInObject : function(items){
+                       var count = 0;
+                       for (var i in items) 
+                               count++;
+                       
+                       return count;
+               },
+               
+               getBatteryStrength : function(){
+                       
+               },
+               
+               console : function(){
+                       if (!typeof window.console) {
+                               _BRIDGE_REF.helper.loadScript("preview/script/lib/console.js");
+                       }                       
+               }
+               
+       };
+       
+       
+       /*
+        Load Scripts
+        */
+       _BRIDGE_REF.helper.loadScript("preview/script/lib/widget.js");
+       _BRIDGE_REF.helper.loadScript("preview/script/lib/systeminfo.js");
+       _BRIDGE_REF.helper.loadScript("preview/script/lib/menu.js");
+       _BRIDGE_REF.helper.loadScript("preview/script/lib/menuItem.js");
+       _BRIDGE_REF.helper.loadScript("preview/script/lib/console.js");
+
+       //      Inject SAPI scripts     
+       if (_BRIDGE_REF.nokia) {
+               var wrtVersion = _BRIDGE_REF.nokia.helper.readCookie('_WRT_VERSION');
+               if ((typeof wrtVersion == 'undefined') || (wrtVersion == 'WRT 1.1')) {
+                       _BRIDGE_REF.nokia.version = 'WRT 1.1';
+                       _BRIDGE_REF.nokia.helper.createCookie('_WRT_VERSION', 'WRT 1.1');
+                       _BRIDGE_REF.helper.loadScript("preview/script/lib/device.js");
+               }
+               else {
+                       _BRIDGE_REF.nokia.version = 'WRT 1.0';
+               }
+       }
+       else {
+               _BRIDGE_REF.helper.loadScript("preview/script/lib/device.js");
+       }
+
+       /*
+        window native functions over-riding
+        */
+       if ( (typeof window.frameElement != 'undefined') && (typeof _BRIDGE_REF.nokia  != 'undefined') && window !== window.parent) {
+               //      alert
+               window.alert = function(msg){
+                       return window.parent.alert(msg);
+               };
+               
+               //      confirm
+               window.confirm = function(msg){
+                       return window.parent.confirm(msg);
+               };
+               
+               //      prompt
+               window.prompt = function(msg, str){
+                       return window.parent.prompt(msg, str)
+               };
+       }
+
+       //      make TRUE loader.js script loaded
+       window.parent.NOKIA.scriptsLoaded.loader = true;
+
+}
\ No newline at end of file
diff --git a/wrt/zouba/preview/script/lib/menu.js b/wrt/zouba/preview/script/lib/menu.js
new file mode 100644 (file)
index 0000000..bb3bd3c
--- /dev/null
@@ -0,0 +1,497 @@
+/**
+ * widget object constructor
+ * @param {void}
+ *     widget()
+ * @return {void}
+ */ 
+
+if (typeof window.menu == "undefined" || !window.menu) 
+{
+       window.menu = 
+       {
+               author : 'Nokia WRT Emulation Library',
+               items : [],
+               index : null,
+               isDimmed : false,       
+                       
+               //      Event triggers
+               onShow : null,
+               onRightSoftKeySelect : null,
+       };
+       
+       
+       /*
+               Function        :       menu.append()
+               Argument        :       MenuItem Object
+               Returns         :       Void
+               Description     :       Function appends MenuItem to a Menu Object
+       */
+       menu.append = function(MenuItem)
+       {
+               if(this.allowedTypeOf(MenuItem))
+               {
+                       var i;
+                       var flag = true;
+                       try{
+                       for(var key in this.items)
+                       {
+                               if(this.items[key].id == MenuItem.id)
+                               {       
+                                       flag = false; 
+                                       break; 
+                               }
+                       }} catch(e){ }
+                       if(flag)
+                       {
+                               //      MenuItem.parent = this;
+                               this.items[MenuItem.id] = MenuItem;
+                       }
+               }
+       }
+       
+       
+       /*
+               Function        :       menu.remove()
+               Argument        :       MenuItem Object
+               Returns         :       Void
+               Description     :       Function Remove the menuItem and its children from the container options menu.
+       */
+       menu.remove = function(MenuItem)
+       {
+               if(!this.allowedTypeOf(MenuItem))
+                       return false;
+       
+               var flag = false;
+               if (this.items.length) {
+                       for (var key in this.items) {
+                               if (this.items[key].id == MenuItem.id) {
+                                       flag = true;
+                                       break;
+                               }
+                       }
+               }
+               if(flag)
+               {
+                       this.items.splice(key, 1);
+               }
+       }
+       
+       /*
+               Function        :       menu.clear()
+               Argument        :       Void
+               Returns         :       Void
+               Description     :       Clears (deletes) all the menu items in the menupane.
+       */
+       menu.clear = function()
+       {
+               try
+               {
+                       this.items.splice(0, this.items.length);
+               }catch(e){}
+       }
+       
+       
+       /*
+               Function        :       Menu.getMenuItemById(id)
+               Argument        :       Integer
+               Returns         :       MenuItem Object
+               Description     :       Function get the MenuItem Object with the reference of id
+       */
+       menu.getMenuItemById = function(id)
+       {
+               var menuItemRef = menu.menuItemExhistsById(this, id, 0);
+               if(this.allowedTypeOf(menuItemRef))
+                       return menuItemRef;
+               else
+                       return undefined;
+       }
+       
+       
+       /*
+               Function        :       Menu.getMenuItemByName(name)
+               Argument        :       String
+               Returns         :       MenuItem Object
+               Description     :       Function get the MenuItem Object with the reference of String name
+       */
+       menu.getMenuItemByName = function(name)
+       {
+               var menuItemRef = menu.menuItemExhistsById(this, name, 1);
+       
+       //      if(menuItemRef !=null)
+               if(this.allowedTypeOf(menuItemRef))
+                       return menuItemRef;
+               else
+                       return undefined;
+       }
+       
+       /*
+               Function        :       Menu.setRightSoftkeyLabel()
+               Argument        :       String, Function
+               Returns         :       Void
+               Description     :       Set the label of the right soft key to str. This enables the default text 
+                                               to be changed from exit and a new function assigned by setting a callbackfunction
+       */
+
+       menu.setRightSoftkeyLabel = function(label, callback)
+       {
+               window.menu = this;
+               try
+               {
+                       if(typeof label != '' && !label)
+                               this.setExitToRsk();                    
+
+                       else if(typeof callback != 'function' && !callback)
+                               this.setExitToRsk();                    
+                       
+                       else if (_BRIDGE_REF.nokia.menu.setRsk(callback)) {
+                               _BRIDGE_REF.parent.$("#RskLabel > a")[0].innerHTML = label;
+                               _BRIDGE_REF.nokia.menu.rsk_label = label;
+                               _BRIDGE_REF.nokia.menu.rsk_event = callback;
+                               _BRIDGE_REF.nokia.menu.is_rsk_overridden = true;
+                       }
+                       else 
+                               this.setExitToRsk();
+
+               }catch(e){ 
+                       // alert(e);
+                }
+       }
+
+
+       menu.setExitToRsk = function()
+       {
+               this.onRightSoftKeySelect = null;
+
+               _BRIDGE_REF.nokia.menu.is_rsk_overridden = false;
+               _BRIDGE_REF.nokia.menu.rsk_label = '';
+               _BRIDGE_REF.nokia.menu.rsk_event = null;
+               _BRIDGE_REF.parent.$("#RskLabel > a")[0].innerHTML = 'Exit';
+
+               _BRIDGE_REF.nokia.menu.setRsk(function(){
+                       _BRIDGE_REF.nokia.menu.exit();
+               });
+       }
+       
+       /*
+               Function        :       Menu.showSoftkeys()
+               Argument        :       Void
+               Returns         :       Void
+               Description     :       Makes the softkeys visible. By default the softkeys are not visible
+       
+       */
+       menu.showSoftkeys = function()
+       {
+               /*
+                *  Shows showSoftkeys
+                */
+               _BRIDGE_REF.nokia.menu.softkeys_visibility = true;
+               _BRIDGE_REF.nokia.menu.showSoftKeys();
+       }
+       
+       /*
+               Function        :       Menu.hideSoftkeys()
+               Argument        :       Void
+               Returns         :       Void
+               Description     :       Makes the softkeys invisible. By default the softkeys are not visible. 
+       
+       */
+       menu.hideSoftkeys = function()
+       {
+               /*
+                *  Hide showSoftkeys
+                */
+               _BRIDGE_REF.nokia.menu.softkeys_visibility = false;
+               _BRIDGE_REF.nokia.menu.hideSoftKeys();
+       }
+       
+       
+       /*      
+        *  
+        * ----------------------------------------------------------------
+        * Exta Functionalities which helps to make main functions to work
+        * ----------------------------------------------------------------
+        *  
+       */
+       
+       menu.cancel = function()
+       {
+               _BRIDGE_REF.nokia.menu.cancel();
+       }
+       
+       menu.exit = function()
+       {
+               _BRIDGE_REF.nokia.menu.exit();
+       }
+       
+       
+       menu.triggeLSKEvent = function()
+       {
+               if(typeof(window.menu.onShow) == 'function')
+               {
+                               window.menu.onShow();
+               }
+               _BRIDGE_REF.parent.$('#softKeysPane').show();
+               this.show();
+       }
+       
+       menu.triggerEvent = function(MenuItemId)
+       {
+               try{
+                       var menuItemRef = this.menuItemExhistsById(this, MenuItemId, 0);
+                       if(menuItemRef != null)
+                       {
+                               if(typeof menuItemRef.onSelect == 'function')
+                                       menuItemRef.onSelect(MenuItemId);
+               
+                               if(_BRIDGE_REF.helper.getElementsLengthInObject(menuItemRef.items))
+                                       this.show(MenuItemId);
+                               else
+                                       this.cancel();
+
+                       }else
+                       {
+                               this.show();
+                       }
+               }
+               catch(e)
+               {
+                       alert('triggeEvent: '+MenuItemId+' >> '+e);
+               }
+       }
+       
+       menu.hasChild = function(parentId)
+       {
+               for(var i in this.items)
+               {
+                       if(this.items[i].parentId == parentId)
+                       {       
+                                return true;
+                       }
+               }
+               return false;
+       }
+       
+       
+       menu.allowedTypeOf = function(MenuItem)
+       {
+               try
+               {
+                       if( (typeof(MenuItem) == 'object') && (MenuItem.type == 'MenuItem'))
+                               return true;                    
+               }
+               catch(e)
+               {
+                       return false;
+               }
+       }
+       
+       menu.show = function(parentId)
+       {
+               try
+               {
+                       var menuItemsPane = _BRIDGE_REF.parent.$('#MenuItemsArea')
+                       menuItemsPane = menuItemsPane[0];
+                       
+                       menuItemsPane.innerHTML = '';
+                       
+                       var ul = document.createElement('ul');
+                       var ele = window.menu;
+
+                       if(typeof parentId != 'undefined' && typeof parentId == 'object')
+                       {
+                               if (typeof window.menu.onShow != null && typeof window.menu.onShow == 'function') {
+                                       window.menu.onShow();
+                               }
+                       }
+
+                       if(typeof parentId == 'number')
+                       {
+                               var tempRef = menu.menuItemExhistsById(ele, parentId, 0);
+       
+                               if(typeof parentId != 'undefined' && typeof tempRef != 'undefined')
+                                       ele = tempRef;
+                       }
+
+                       if(_BRIDGE_REF.helper.getElementsLengthInObject(ele.items))
+                       {
+                               for(var key in ele.items)
+                               {
+                                       if(!ele.items[key].isDimmed){
+                                               
+                                               try{
+                                                       ul.appendChild(menu.create_menuElement(ele.items[key]));
+                                               }catch(e){  }
+                                       }
+                               }
+                               if(typeof parentId == 'number' && _BRIDGE_REF.helper.getElementsLengthInObject(ele.items))
+                               {
+                                       if(ele.parent)
+                                               ul.appendChild(menu.create_normalMenuItem('Back', ele.parent.id));      
+                                       else
+                                               ul.appendChild(menu.create_normalMenuItem('Back', null));       
+                               }
+                               else
+                               {
+                                       ul.appendChild(menu.create_exitMenuItem());     
+                               }
+
+
+                               if(_BRIDGE_REF.helper.getElementsLengthInObject(ele.items) > 5)
+                                       menuItemsPane.style.overflowY = 'scroll';
+                               else
+                                       menuItemsPane.style.overflowY = 'hidden';
+
+                       }
+                       else
+                       {
+                               menuItemsPane.style.overflowY = 'hidden';
+                               ul.appendChild(menu.create_exitMenuItem());     
+                       }
+                       menuItemsPane.innerHTML = '<ul>'+ul.innerHTML+'</ul>';
+                       
+                       _BRIDGE_REF.nokia.menu.show();
+               }
+               catch(e)
+               {
+                       alert('menu.show: '+e);
+               }
+       }
+
+
+
+/*
+*
+*      HELPER FUNCTIONS
+*
+*/
+
+       menu.menuItemExhistsById = function(menuReference, value, argumentType)
+       {
+               var flag = null;
+               
+               for(var key in menuReference.items)
+               {
+                       if(!argumentType)
+                       {
+                               if(menuReference.items[key].id == value)
+                               {       
+                                       flag = true; 
+                                       break; 
+                               }
+                       }
+                       else
+                       {
+                               if(menuReference.items[key].name == value)
+                               {       
+                                       flag = true; 
+                                       break; 
+                               }
+                       }
+                       
+                       if(menuReference.items[key].items != undefined && menuReference.items[key].items.length)
+                       {
+                               var temp = this.menuItemExhistsById(menuReference.items[key], value, argumentType);
+                               if(temp)
+                                       return temp;
+                       }
+               }
+               if(flag)
+               {
+                       // crate a package and send it
+                       menuReference.items[key].index = key;
+                       return menuReference.items[key];
+               }
+               else
+                       return null;
+       }
+       
+       menu.create_menuElement = function(MenuItem) 
+       {
+               var listitem = document.createElement('li');
+               listitem.id = MenuItem.id;
+               listitem.setAttribute('onClick', 'javascript:NOKIA.emulator.child.menu.triggerEvent('+MenuItem.id+');');
+       
+           var anchor = document.createElement('a');
+               anchor.id = 'subMenuItem_'+MenuItem.id;
+               anchor.innerHTML = MenuItem.name;
+               if(_BRIDGE_REF.helper.getElementsLengthInObject(MenuItem.items))
+               {  
+                       anchor.className = 'subMenuItem';
+                       anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.show('+MenuItem.id+');');
+               }
+           listitem.appendChild(anchor);
+               return (listitem);
+       }
+       
+       menu.create_normalMenuItem = function(MenuTitle, index) 
+       {
+           var listitem = document.createElement('li');
+       
+           var anchor = document.createElement('a');
+               anchor.id = 'subMenuItem_BACK';
+               anchor.innerHTML = MenuTitle;
+       
+               if (MenuTitle == 'Back') {
+                       listitem.className = 'exitOrBackBtn';
+                       anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.triggerEvent(' + index + ');');
+               }
+               else 
+                       anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.triggerEvent(' + index + ');');
+           
+               listitem.appendChild(anchor);
+               return (listitem);
+       }
+       
+       menu.create_exitMenuItem = function() 
+       {
+           var listitem = document.createElement('li');
+               listitem.className = 'exitOrBackBtn';
+           var anchor = document.createElement('a');
+               anchor.id = 'subMenuItem_EXIT';
+               anchor.innerHTML = 'Exit';
+               anchor.setAttribute('href', 'javascript:NOKIA.emulator.child.menu.exit();');
+               listitem.setAttribute('onClick', 'javascript:NOKIA.emulator.child.menu.exit();');
+               
+           listitem.appendChild(anchor);
+               return (listitem);
+       }
+       
+       menu.triggeRSK = function()
+       {
+               try {
+                       if (window.menu) {
+                               if (childToParent_Reference.$('softKeysPane').style.display != 'none') {
+                                       if (window.menu.onRightSoftKeySelect != null) {
+                                               window.menu.onRightSoftKeySelect();
+                                               window.menu.cancel();
+                                       }
+                                       else {
+                                               window.menu.cancel();
+                                       }
+                               }
+                       }
+               }catch(e)
+               {
+                       alert(e);
+               }
+       }
+       
+       menu.triggeLSK = function()
+       {
+               if(window.menu)
+               {
+                       window.menu.show();
+                       if(typeof(window.menu.onShow) == 'function')
+                       {
+                               if(window.menu.onShow)
+                               {
+                                       window.menu.onShow();
+                               }
+                       }
+               }
+       }
+
+
+       //      make TRUE menu.js script loaded
+       window.parent.NOKIA.scriptsLoaded.menu = true;
+}
\ No newline at end of file
diff --git a/wrt/zouba/preview/script/lib/menuItem.js b/wrt/zouba/preview/script/lib/menuItem.js
new file mode 100644 (file)
index 0000000..2f6bc62
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+       Function        :       MenuItem()
+       Argument        :       Void
+       Returns         :       Void
+       Description     :       Constructor Function creates a Menu object to the WINDOW
+*/
+
+function MenuItem(name, id)
+{
+       this.id = id;
+       this.name = name;
+       this.isDimmed = false;
+       
+       this.items = [];
+       this.index = null;
+       this.parent = null;
+       this.type = 'MenuItem';
+       
+       
+       //      Event triggers
+       this.onSelect = null;
+}
+
+
+/*
+       Function        :       MenuItem.append(MenuItem)
+       Argument        :       Menu Object
+       Returns         :       Void
+       Description     :       Function appends childMenuItem to a MenuItem
+*/
+MenuItem.prototype.append = function(childMenuItem)
+{
+       if( (childMenuItem != null) && (childMenuItem.type == 'MenuItem'))
+       {
+               childMenuItem.parent = this;
+               this.items[childMenuItem.id] = childMenuItem;
+       }
+}
+
+
+/*
+       Function        :       MenuItem.remove()
+       Argument        :       Menu Object
+       Returns         :       Void
+       Description     :       Function Removes childMenuItem and its children from the parent menu item.
+*/
+MenuItem.prototype.remove = function(childMenuItem)
+{
+       if((childMenuItem != null) && (childMenuItem.type == 'MenuItem'))
+       {
+               var i = this.search(childMenuItem);
+               if(i > -1)
+                       this.items.splice(i, 1);
+       }
+}
+
+/*
+       Function        :       MenuItem.remove()
+       Argument        :       Menu Object
+       Returns         :       Void
+       Description     :       If flag is true the MenuItem is hidden and if flag is false the item is shown.
+*/
+MenuItem.prototype.setDimmed = function(flag)
+{
+       this.isDimmed = flag;
+}
+
+
+/*
+       Function        :       MenuItem.search()
+       Argument        :       MenuItem Object
+       Returns         :       Integer
+       Description     :       Function Replace oldMenuItem with newMenuItem
+*/
+MenuItem.prototype.search = function(MenuItem)
+{
+               var flag = false;
+               for(var i in this.items)
+               {
+                       if(this.items[i].id == MenuItem.id)
+                       {       
+                               flag = true; 
+                               break; 
+                       }
+               }
+               if(flag)
+                       return i;
+               else
+                       return -1;              
+}
+
+//     make TRUE menuItem.js script loaded
+window.parent.NOKIA.scriptsLoaded.menuItem = true;
diff --git a/wrt/zouba/preview/script/lib/sapi/AppManager.js b/wrt/zouba/preview/script/lib/sapi/AppManager.js
new file mode 100644 (file)
index 0000000..39682f2
--- /dev/null
@@ -0,0 +1,223 @@
+/**\r
+ * AppManager.js\r
+ * \r
+ * Nokia Web Runtime Service API emulation \r
+ * WRT v1.1\r
+ * \r
+ * Copyright 2009 Nokia Corporation. All rights reserved.\r
+*/\r
+\r
\r
+(function(){\r
+       \r
+       var provider = 'Service.AppManager',\r
+               Interface = 'IAppManager';\r
+\r
+       /**\r
+        * AppManager service\r
+        */\r
+       var AppManagerService = function(){\r
+               this.GetList    = __GetList;\r
+               this.LaunchApp  = __LaunchApp;\r
+               this.LaunchDoc  = __LaunchDoc;\r
+               this.Cancel     = __Cancel;\r
+       }\r
+\r
+       device.implementation.extend(provider, Interface, new AppManagerService() );\r
+\r
+\r
+       /******************************************************/        \r
+       /******************************************************/        \r
+       /******************************************************/        \r
+\r
+       var     context = device.implementation.context,\r
+               _t = context._t,\r
+               method = '',\r
+               result = false,\r
+               DBase = null;\r
+       \r
+       /**\r
+        * AppManager: GetList\r
+        * @param {Object} criteria\r
+        */\r
+       function __GetList(criteria){\r
+               if ((result = validator.apply('GetList', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (typeof criteria.Type == 'undefined') \r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);\r
+\r
+               if (!/^(Application|UserInstalledPackage)$/i.test(criteria.Type)) \r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);\r
+               \r
+               // check if a callback was provided\r
+               if (arguments.length > 1)\r
+                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.badAsync);\r
+               \r
+               var returnValue,\r
+                       filter = criteria.Filter || null;\r
\r
+               DBase = context.getData(provider);\r
+\r
+               if (criteria.Filter)\r
+                       context.notify(_t('%s:: GetList : filter not implemented in preview').arg(provider));\r
+\r
+               // Type = UserInstalledPackage\r
+               if (!/UserInstalledPackage/i.test(criteria.Type)){\r
+\r
+                       returnValue = context.Iterator( DBase[criteria.Type] || [] );\r
+\r
+               } else {\r
+               // Type = Application\r
+                       // @todo: apply filter criteria\r
+                       \r
+                       returnValue = context.Iterator( DBase[criteria.Type] || [] );\r
+               }\r
+\r
+               return context.Result(returnValue);\r
+       }\r
+                       \r
+       /**\r
+        * AppManager: LaunchApp\r
+        * @param {Object} criteria\r
+        * @param {function} callback function for async call (optional)\r
+        */\r
+       function __LaunchApp(criteria, callback){\r
+\r
+               if ((result = validator.apply('LaunchApp', arguments)) !== false)\r
+                       return result; \r
+               \r
+               if (typeof criteria.ApplicationID == 'undefined')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingAppID);\r
+\r
+               // app id must be in the form "s60uid://<appid>" where <appid> is \r
+               // what is returned by GetList.\r
+               var appId = criteria.ApplicationID;\r
+               \r
+               if (!/^s60uid:\/\/0x/i.test(appId))\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);\r
+       \r
+               if (criteria.CmdLind)\r
+                       context.notify(_t('%s:: LaunchApp : CmdLine not implemented in preview').arg(provider));\r
+\r
+               if (criteria.Options)\r
+                       context.notify(_t('%s:: LaunchApp : Options not implemented in preview').arg(provider));\r
+\r
+\r
+               if (typeof callback == 'function') {\r
+                       return context.callAsync(this, arguments.callee, criteria, callback);\r
+               }\r
+\r
+               appId = appId.replace(/^s60uid:\/\//i, '');     \r
+               DBase = context.getData(provider);\r
+\r
+               for(var type in DBase){\r
+                       for(var i in DBase[type]) {\r
+                               var item = DBase[type][i];\r
+                               if (item.Uid == appId) {\r
+                                       // found!\r
+                                       context.notify(_t('%s:: LaunchApp : application found & launched : id=%s').arg(provider, appId));\r
+                                       return context.ErrorResult(device.implementation.ERR_SUCCESS);\r
+                               }\r
+                       }\r
+               }\r
+               // if not found\r
+               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);\r
+       }\r
+                       \r
+       /**\r
+        * AppManager: LaunchDoc\r
+        * @param {Object} criteria\r
+        * @param {function} callback function for async call (optional)\r
+        */\r
+       function __LaunchDoc(criteria, callback){\r
+\r
+               if ((result = validator.apply('LaunchDoc', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (typeof criteria.Document == 'undefined' && typeof criteria.MimeType == 'undefined')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingDoc);\r
+\r
+               if (typeof criteria.Document != 'undefined' && !criteria.Document.DocumentPath)\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);\r
+\r
+               if (criteria.Options)\r
+                       context.notify(_t('%s:: LaunchDoc : Options not implemented in preview').arg(provider));\r
+\r
+               if (typeof callback == 'function') {\r
+                       return context.callAsync(this, arguments.callee, criteria, callback);\r
+               }\r
+\r
+               // nothing to launch in emulation, just notify user\r
+               context.notify(_t('%s:: LaunchDoc : document launched').arg(provider));\r
+               \r
+               if (criteria.Document)\r
+                       // return success\r
+                       return context.ErrorResult(device.implementation.ERR_SUCCESS);\r
+               else\r
+                       // for mimetype, return value name of document\r
+                       return context.Result('', device.implementation.ERR_SUCCESS);\r
+       }\r
+\r
+       \r
+\r
+       /**\r
+        * AppManager: Cancel\r
+        * @param {Object} criteria\r
+        */\r
+       function __Cancel(criteria){\r
+               method = 'Cancel';\r
+               if (!criteria || !criteria.TransactionID)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingTID);\r
+               \r
+               clearTimeout(criteria.TransactionID);\r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);\r
+       }\r
+\r
+\r
+       \r
+       /*******************************\r
+        * helper functions\r
+        *******************************/\r
+       \r
+       function error(code, msg /*, args...*/){\r
+\r
+               var args = ['AppManager',method].concat([].slice.call(arguments,2));\r
+               msg = msg ? _t().arg.apply(msg,args) : undefined;\r
+               return context.ErrorResult(code, msg);\r
+       }\r
+\r
+       /**\r
+        * validate common input arguments\r
+        * 'this' is string (object) name of calling function\r
+        * \r
+        * @param {arguments} arguments of calling function\r
+        * @return {Result} Result object if error, false if no error.\r
+        */\r
+       function validator() {\r
+               method = ''+this;\r
+               var     failed = false,\r
+                       criteria = arguments[0] || false;\r
+                       \r
+               if (!criteria || typeof criteria != 'object')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);\r
+\r
+               return failed;\r
+       }\r
+\r
+       /** \r
+        * error messages\r
+        * order of %s args: Service name, method name, parameter name \r
+        */\r
+       var msg = {\r
+               missingType             : '%s:%s:Content Type Missing',\r
+               badAsync                : 'AppManger:GetList:Asynchronous version of API is not supported',     // typo on device!\r
+               missingAppID    : '%s:%s:Application ID  Missing',      // double space between ID & missing!!\r
+               missingDoc              : '%s:%s:Document/MimeType Missing/value more than expected length ',\r
+               missingTID              : '%s:Incorrect TransactionID',\r
+               is_invalid              : '%s:%s:%s is invalid'\r
+       };\r
+               \r
+\r
+}) ()\r
+\r
diff --git a/wrt/zouba/preview/script/lib/sapi/Calendar.js b/wrt/zouba/preview/script/lib/sapi/Calendar.js
new file mode 100644 (file)
index 0000000..e96f564
--- /dev/null
@@ -0,0 +1,410 @@
+/**
+ * Calendar.js
+ * 
+ * Nokia Web Runtime Service API emulation 
+ * WRT v1.1
+ * 
+ * Copyright 2009 Nokia Corporation. All rights reserved.
+*/
+
+(function(){
+       
+       var provider = 'Service.Calendar' ,
+               Interface = 'IDataSource';
+
+       /**
+        * Calendar service
+        */
+       var CalendarService = function(){
+               this.GetList    = __GetList;
+               this.Add                = __Add;
+               this.Delete     = __Delete;
+               this.Import     = __Import;
+               this.Export     = __Export;
+               this.Cancel     = __Cancel;
+               this.RequestNotification = __RequestNotification;
+       }
+
+       device.implementation.extend(provider, Interface, new CalendarService() );
+
+
+       /******************************************************/        
+       /******************************************************/        
+       /******************************************************/        
+
+       var     context = device.implementation.context,
+               _t = context._t,
+               method = '',
+               result = false,
+               DBase = null,
+               default_calendar = 'C:Calendar';
+       
+       /**
+        * Calendar: GetList
+        * @param {Object} criteria
+        */
+       function __GetList(criteria){
+               if ((result = validator.apply('GetList', arguments)) !== false)
+                       return result; 
+
+               var returnValue = [], 
+                       match = null,
+                       filter = criteria.Filter || null;
+               DBase = context.getData(provider);
+
+               // Type = Calendar
+               if (!/CalendarEntry/i.test(criteria.Type)){
+                       var cals = [default_calendar];
+                       if (filter && filter.DefaultCalendar === false)
+                               cals = context.keys(DBase)
+
+                       returnValue = cals;
+
+               } else {
+               // Type = CalendarEntry
+                       var cal = default_calendar;
+                       if (filter && filter.CalendarName)
+                               cal = filter.CalendarName;
+                       
+                       if (!(cal in DBase))
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badCalendar);
+
+                       // filter by id or LocalId
+                       if (filter && (filter.id || filter.LocalId)) {
+                               var which = filter.id ? 'id' : 'LocalId', 
+                                       id = filter[which];
+                                       
+                               for (var i in DBase[cal]) {
+                                       if (id == DBase[cal][i][which]) {
+                                               returnValue.push(DBase[cal][i]);
+                                       }
+                               }
+                       }
+                       // filter by type 
+                       else if (filter && filter.Type && !/IncludeAll/i.test(filter.Type)) {
+                               for (var i in DBase[cal]) {
+                                       // match on type is case insensitive
+                                       if (filter.Type.toLowerCase() == DBase[cal][i].Type.toLowerCase()) {
+                                               returnValue.push(DBase[cal][i]);
+                                       }
+                               }
+                       }
+                       // unsupported filters 
+                       else if (filter 
+                               && (match = context.keys(filter).join().match(/StartRange|EndRange|SearchText/ig)) ) {
+                               context.notify(_t('%s:: GetList : filter %s not implemented in preview').arg(provider, match.join()));
+                       }
+                       // return everything 
+                       else {
+                               returnValue = DBase[cal];
+                       }
+               }
+
+               return context.Result(context.Iterator(returnValue));
+       }
+                       
+       /**
+        * Calendar: Add
+        * @param {Object} criteria
+        */
+       function __Add(criteria){
+               if ((result = validator.apply('Add', arguments)) !== false)
+                       return result; 
+               
+               var Item = criteria.Item || false; 
+               
+               DBase = context.getData(provider);
+
+               // Type = Calendar
+               if (!/CalendarEntry/i.test(criteria.Type)){
+
+                       if (!Item || !Item.CalendarName)
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.missingCalendar);
+                               
+                       var cal = Item.CalendarName;
+                       if (cal in DBase) {
+                               return error(device.implementation.ERR_ENTRY_EXISTS);
+                       }
+
+                       // @todo: validate calendar name <drive>:<name>
+                       // return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badCalendar);
+                       
+                       // create new calendar
+                       device.implementation.loadData(provider, cal, []);
+                       return error(device.implementation.ERR_SUCCESS);
+
+               } else {
+               // Type = CalendarEntry
+
+                       if (!Item)
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_missing, 'Item');
+                               
+                       var cal = Item.CalendarName || default_calendar;
+
+                       // if calendar doesn't exist and it's the default, create it
+                       if (!(cal in DBase) && cal == default_calendar)
+                               device.implementation.loadData(provider, cal, []);
+                       
+                       if (!(cal in DBase))
+                               return error(device.implementation.ERR_NOT_FOUND);
+
+                       // update existing item?
+                       if ('LocalId' in Item) {
+                               
+                               if (!Item.LocalId && Item.LocalId !== 0)
+                                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'LocalId');
+                               
+                               if ('InstanceStartTime' in Item)
+                                       context.notify(_t('%s:: Add : InstanceStartTime not implemented in preview.').arg(provider));
+
+                               // can't update id
+                               delete Item.id;
+                               
+                               //  search for and update item
+                               var found = false;
+                               for (var i in DBase[cal]) {
+                                       var entry = DBase[cal][i];
+                                       if (entry.LocalId == Item.LocalId) {
+                                               context.extend(entry, Item);
+                                               Item.id = entry.id;
+                                               found = true;
+                                               break;
+                                       }
+                               }
+                               if (!found)
+                                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'LocalId');
+
+                       } else {
+                       // add new item
+                               // generate new id and localId 
+                               // -- in calendar id's are string!
+                               Item.id = String(context.getUniqueID());
+                               Item.LocalId = String(context.getUniqueID());
+                               DBase[cal].push(Item);
+                       } 
+               } 
+               // return success
+               return context.Result(Item.id, device.implementation.ERR_SUCCESS);
+       }
+                       
+
+       /**
+        * Calendar: Delete
+        * @param {Object} criteria
+        * @param {function} callback function for async call (optional - valid only for CalendarEntry)
+        */
+       function __Delete(criteria, callback){
+               
+               if ((result = validator.apply('Delete', arguments)) !== false)
+                       return result; 
+
+               var Data = criteria.Data || false; 
+               if (!Data || typeof Data != 'object')
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'Data');
+               
+               // only sync call supported for Calendar
+               if (!/CalendarEntry/i.test(criteria.Type) && typeof callback == 'function')
+                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.noAsync);
+
+               DBase = context.getData(provider);
+               var cal = Data.CalendarName || default_calendar;                        
+               if (!(cal in DBase))
+                       return error(device.implementation.ERR_NOT_FOUND);
+               
+               // Type = Calendar
+               if (!/CalendarEntry/i.test(criteria.Type)) {
+                       // CalendarName is mandatory
+                       if (!Data.CalendarName)
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_missing, 'CalendarName');
+                                               
+                       DBase[cal] = null;
+                       delete DBase[cal];
+               }
+               else {
+               // Type = CalendarEntry
+
+                       if (!context.keys(Data).join().match(/IdList|LocalIdList|DeleteAll|StartRange|EndRange/ig))
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_missing, 'Data');
+
+                       if (typeof callback == 'function') {
+                               return context.callAsync(this, arguments.callee, criteria, callback);
+                       }
+
+                       var which = Data.IdList ? 'IdList' : 'LocalIdList',
+                               idList = Data[which] || false;
+                               
+                       if (idList) {
+                               //  search for and delete items
+                               for (var id in idList) {
+                                       id = idList[id];
+                                       for (var i in DBase[cal]) {
+                                               if (id == DBase[cal][i][which]) {
+                                                       DBase[cal].splice(i, 1);
+                                               }
+                                       }
+                               }
+                       }
+                       else if (Data.DeleteAll && Data.DeleteAll === true){
+                               delete DBase[cal];
+                               DBase[cal] = [];
+                       }
+
+                       if (Data.StartRange || Data.EndRange) {
+                               context.notify(_t('%s:: Delete : StartRange / EndRange not implemented in preview.').arg(provider));
+                       }
+               }
+               // return success
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);                          
+       }
+                       
+
+       /**
+        * Calendar: Import
+        * @param {Object} criteria
+        * @param {function} callback function for async call (optional)
+        */
+       function __Import(criteria, callback){
+
+               if ((result = validator.apply('Import', arguments)) !== false)
+                       return result; 
+
+               var Data = criteria.Data || false; 
+               if (!Data)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'Data');
+               
+               if (!Data.FileName)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'FileName');
+
+               if (!Data.Format)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'Format');
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               context.notify(_t('%s:: Import : not implemented in preview.').arg(provider));
+               var returnValue = context.Iterator([]);
+               return context.Result(returnValue, device.implementation.ERR_SUCCESS);          
+       }
+                       
+
+       /**
+        * Calendar: Export
+        * @param {Object} criteria
+        * @param {function} callback function for async call (optional)
+        */
+       function __Export(criteria, callback){
+
+               if ((result = validator.apply('Export', arguments)) !== false)
+                       return result; 
+
+               var Data = criteria.Data || false; 
+               if (!Data)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'Data');
+
+               if (!Data.Format)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.is_invalid, 'Format');
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+               context.notify(_t('%s:: Export : not implemented in preview.').arg(provider));
+               var returnValue = '';
+               return context.Result(returnValue, device.implementation.ERR_SUCCESS);          
+       }
+                       
+
+       /**
+        * Calendar: RequestNotification
+        * @param {Object} criteria
+        * @param {function} callback function for async call 
+        */
+       function __RequestNotification(criteria, callback){
+
+               if ((result = validator.apply('RequestNotification', arguments)) !== false)
+                       return result; 
+
+               if (typeof callback != 'function')
+                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.badAsync);
+
+               context.notify(_t('%s:: RequestNotification : not implemented in preview.').arg(provider));
+               var result = context.ErrorResult(device.implementation.ERR_SUCCESS);
+               result.TransactionID = 0;
+               return result;          
+       }
+                       
+
+       /**
+        * Calendar: Cancel
+        * @param {Object} criteria
+        */
+       function __Cancel(criteria){
+               method = 'Cancel';
+               if (!criteria || !criteria.TransactionID)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.missingTID);
+               
+               clearTimeout(criteria.TransactionID);
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);
+       }
+
+
+       
+       /*******************************
+        * helper functions
+        *******************************/
+       
+       function error(code, msg /*, args...*/){
+
+               var args = ['Calendar',method].concat([].slice.call(arguments,2));
+               msg = msg ? _t().arg.apply(msg,args) : undefined;
+               return context.ErrorResult(code, msg);
+       }
+
+       /**
+        * validate common input arguments
+        * 'this' is string (object) name of calling function
+        * 
+        * @param {arguments} arguments of calling function
+        * @return {Result} Result object if error, false if no error.
+        */
+       function validator() {
+               method = ''+this;
+               var     failed = false,
+                       criteria = arguments[0] || false;
+                       
+               if (!criteria)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);
+                       
+               if (typeof criteria != 'object' || typeof criteria.Type == 'undefined')
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);
+               
+               var TypeRE = /Import|Export|RequestNotification/i.test(method)
+                       ? /^CalendarEntry$/i
+                       : /^(Calendar|CalendarEntry)$/i;
+                
+               if (!TypeRE.test(criteria.Type)) 
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);
+               
+               return failed;
+       }
+
+       /** 
+        * error messages
+        * order of %s args: Service name, method name, parameter name 
+        */
+       var msg = {
+               badType                 : '%s : %s : Type is invalid',
+               badCalendar             : '%s : %s : CalendarName is invalid',
+               missingCalendar : '%s : %s : CalendarName is missing',
+               missingTID              : '%s : %s : TransactionID is missing',
+               badAsync                : '%s : %s : Invalid async parameters',
+               noAsync                 : '%s : %s : Async not supported',
+               is_missing              : '%s : %s : %s is missing',
+               is_invalid              : '%s : %s : %s is invalid'
+       };
+               
+
+}) ();
+
diff --git a/wrt/zouba/preview/script/lib/sapi/Contact.js b/wrt/zouba/preview/script/lib/sapi/Contact.js
new file mode 100644 (file)
index 0000000..32cf5ed
--- /dev/null
@@ -0,0 +1,407 @@
+/**
+ * Contact.js
+ * 
+ * Nokia Web Runtime Service API emulation 
+ * WRT v1.1
+ * 
+ * Copyright 2009 Nokia Corporation. All rights reserved.
+*/
+
+(function(){
+       
+       var provider = 'Service.Contact' ,
+               Interface = 'IDataSource';
+
+       /**
+        * Contact service
+        */
+       var ContactService = function(){
+               this.GetList    = __GetList;
+               this.Add                = __Add;
+               this.Delete     = __Delete;
+               this.Import     = __Import;
+               this.Export     = __Export;
+               this.Organise   = __Organise;
+               this.Cancel     = __Cancel;
+       }
+
+       device.implementation.extend(provider, Interface, new ContactService() );
+
+
+       /******************************************************/        
+       /******************************************************/        
+       /******************************************************/        
+
+       var     context = device.implementation.context,
+               _t = context._t,
+               method = '',
+               result = false,
+               DBase = null;
+       
+       /**
+        * Contact: GetList
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __GetList(criteria, callback){
+
+               if ((result = validator.apply('GetList', arguments)) !== false)
+                       return result; 
+       
+               if (!/^(Contact|Group|Database)$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType);
+       
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               var returnValue = [], 
+                       match = null,
+                       filter = criteria.Filter || null;
+               DBase = context.getData(provider);
+
+               // Type = Database
+               if (/Database/i.test(criteria.Type)){
+                       returnValue = DBase.Database;
+               } 
+               // Type = Group
+               else if (/Group/i.test(criteria.Type)){
+                       // filter by id
+                       if (filter && filter.id) {
+                               returnValue = findById(DBase.Group, filter.id);
+                               if (returnValue.length == 0)
+                                       return error(device.implementation.ERR_NOT_FOUND);
+                       }
+                       // return all groups 
+                       else {
+                               returnValue = DBase.Group;
+                       }
+               }                               
+               // Type = Contact
+               else if (/Contact/i.test(criteria.Type)){
+
+                       // filter by id
+                       if (filter && filter.id) {
+                               returnValue = findById(DBase.Contact, filter.id); 
+                               if (returnValue.length == 0)
+                                       return error(device.implementation.ERR_NOT_FOUND);
+                       }
+                       // return all contacts 
+                       else {
+                               returnValue = DBase.Contact;
+                       }
+
+                       // unsupported filters 
+                       if (filter 
+                               && (match = context.keys(filter).join().match(/SearchVal|DBUri/ig)) ) {
+                               context.notify(_t('%s:: GetList : filter %s not implemented in preview').arg(provider, match.join()));
+                       }
+                       // unsupported sort                     
+                       if (criteria.Sort) { 
+                               context.notify(_t('%s:: GetList : sort not implemented in preview').arg(provider));
+                       }
+               }
+               return context.Result(context.Iterator(returnValue));
+       }
+                       
+       /**
+        * Contact: Add
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __Add(criteria, callback){
+
+               if ((result = validator.apply('Add', arguments)) !== false)
+                       return result; 
+               
+               if (!/^(Contact|Group)$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType2);
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               DBase = context.getData(provider);
+               var Data = criteria.Data,
+                       item;
+
+               // unsupported!                 
+               if (Data.DBUri) {
+                       context.notify(_t('%s:: Add : Data.DBUri not implemented in preview').arg(provider));
+               }
+
+               // Type = Group
+               if (/Group/i.test(criteria.Type)){
+
+                       if (!Data.GroupLabel)
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.missingGroupLabel);
+
+                       // update
+                       if (Data.id) {
+                               returnValue = findById(DBase.Group, Data.id); 
+                               if (returnValue.length == 0)
+                                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);
+                               
+                               returnValue[0].GroupLabel = Data.GroupLabel;
+                               //@todo: group contents!?
+                       }
+                       // new
+                       else {
+                               item = context.extend({}, Data); 
+                               item.id = String(context.getUniqueID());
+                               DBase.Group.push(item);
+                       }
+               } 
+               // Type = Contact
+               else {
+                       // update
+                       if (Data.id) {
+                               returnValue = findById(DBase.Contact, Data.id); 
+                               if (returnValue.length == 0)
+                                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);
+                               
+                               context.extend(returnValue[0], Data); 
+                       }
+                       // new
+                       else {
+                               item = context.extend({}, Data); 
+                               item.id = String(context.getUniqueID());
+                               DBase.Contact.push(item);
+                       }
+               } 
+               // return success
+               return error(device.implementation.ERR_SUCCESS);
+       }
+                       
+
+       /**
+        * Contact: Delete
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __Delete(criteria, callback){
+               
+               if ((result = validator.apply('Delete', arguments)) !== false)
+                       return result; 
+
+               if (!/^(Contact|Group)$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType2);
+
+               var Data = criteria.Data;
+               if (!Data.IdList)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingIdList);
+               if (typeof Data.IdList != 'object')
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badIdList);
+               
+               DBase = context.getData(provider);
+               var type = criteria.Type;
+
+               // unsupported!                 
+               if (Data.DBUri) {
+                       context.notify(_t('%s:: Delete : Data.DBUri not implemented in preview').arg(provider));
+               }
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               // for both Group & Contact:
+               var i,j,id,item;
+               for (j in Data.IdList) {
+                       id = Data.IdList[j];
+                       for (i in DBase[type]) {
+                               item = DBase[type][i];
+                               if (id == item.id) {
+                                       DBase[type].splice(i, 1);
+                               }
+                       }
+               }
+               // return success
+               return error(device.implementation.ERR_SUCCESS);                                
+       }
+                       
+
+       /**
+        * Contact: Import
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __Import(criteria, callback){
+
+               if ((result = validator.apply('Import', arguments)) !== false)
+                       return result; 
+
+               if (!/^(Contact)$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType3);
+
+               var Data = criteria.Data;
+               if (!Data.SourceFile)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingSourceFile);
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               context.notify(_t('%s:: Import : not implemented in preview.').arg(provider));
+               return error(device.implementation.ERR_SUCCESS);                
+       }
+                       
+
+       /**
+        * Contact: Export
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __Export(criteria, callback){
+
+               if ((result = validator.apply('Export', arguments)) !== false)
+                       return result; 
+
+               if (!/^(Contact)$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType4);
+
+               var Data = criteria.Data;
+               if (!Data.DestinationFile)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingDestinationFile);
+
+               if (!Data.id)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingId);
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               context.notify(_t('%s:: Export : not implemented in preview.').arg(provider));
+               return error(device.implementation.ERR_SUCCESS);                
+       }
+                       
+
+       /**
+        * Contact: Organise
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __Organise(criteria, callback){
+
+               if ((result = validator.apply('Organise', arguments)) !== false)
+                       return result; 
+
+               if (!/^(Group)$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.badType5);
+
+               var Data = criteria.Data;
+               if (!Data.id)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingId2);
+
+               if (!Data.IdList)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingIdList);
+
+               if (typeof Data.IdList != 'object')
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badIdList);
+
+               if (!/^(Associate|Disassociate)$/i.test(criteria.OperationType))
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badOperationType);
+
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               context.notify(_t('%s:: Organise : not implemented in preview.').arg(provider));
+               return error(device.implementation.ERR_SUCCESS);                
+       }
+                       
+
+       /**
+        * Contact: Cancel
+        * @param {Object} criteria
+        */
+       function __Cancel(criteria){
+               method = 'Cancel';
+               if (!criteria || !criteria.TransactionID)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.missingTID);
+               
+               clearTimeout(criteria.TransactionID);
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);
+       }
+
+       
+       /*******************************
+        * helper functions
+        *******************************/
+       
+       function error(code, msg /*, args...*/){
+
+               var args = ['Contacts',method].concat([].slice.call(arguments,2));
+               msg = msg ? _t().arg.apply(msg,args) : undefined;
+               return context.ErrorResult(code, msg);
+       }
+
+       /**
+        * validate common input arguments
+        * 'this' is string (object) name of calling function
+        * 
+        * @param {arguments} arguments of calling function
+        * @return {Result} Result object if error, false if no error.
+        */
+       function validator() {
+               method = ''+this;
+               var     failed = false,
+                       criteria = arguments[0] || false;
+                       
+               if (!criteria || typeof criteria != 'object' || typeof criteria.Type == 'undefined')
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType, method);
+
+               if (method == 'GetList') return failed;
+
+               var Data = criteria.Data || false; 
+               if (!Data)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingData, method);
+               if (typeof Data != 'object')
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.badData);
+                
+               return failed;
+       }
+
+
+       function findById(dbase, id){
+               var result = [];
+               for (var i in dbase) {
+                       if (id == dbase[i]['id']) {
+                               result.push(dbase[i]);
+                       }
+               }
+               return result;
+       }
+
+       /** 
+        * error messages
+        * order of %s args: Service name, method name, parameter name 
+        */
+       var msg = {
+               missingType             : '%s : %s : Type is Missing',
+               badType                 : '%s: %s : Invalid value for Type, Must be Contact/Group/Database',
+               badType2                : '%s : %s : Invalid Type, must be Contact/Group',
+               badType3                : '%s : %s : Invalid Type,it must be Contact',
+               badType4                : '%s : %s : Invalid Type, it must be Contact',
+               badType5                : '%s : %s : Invalid Content Type, It must be Group',
+               badOperationType: '%s : %s : Invalid Operation Type',
+               missingGroupLabel: '%s : %s : Group Label is Missing',
+               missingTID              : 'Contact : Cancel : TransactionID is missing',        // not 'Contacts'!!
+               badAsync                : '%s : %s : Invalid async parameters',
+               missingData             : '%s : %s : %s data Missing',
+               badData                 : '%s : %s : Invalid Type of Data , Map is required',
+               missingIdList   : '%s : %s : List of Ids is missing',
+               badIdList               : '%s : %s : Type of IdList is wrong, List is required',
+               missingSourceFile: '%s : %s : Import Source Filename is Missing',
+               missingDestinationFile: '%s : %s : Export Destination Filename is Missing',
+               missingId               : '%s : %s : Contact Id to be exported is missing',
+               missingId2              : '%s : %s : GroupId is missing',
+               is_missing              : '%s : %s : %s is missing',
+               is_invalid              : '%s : %s : %s is invalid'
+       };
+               
+
+}) ()
+
diff --git a/wrt/zouba/preview/script/lib/sapi/Landmarks.js b/wrt/zouba/preview/script/lib/sapi/Landmarks.js
new file mode 100644 (file)
index 0000000..991dea3
--- /dev/null
@@ -0,0 +1,556 @@
+/**\r
+ * Landmarks.js\r
+ * \r
+ * Nokia Web Runtime Service API emulation \r
+ * WRT v1.1\r
+ * \r
+ * Copyright 2009 Nokia Corporation. All rights reserved.\r
+*/\r
+\r
\r
+(function(){\r
+       \r
+       var provider = 'Service.Landmarks',\r
+               Interface = 'IDataSource';\r
+\r
+       /**\r
+        * Landmark service\r
+        */\r
+       var LandmarkService = function(){\r
+               this.New                = __New;\r
+               this.GetList    = __GetList;\r
+               this.Add                = __Add;\r
+               this.Delete             = __Delete;             \r
+               this.Import     = __Import;\r
+               this.Export             = __Export;\r
+               this.Organise   = __Organise;\r
+               this.Cancel             = __Cancel;                             \r
+       }\r
+\r
+       device.implementation.extend(provider, Interface, new LandmarkService() );\r
+\r
+\r
+       /******************************************************/        \r
+       /******************************************************/        \r
+       /******************************************************/        \r
+\r
+       var     context = device.implementation.context,\r
+               _t = context._t,\r
+               method = '',\r
+               result = false,\r
+               DBase = null;\r
+\r
+       /**\r
+        * Landmarks: New\r
+        * @param {Object} criteria\r
+        */\r
+       function __New(criteria){\r
+               if ((result = validator.apply('New', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (typeof criteria.Type == 'undefined') \r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);\r
+\r
+               if (!/^(Landmark|Category)$/i.test(criteria.Type)) \r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);          \r
+               \r
+               var returnValue;\r
+               \r
+               if(criteria.Type == 'Landmark')\r
+               {\r
+                       returnValue = {\r
+                               'LandmarkName'          : '',\r
+                               'id'                            : '',\r
+                               'CategoryInfo'          : '',\r
+                               'LandmarkDesc'          : '',\r
+                               'LandmarkPosition'      : {\r
+                                                                               'Latitude'      : '',\r
+                                                                               'Longitude' : '',\r
+                                                                               'Altitude'      : '',\r
+                                                                               'HAccuracy' : '',\r
+                                                                               'VAccuracy' : '',\r
+                                                                               'VAccuracy' : ''\r
+                                                                         },\r
+                               'CoverageRadius'        : '',\r
+                               'IconFile'                      : '',\r
+                               'IconIndex'                     : '',\r
+                               'IconMaskIndex'         : '',\r
+                               'LandmarkFields'        : {\r
+                                                                               'Street'                : '',\r
+                                                                               'BuildingName'  : '',\r
+                                                                               'District'              : '',\r
+                                                                               'City'                  : '',\r
+                                                                               'AreaCode'              : '',\r
+                                                                               'Telephone'             : '',\r
+                                                                               'Country'               : ''\r
+                                                                         }\r
+                       };\r
+               }\r
+               else //Category\r
+               {\r
+                       returnValue = {\r
+                               'CategoryName'  : '',\r
+                               'id'                    : '',\r
+                               'GlobalId'              : '',\r
+                               'IconFile'              : '',\r
+                               'IconIndex'             : '',\r
+                               'IconMaskIndex' : ''\r
+                       };\r
+               }\r
+\r
+               return context.Result(returnValue);\r
+       }\r
+       \r
+       /**\r
+        * Landmarks: GetList\r
+        * @param {Object} criteria\r
+        * @param {Function} [callback] function for async call (optional)\r
+        */\r
+       function __GetList(criteria, callback){\r
+               \r
+               if ((result = validator.apply('GetList', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (typeof criteria.Type == 'undefined') \r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);\r
+\r
+               if (!/^(Landmark|Category|Database)$/i.test(criteria.Type)) \r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);\r
+\r
+               if (criteria.Filter)\r
+                       context.notify(_t('%s:: GetList : filter not implemented in preview').arg(provider));\r
+\r
+               if(criteria.Sort)\r
+                       context.notify(_t('%s:: GetList : Sort is not implemented in preview').arg(provider));\r
+\r
+               if (typeof callback == 'function') {\r
+                       return context.callAsync(this, arguments.callee, criteria, callback);\r
+               }\r
+               \r
+               var returnValue = [], \r
+                       match = null,\r
+                       filter = criteria.Filter || null;\r
\r
+               DBase = context.getData(provider);\r
+\r
+\r
+               if (/Database/i.test(criteria.Type)) {                          // Type = Database\r
+                       \r
+                       returnValue = context.Iterator( DBase.Database || [] );\r
+                       \r
+               } else if (/Landmark/i.test(criteria.Type)){            // Type = Landmark\r
+                       \r
+                       returnValue = context.Iterator( DBase[criteria.Type] || [] );\r
+                       \r
+               } else {                                                                                        // Type = Category\r
+               \r
+                       // @todo: apply filter criteria\r
+                       returnValue = context.Iterator( DBase[criteria.Type] || [] );\r
+               }\r
+               return context.Result(returnValue);\r
+       }\r
+\r
+       /**\r
+        * Landmarks: Add\r
+        * @param {Object} criteria\r
+        */\r
+       function __Add(criteria){\r
+               \r
+               if ((result = validator.apply('Add', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (!/^(Landmark|Category)$/i.test(criteria.Type))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);\r
+\r
+\r
+               var Data = criteria.Data || false; \r
+               if(!Data){\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingData);\r
+               }\r
+\r
+               DBase = context.getData(provider);\r
+               \r
+               // unsupported!                 \r
+               if (Data.DatabaseURI) {\r
+                       context.notify(_t('%s:: Add : Data.DatabaseURI not implemented in preview').arg(provider));\r
+               }\r
+               \r
+               var item;\r
+               \r
+               // Type = Landmark\r
+               if (/Landmark/i.test(criteria.Type)){\r
+\r
+                        if (!Data.LandmarkName)\r
+                               Data.LandmarkName="";\r
+                       \r
+                       var landmarkPos = Data.LandmarkPosition;\r
+                       if (typeof landmarkPos != 'undefined') {\r
+                               if ((typeof landmarkPos.Latitude == 'undefined' || typeof landmarkPos.Latitude != 'number') &&\r
+                                       (typeof landmarkPos.Longitude == 'undefined' || typeof landmarkPos.Longitude != 'number') &&\r
+                                       (typeof landmarkPos.Altitude == 'undefined' || typeof landmarkPos.Altitude != 'number') &&\r
+                                       (typeof landmarkPos.HAccuracy == 'undefined' || typeof landmarkPos.HAccuracy != 'number') &&\r
+                                       (typeof landmarkPos.VAccuracy == 'undefined' || typeof landmarkPos.VAccuracy != 'number')) {\r
+                                               \r
+                                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType);\r
+                               }\r
+                       }\r
+                       // update\r
+                       if (typeof Data.id != 'undefined') {\r
+                               if(typeof Data.id != 'string')\r
+                                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.invalidId);\r
+                               \r
+                               var retIndex = findById(DBase.Landmark, Data.id); \r
+                               if (retIndex == -1)\r
+                                       return error(device.implementation.ERR_NOT_FOUND);\r
+                               DBase.Landmark[retIndex] = Data;\r
+                               item = Data;\r
+                       }\r
+                       // new\r
+                       else {\r
+                               item = context.extend({}, Data); \r
+                               item.id = String(context.getUniqueID());\r
+                               DBase.Landmark.push(item);\r
+                       }\r
+               } else { // Type = Category\r
+//                     alert(typeof Data.CategoryName);\r
+\r
+                       //alert("Data.id : "+Data.id);\r
+                       // update\r
+                       if (typeof Data.id != 'undefined') {\r
+                               if(typeof Data.id != 'string')\r
+                                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.invalidId);\r
+       \r
+                               var retIndex = findById(DBase.Category, Data.id); \r
+                               if (retIndex == -1)\r
+                                       return error(device.implementation.ERR_NOT_FOUND);\r
+\r
+                               DBase.Category[retIndex] = Data;                                        \r
+                               item = Data;\r
+                       }\r
+                       // new\r
+                       else {\r
+                               if (typeof Data.CategoryName == 'undefined')\r
+                                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingCategoryName);      \r
+       \r
+                               if(typeof Data.CategoryName != 'string' || Data.CategoryName.length <= 0)\r
+                                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType);\r
+\r
+                               var retIndex = findByName(DBase.Category, Data.CategoryName); \r
+                               if (retIndex !=  -1)\r
+                                       return error(device.implementation.ERR_ENTRY_EXISTS);\r
+                                       \r
+                               item = context.extend({}, Data); \r
+                               item.id = String(context.getUniqueID());\r
+                               DBase.Category.push(item);\r
+                       }\r
+               } \r
+               // return success\r
+               return context.Result(item.id, device.implementation.ERR_SUCCESS);\r
+       }\r
+                       \r
+       /**\r
+        * Landmarks: Delete\r
+        * @param {Object} criteria\r
+        */\r
+       function __Delete(criteria){\r
+\r
+               if ((result = validator.apply('Delete', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (!/^(Landmark|Category)$/i.test(criteria.Type))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);\r
+\r
+               var Data = criteria.Data || false; \r
+               if(!Data){\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.missingData);\r
+               }\r
+\r
+               if (typeof Data.id == 'undefined') {\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingId);\r
+                       }\r
+\r
+               if (typeof Data.id != 'undefined' && typeof Data.id != 'string') {\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.invalidId);\r
+               }\r
+               if(Data.id.length <= 0 )\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.invalidId);\r
+                       \r
+               DBase = context.getData(provider);\r
+               \r
+               var type = criteria.Type;\r
+\r
+               // unsupported!                 \r
+               if (Data.DBUri) {\r
+                       context.notify(_t('%s:: Delete : Data.DBUri not implemented in preview').arg(provider));\r
+               }\r
+\r
+               // for both Landmark & Category:\r
+               var i,item;\r
+\r
+               for (i in DBase[type]) {\r
+                       item = DBase[type][i];\r
+                       if (Data.id == item.id) {\r
+                               DBase[type].splice(i, 1);\r
+                       }\r
+               }\r
+\r
+               // return success\r
+               return error(device.implementation.ERR_SUCCESS);                                \r
+       }\r
+               \r
+       /**\r
+        * Landmarks: Import\r
+        * @param {Object} criteria\r
+        */\r
+       function __Import(criteria){\r
+               \r
+               if ((result = validator.apply('Import', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (!/^(Landmark)$/i.test(criteria.Type))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);\r
+\r
+               context.notify(_t('%s:: Import : not implemented in preview.').arg(provider));\r
+\r
+               var Data = criteria.Data || false; \r
+               if(!Data)\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.missingData);\r
+\r
+               if (!Data.SourceFile)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingSourceFile);\r
+\r
+               if (!Data.MimeType)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingMimeType);\r
+\r
+               if (!/^(application\/vnd.nokia.landmarkcollection\+xml|application\/vnd.nokia.landmark\+wbxml)$/i.test(Data.MimeType))\r
+                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.invalidMime);\r
+\r
+               return error(device.implementation.ERR_SUCCESS);                \r
+       }\r
+                       \r
+\r
+       /**\r
+        * Landmarks: Export\r
+        * @param {Object} criteria\r
+        */\r
+       function __Export(criteria){\r
+\r
+               if ((result = validator.apply('Export', arguments)) !== false)\r
+                       return result; \r
+\r
+               context.notify(_t('%s:: Export : not implemented in preview.').arg(provider));\r
+               if (!/^(Landmark)$/i.test(criteria.Type))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);\r
+\r
+               var Data = criteria.Data || false; \r
+               if(!Data){\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.missingData);\r
+               }\r
+\r
+               if (!Data.DestinationFile)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingDestFile);\r
+                       \r
+               if (!Data.MimeType)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingMimeType);\r
+\r
+               if (!Data.IdList)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingIdList);\r
+\r
+               return error(device.implementation.ERR_SUCCESS);                \r
+       }\r
+                       \r
+\r
+       /**\r
+        * Landmarks: Organise\r
+        * @param {Object} criteria\r
+        */\r
+       function __Organise(criteria){\r
+\r
+               if ((result = validator.apply('Organise', arguments)) !== false)\r
+                       return result; \r
+\r
+               if (!/^(Landmark)$/i.test(criteria.Type))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);\r
+\r
+               var Data = criteria.Data || false; \r
+               if(!Data){\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.missingData);\r
+               }\r
+\r
+               if (!Data.id || Data.id == "")\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.invalidId);\r
+               \r
+               DBase = context.getData(provider);\r
+               var categories = DBase['Category'];\r
+               var landmarks  = DBase['Landmark'];\r
+               var found = false;\r
+               \r
+               \r
+               for(var i=0;i<categories.length;i++)\r
+               {\r
+                       var category = categories[i];\r
+                       if (category.id == Data.id) {\r
+                               found = true;\r
+                               break;\r
+                       }\r
+               }\r
+               if(!found)\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.invalidId);\r
+\r
+               try{\r
+                       if(!Data.IdList || Data.IdList.length <=0)\r
+                       {\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.invalidId);\r
+                       }\r
+               }catch(e){\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.invalidId);\r
+               }\r
+               \r
+               if (!/^(Associate|Disassociate)$/i.test(criteria.OperationType))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.invalidOpType);\r
+               \r
+               context.notify(_t('%s:: Organise : not implemented in preview.').arg(provider));\r
+               if(/^Associate$/i.test(criteria.OperationType))\r
+               {\r
+                       for(var i=0;i<landmarks.length;i++)\r
+                       {\r
+                               for(var j=0;j<Data.IdList.length;j++)\r
+                               {\r
+                                       if(landmarks[i] == Data.IdList[j])\r
+                                       {\r
+                                               if(!landmarks[i].CategoryInfo)\r
+                                               {\r
+                                                       landmarks[i].CategoryInfo = new Array();\r
+                                                       landmarks[i].CategoryInfo.push(Data.id);                                        \r
+                                               }\r
+                                               else{\r
+                                                       var landmark = landmarks[i];\r
+                                                       var found = false;\r
+                                                       for(var k=0;k<landmark.CategoryInfo.length;k++)\r
+                                                       {\r
+                                                               if(landmark.CategoryInfo[k] == Data.id)\r
+                                                                       found = true;\r
+                                                       }\r
+                                                       if(!found)\r
+                                                               landmark.CategoryInfo.push(Data.id);\r
+                                               }\r
+                                               \r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       for(var i=0;i<landmarks.length;i++)\r
+                       {\r
+                               for(var j=0;j<Data.IdList.length;j++)\r
+                               {\r
+                                       if(landmarks[i] == Data.IdList[j] && landmarks[i].CategoryInfo != undefined)\r
+                                       {\r
+                                               var landmark = landmarks[i];\r
+                                               for(var k=0;k<landmark.CategoryInfo.length;k++)\r
+                                               {\r
+                                                       if(landmark.CategoryInfo[k] == Data.id)\r
+                                                               landmark.CategoryInfo.splice(k,1);\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+               \r
+               return error(device.implementation.ERR_SUCCESS);                \r
+       }\r
+               \r
+\r
+       /**\r
+        * Landmarks: Cancel\r
+        * @param {Object} criteria\r
+        */\r
+       function __Cancel(criteria){\r
+               method = 'Cancel';\r
+               \r
+               if ((result = validator.apply('Cancel', arguments)) !== false)\r
+                       return result;          \r
+                       \r
+               if (!criteria.TransactionID)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingTID);\r
+               \r
+               clearTimeout(criteria.TransactionID);\r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);\r
+       }\r
+\r
+\r
+       \r
+       /*******************************\r
+        * helper functions\r
+        *******************************/\r
+       function error(code, msg /*, args...*/){\r
+\r
+               var args = ['Landmarks',method].concat([].slice.call(arguments,2));\r
+               msg = msg ? _t().arg.apply(msg,args) : undefined;\r
+               return context.ErrorResult(code, msg);\r
+       }\r
+\r
+       /**\r
+        * validate common input arguments\r
+        * 'this' is string (object) name of calling function\r
+        * \r
+        * @param {arguments} arguments of calling function\r
+        * @return {Result} Result object if error, false if no error.\r
+        */\r
+       function validator() {\r
+               method = ''+this;\r
+               var     failed = false,\r
+                       criteria = arguments[0] || false;\r
+                       \r
+               if (!criteria || typeof criteria != 'object')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);\r
+\r
+               return failed;\r
+       }\r
+       \r
+       function findById(dbase, id){\r
+               for (var i in dbase) {\r
+                       if (id == dbase[i]['id']) {\r
+                               return i;\r
+                       }\r
+               }\r
+               return -1;\r
+       }       \r
+\r
+       function findByName(dbase, name){\r
+               for (var i in dbase) {\r
+                       if (name == dbase[i]['CategoryName']) {\r
+                               return i;\r
+                       }\r
+               }\r
+               return -1;\r
+       }       \r
+\r
+\r
+       /** \r
+        * error messages\r
+        * order of %s args: Service name, method name, parameter name \r
+        */\r
+       var msg = {\r
+               missingType                     : '%s%s : Type is missing',\r
+               badType                         : '%s%s : Type is invalid',             \r
+               missingData                     : '%s%s : Type or Data is missing',\r
+               missingId                       : '%s%s : Id is missing',\r
+               invalidId                       : '%s%s : id is invalid',\r
+               missingLandmarkName     : '%s%s : Landmrak name Missing',\r
+               missingCategoryName     : '%s%s : CategoryName is missing',\r
+               missingSourceFile       : '%s%s : Import Source Filename is Missing',\r
+               missingMimeType         : '%s%s : MIME type for source file is Missing',\r
+               missingDestFile         : '%s%s : DestinationFile is missing',\r
+               invalidOpType           : '%s%s : OperationType is invalid',\r
+               missingIdList           : '%s%s : Id list is Missing',\r
+               missingTID                      : '%s%s : TransactionID is missing',\r
+               invalidMime                     : '%s%s : MimeType is missing',\r
+               msgNoMsg                        : '',\r
+               \r
+       };\r
+               \r
+\r
+}) ()\r
+\r
diff --git a/wrt/zouba/preview/script/lib/sapi/Location.js b/wrt/zouba/preview/script/lib/sapi/Location.js
new file mode 100644 (file)
index 0000000..99e1886
--- /dev/null
@@ -0,0 +1,523 @@
+/**\r
+ * Location.js\r
+ * \r
+ * Nokia Web Runtime Service API emulation \r
+ * WRT v1.1\r
+ * \r
+ * Copyright 2009 Nokia Corporation. All rights reserved.\r
+*/\r
+\r
\r
+(function(){\r
+       \r
+       var provider = 'Service.Location',\r
+               Interface = 'ILocation';\r
+\r
+       /**\r
+        * Landmark service\r
+        */\r
+       var LocationService = function(){\r
+               this.GetLocation                        = __GetLocation;\r
+               this.Trace                                      = __Trace;\r
+               this.Calculate                          = __Calculate;\r
+               this.CancelNotification         = __CancelNotification;         \r
+       }\r
+\r
+       device.implementation.extend(provider, Interface, new LocationService() );\r
+\r
+\r
+       /******************************************************/        \r
+       /******************************************************/        \r
+       /******************************************************/        \r
+\r
+       var     context = device.implementation.context,\r
+               _t = context._t,\r
+               method = '',\r
+               result = false,\r
+               DBase = null;\r
+\r
+\r
+       var transactionIds = new Array();\r
+       var tTransactionId = -1;\r
+       var isTraceInProgress = false;\r
+       var criteriaTrace;\r
+       var callbackTrace;\r
+\r
+       /**\r
+        * Landmarks: GetLocation\r
+        * @param {Object} criteria\r
+        */\r
+       function __GetLocation(criteria, callback, flag){       \r
+               method = "GetLocation";\r
+               //      Async call\r
+               flag = flag || false;\r
+\r
+               if (!criteria) {\r
+                       criteria = new Object();\r
+               }       \r
+               \r
+               if(typeof criteria.LocationInformationClass == "undefined")\r
+                       criteria.LocationInformationClass = "BasicLocationInformation"; // Default value of LocationInformationClass is "BasicLocationInformation" if not provided\r
+\r
+               var result = validateArgument('GetLocation',criteria);\r
+               if(result.ErrorCode != 0)\r
+                       return result;\r
+               \r
+               if (typeof callback == 'function') {\r
+                       \r
+                       var retVal = context.callAsync(this, arguments.callee, criteria, callback,true);\r
+                       transactionIds.push(retVal.TransactionID);  // all transaction ids are pushed on this variable, because CancelNotification function of SAPI doesn't take TransactioID as input\r
+                       return retVal;\r
+               }\r
+               \r
+               if(flag)\r
+               {\r
+                       transactionIds.shift();  // Remove oldest TransactionID(FIFO) (Async call)\r
+               }\r
+               \r
+               DBase = context.getData(provider);\r
+               var returnValue = DBase[criteria.LocationInformationClass];\r
+               locationNotify(criteria.Updateoptions);\r
+               return context.Result(returnValue);\r
+       }\r
+       \r
+       /**\r
+        * Location: Trace\r
+        * @param {Object} criteria\r
+        * @param {Function} callback function for async call\r
+        */\r
+       function __Trace(criteria, callback){\r
+               method = "Trace";\r
+\r
+               if (!criteria) {\r
+                       criteria = new Object();\r
+               }       \r
+               \r
+               if(typeof criteria.LocationInformationClass == "undefined")\r
+                       criteria.LocationInformationClass = "BasicLocationInformation"; // Default value of LocationInformationClass is "BasicLocationInformation" if not provided\r
+\r
+               if (typeof callback != 'function') { // callback should be valid function\r
+                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED,msg.msgCommandNotFound); \r
+               }\r
+               \r
+               var result = validateArgument('Trace',criteria);\r
+               if(result.ErrorCode != 0)\r
+                       return result;\r
+               \r
+               criteriaTrace = criteria;\r
+               callbackTrace = callback;\r
+               isTraceInProgress = true;\r
+               locationNotify(criteria.Updateoptions);\r
+\r
+               return traceCall(criteria,callback);\r
+       }\r
+\r
+       /**\r
+        * Location: Calculate\r
+        * @param {Object} criteria\r
+        */\r
+       function __Calculate(criteria){\r
+               method = "Calculate";\r
+               if(!criteria || !criteria.MathRequest)\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcMissingMathReq);\r
+                       \r
+               if(typeof criteria.MathRequest != "string" || (criteria.MathRequest != "FindDistance" && criteria.MathRequest != "FindBearingTo" && criteria.MathRequest != "MoveCoordinates")) // Error check for wrong MathRequest criteria\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcWrongTypeMathReq);\r
+                       \r
+               if(typeof criteria.DistanceParamSource != "object" || (typeof criteria.DistanceParamSource.Latitude != "number" || typeof criteria.DistanceParamSource.Longitude != "number" || typeof criteria.DistanceParamSource.Altitude != "number"))\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcMissingArgLocCord);\r
+\r
+               if(criteria.MathRequest == "FindDistance" || criteria.MathRequest == "FindBearingTo")\r
+               {\r
+                       if(typeof criteria.DistanceParamSource != "object" || (typeof criteria.DistanceParamDestination.Latitude != "number" || typeof criteria.DistanceParamDestination.Longitude != "number" || typeof criteria.DistanceParamDestination.Altitude != "number"))\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcMissingArgLocCord);\r
+                       if (criteria.MathRequest == "FindDistance") {\r
+                               var dist = LatLon.distHaversine(criteria.DistanceParamDestination.Latitude, criteria.DistanceParamDestination.Longitude, criteria.DistanceParamSource.Latitude, criteria.DistanceParamSource.Longitude)*1000;\r
+                               if (typeof criteria.DistanceParamDestination.Altitude == "number" && typeof criteria.DistanceParamSource.Altitude == "number") {\r
+                                       var delta = criteria.DistanceParamDestination.Altitude - criteria.DistanceParamSource.Altitude\r
+                                       dist = Math.sqrt(dist * dist + delta * delta);\r
+                               }\r
+                               return context.Result(dist);\r
+                       }\r
+                       else if (criteria.MathRequest == "FindBearingTo"){\r
+                               var bearing = LatLon.bearing( criteria.DistanceParamSource.Latitude, criteria.DistanceParamSource.Longitude,criteria.DistanceParamDestination.Latitude, criteria.DistanceParamDestination.Longitude);\r
+                               return context.Result(bearing);                         \r
+                       }\r
+               }\r
+               else if(criteria.MathRequest == "MoveCoordinates"){\r
+\r
+                       if(typeof criteria.MoveByThisDistance == "undefined")\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcMissingArgMoveDist);\r
+                       \r
+                       if(typeof criteria.MoveByThisBearing == "undefined")\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcMissingArgMoveBear);\r
+                       \r
+\r
+                       if(typeof criteria.MoveByThisDistance != "number")\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcWrongTypeMoveDist);\r
+                       \r
+                       if(typeof criteria.MoveByThisBearing != "number")\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCalcWrongTypeMoveBear);\r
+                       \r
+                       var latLon = new LatLon(criteria.DistanceParamSource.Latitude, criteria.DistanceParamSource.Longitude);\r
+                       var dlatLon = latLon.destPoint(criteria.MoveByThisBearing, criteria.MoveByThisDistance/1000);\r
+                       var retVal = new Object();\r
+                       retVal.Longitude = dlatLon.lon;\r
+                       retVal.Latitude = dlatLon.lat;\r
+                       retVal.Altitude = criteria.DistanceParamSource.Altitude;\r
+                       return context.Result(retVal);\r
+               }\r
+       }\r
+                       \r
+       /**\r
+        * Location: CancelNotification\r
+        * @param {Object} criteria\r
+        */\r
+       function __CancelNotification(criteria){\r
+               method = "Cancel";\r
+               if(!criteria)\r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT,msg.msgCancelMissingType);\r
+               \r
+               var arr = new Array();\r
+               var i = 0;\r
+               var key\r
+               for(key in criteria);\r
+                       arr[i++] = key;\r
+\r
+               if(!criteria.CancelRequestType && arr.length)\r
+                               return error(device.implementation.ERR_NOT_FOUND,msg.msgCancelMissingType);\r
+               \r
+               if(criteria.CancelRequestType != "GetLocCancel" && criteria.CancelRequestType != "TraceCancel")\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgCancelWrongType);\r
+               \r
+               if (criteria.CancelRequestType == "GetLocCancel") {\r
+                       for (var i = 0; i < transactionIds.length; i++) {\r
+                               clearTimeout(transactionIds[i])\r
+                       }\r
+               }\r
+               \r
+               if (criteria.CancelRequestType == "TraceCancel")\r
+               {\r
+                       isTraceInProgress = false;\r
+                       tTransactionId = -1;\r
+               }\r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);\r
+       }\r
+               \r
+\r
+\r
+       \r
+       /*******************************\r
+        * helper functions\r
+        *******************************/\r
+\r
+       /**\r
+        * Location: traceCall\r
+        * @param {} \r
+        * This function emulates repetitive trace calls,It calls specified callback function after every UpdateInterval untill \r
+        * CancelNotification is called\r
+        */\r
+       function traceCall(){\r
+               var tid = setTimeout(function(){\r
+               if(!isTraceInProgress)\r
+                       return;\r
+                       \r
+               DBase = context.getData(provider);\r
+               var returnValue = DBase[criteriaTrace.LocationInformationClass];\r
+               var result,\r
+                       eventCode = {completed:2, error:4, progress:9},\r
+               code = eventCode.completed;\r
+\r
+               callbackTrace(tTransactionId,code,context.Result(returnValue,0));\r
+               traceCall();\r
+               }, criteriaTrace.Updateoptions.UpdateInterval/1000);\r
+               if(tTransactionId == -1)\r
+                       tTransactionId = tid;\r
+               return context.AsyncResult(tTransactionId);\r
+       }\r
+\r
+       /**\r
+        * Location: validateArgument\r
+        * @param {string,object} callingMethod and criteria\r
+        * Validates arguments\r
+        */\r
+       function validateArgument(fun,criteria)\r
+       {\r
+               method = fun;\r
+               if(typeof criteria.Updateoptions != "undefined")\r
+               {\r
+                       if(typeof criteria.Updateoptions != "object") // Checking for error in UpdateOptions criteria\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationBadArg);\r
+                       \r
+                       if(typeof criteria.Updateoptions.UpdateInterval != "undefined" && typeof criteria.Updateoptions.UpdateInterval != "number")\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationWrongType);\r
+                       \r
+                       if(typeof criteria.Updateoptions.UpdateTimeOut != "undefined" && typeof criteria.Updateoptions.UpdateTimeOut != "number")       \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationWrongType);\r
+\r
+                       if(typeof criteria.Updateoptions.UpdateMaxAge != "undefined" && typeof criteria.Updateoptions.UpdateMaxAge != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationWrongType);\r
+\r
+                       if(typeof criteria.Updateoptions.PartialUpdates != "undefined" && typeof criteria.Updateoptions.PartialUpdates != "boolean")    \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationWrongType);\r
+\r
+                       if((typeof criteria.Updateoptions.UpdateInterval != "undefined" && criteria.Updateoptions.UpdateInterval  < 0) || \r
+                                       (typeof criteria.Updateoptions.UpdateTimeOut != "undefined" && criteria.Updateoptions.UpdateTimeOut  < 0) ||\r
+                                       (typeof criteria.Updateoptions.UpdateMaxAge != "undefined" && criteria.Updateoptions.UpdateMaxAge  < 0))\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationNegInt);\r
+\r
+                       if(typeof criteria.Updateoptions.UpdateTimeOut != "undefined" && typeof criteria.Updateoptions.UpdateInterval != "undefined" && criteria.Updateoptions.UpdateInterval > criteria.Updateoptions.UpdateTimeOut)\r
+                       {\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgNone);\r
+                       }\r
+\r
+                       /*if((typeof criteria.Updateoptions.UpdateTimeOut != "undefined" && criteria.Updateoptions.UpdateTimeOut <= 1000000))// || (typeof criteria.Updateoptions.UpdateInterval != "undefined" && criteria.Updateoptions.UpdateInterval <= 1000000))\r
+                       {\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgNone);\r
+                       }*/                             \r
+               }\r
+\r
+               if(typeof criteria.LocationInformationClass != "undefined" && criteria.LocationInformationClass != "BasicLocationInformation" && criteria.LocationInformationClass != "GenericLocationInfo") // checking for errors in LocationInformationClass criteria\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgGetLocationWrongCat);\r
+               \r
+               if (/^Trace$/i.test(fun)&&(!criteria.Updateoptions || typeof criteria.Updateoptions.UpdateInterval == "undefined")) {\r
+                       if(!criteria.Updateoptions)\r
+                       {\r
+                               criteria.Updateoptions = new Object();\r
+                       }\r
+                       criteria.Updateoptions.UpdateInterval = 1000000;  // Emulation only!! for convenience UpdateInterval is set to 1 second is not specified or if it less than 1 second\r
+                       context.notify("Using default UpdateInterval(1000000 micro seconds)"); \r
+               }\r
+               \r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS, "");\r
+               \r
+       }\r
+\r
+       /**\r
+        * Location: error\r
+        * @param {number,string} ErrorCode and ErrorString\r
+        * Replaces Error String with method name\r
+        */\r
+       function error(code, msg /*, args...*/){\r
+\r
+               var args = ['location',method].concat([].slice.call(arguments,2));\r
+               msg = msg ? _t().arg.apply(msg,args) : undefined;\r
+               return context.ErrorResult(code, msg);\r
+       }\r
+       \r
+       function locationNotify(updateoptions) {\r
+               if(!updateoptions)\r
+                       return;\r
+               if(typeof updateoptions.UpdateTimeOut != "undefined")\r
+                       context.notify(_t("%s:: %s : Updateoptions.UpdateTimeOut not implemented in preview").arg(provider, method));\r
+\r
+               if(typeof updateoptions.UpdateMaxAge != "undefined")\r
+                       context.notify(_t("%s:: %s : Updateoptions.UpdateMaxAge not implemented in preview").arg(provider, method));\r
+\r
+               if(typeof updateoptions.PartialUpdates != "undefined")\r
+                       context.notify(_t("%s:: %s : Updateoptions.PartialUpdates not implemented in preview").arg(provider, method));\r
+       }\r
+\r
+       /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */\r
+       /*  Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2009            */\r
+       /*      http://www.movable-type.co.uk/scripts/latlong.html                                                                                        */  \r
+       /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */\r
+       \r
+       /*\r
+        * Use Haversine formula to Calculate distance (in km) between two points specified by \r
+        * latitude/longitude (in numeric degrees)\r
+        *\r
+        * example usage from form:\r
+        *   result.value = LatLon.distHaversine(lat1.value.parseDeg(), long1.value.parseDeg(), \r
+        *                                       lat2.value.parseDeg(), long2.value.parseDeg());\r
+        * where lat1, long1, lat2, long2, and result are form fields\r
+        */\r
+       \r
+       \r
+       LatLon.distHaversine = function(lat1, lon1, lat2, lon2) {\r
+         var R = 6371; // earth's mean radius in km\r
+         var dLat = toRad(lat2-lat1);\r
+         var dLon = toRad(lon2-lon1);\r
+         lat1 = toRad(lat1), lat2 = toRad(lat2);\r
+       \r
+         var a = Math.sin(dLat/2) * Math.sin(dLat/2) +\r
+                 Math.cos(lat1) * Math.cos(lat2) * \r
+                 Math.sin(dLon/2) * Math.sin(dLon/2);\r
+         var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\r
+         var d = R * c;\r
+         return d;\r
+       }\r
+       \r
+       \r
+       /*\r
+        * ditto using Law of Cosines\r
+        */\r
+       LatLon.distCosineLaw = function(lat1, lon1, lat2, lon2) {\r
+         var R = 6371; // earth's mean radius in km\r
+         var d = Math.acos(Math.sin(toRad(lat1))*Math.sin(toRad(lat2)) +\r
+                           Math.cos(toRad(lat1))*Math.cos(toRad(lat2))*Math.cos(toRad(lon2-lon1))) * R;\r
+         return d;\r
+       }\r
+       \r
+       \r
+       /*\r
+        * calculate (initial) bearing between two points\r
+        *   see http://williams.best.vwh.net/avform.htm#Crs\r
+        */\r
+       LatLon.bearing = function(lat1, lon1, lat2, lon2) {\r
+         lat1 = toRad(lat1); lat2 = toRad(lat2);\r
+         var dLon = toRad(lon2-lon1);\r
+\r
+         var y = Math.sin(dLon) * Math.cos(lat2);\r
+         var x = Math.cos(lat1)*Math.sin(lat2) -\r
+                 Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon);\r
+         return toBrng(Math.atan2(y, x));\r
+       }\r
+       \r
+       \r
+       /*\r
+        * calculate destination point given start point, initial bearing (deg) and distance (km)\r
+        *   see http://williams.best.vwh.net/avform.htm#LL\r
+        */\r
+       LatLon.prototype.destPoint = function(brng, d) {\r
+         var R = 6371; // earth's mean radius in km\r
+         var lat1 = toRad(this.lat), lon1 = toRad(this.lon);\r
+         brng = toRad(brng);\r
+       \r
+         var lat2 = Math.asin( Math.sin(lat1)*Math.cos(d/R) + \r
+                               Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng) );\r
+         var lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1), \r
+                                      Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2));\r
+         lon2 = (lon2+Math.PI)%(2*Math.PI) - Math.PI;  // normalise to -180...+180\r
+       \r
+         if (isNaN(lat2) || isNaN(lon2)) return null;\r
+         return new LatLon(toDeg(lat2), toDeg(lon2));\r
+       }\r
+       \r
+       \r
+       /*\r
+        * construct a LatLon object: arguments in numeric degrees\r
+        *\r
+        * note all LatLong methods expect & return numeric degrees (for lat/long & for bearings)\r
+        */\r
+       function LatLon(lat, lon) {\r
+         this.lat = lat;\r
+         this.lon = lon;\r
+       }\r
+       \r
+       \r
+       /*\r
+        * represent point {lat, lon} in standard representation\r
+        */\r
+       LatLon.prototype.toString = function() {\r
+         return this.lat.toLat() + ', ' + this.lon.toLon();\r
+       }\r
+       \r
+       /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */\r
+       \r
+       // extend String object with method for parsing degrees or lat/long values to numeric degrees\r
+       //\r
+       // this is very flexible on formats, allowing signed decimal degrees, or deg-min-sec suffixed by \r
+       // compass direction (NSEW). A variety of separators are accepted (eg 3º 37' 09"W) or fixed-width \r
+       // format without separators (eg 0033709W). Seconds and minutes may be omitted. (Minimal validation \r
+       // is done).\r
+       \r
+       function parseDeg (str) {\r
+         if (!isNaN(str)) return Number(str);                 // signed decimal degrees without NSEW\r
+       \r
+         var degLL = str.replace(/^-/,'').replace(/[NSEW]/i,'');  // strip off any sign or compass dir'n\r
+         var dms = degLL.split(/[^0-9.]+/);                     // split out separate d/m/s\r
+         for (var i in dms) if (dms[i]=='') dms.splice(i,1);    // remove empty elements (see note below)\r
+         switch (dms.length) {                                  // convert to decimal degrees...\r
+           case 3:                                              // interpret 3-part result as d/m/s\r
+             var deg = dms[0]/1 + dms[1]/60 + dms[2]/3600; break;\r
+           case 2:                                              // interpret 2-part result as d/m\r
+             var deg = dms[0]/1 + dms[1]/60; break;\r
+           case 1:                                              // decimal or non-separated dddmmss\r
+             if (/[NS]/i.test(str)) degLL = '0' + degLL;       // - normalise N/S to 3-digit degrees\r
+             var deg = dms[0].slice(0,3)/1 + dms[0].slice(3,5)/60 + dms[0].slice(5)/3600; break;\r
+           default: return NaN;\r
+         }\r
+         if (/^-/.test(str) || /[WS]/i.test(str)) deg = -deg; // take '-', west and south as -ve\r
+         return deg;\r
+       }\r
+       // note: whitespace at start/end will split() into empty elements (except in IE)\r
+       \r
+       \r
+       /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */\r
+       \r
+       // extend Number object with methods for converting degrees/radians\r
+       \r
+       function toRad (deg) {  // convert degrees to radians\r
+         return deg * Math.PI / 180;\r
+       }\r
+       \r
+       function toDeg (rad) {  // convert radians to degrees (signed)\r
+         return rad * 180 / Math.PI;\r
+       }\r
+       \r
+       function toBrng (rad) {  // convert radians to degrees (as bearing: 0...360)\r
+         return (toDeg(rad)+360) % 360;\r
+       }\r
+       \r
+       \r
+       /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */\r
+       \r
+       // extend Number object with methods for presenting bearings & lat/longs\r
+       \r
+       function toDMS (num) {  // convert numeric degrees to deg/min/sec\r
+         var d = Math.abs(num);  // (unsigned result ready for appending compass dir'n)\r
+         d += 1/7200;  // add ½ second for rounding\r
+         var deg = Math.floor(d);\r
+         var min = Math.floor((d-deg)*60);\r
+         var sec = Math.floor((d-deg-min/60)*3600);\r
+         // add leading zeros if required\r
+         if (deg<100) deg = '0' + deg; if (deg<10) deg = '0' + deg;\r
+         if (min<10) min = '0' + min;\r
+         if (sec<10) sec = '0' + sec;\r
+         return deg + '\u00B0' + min + '\u2032' + sec + '\u2033';\r
+       }\r
+       \r
+       function toLat (deg) {  // convert numeric degrees to deg/min/sec latitude\r
+         return toDMS(deg).slice(1) + (deg<0 ? 'S' : 'N');  // knock off initial '0' for lat!\r
+       }\r
+       \r
+       function toLon (deg) {  // convert numeric degrees to deg/min/sec longitude\r
+         return toDMS(deg) + (deg>0 ? 'E' : 'W');\r
+       }\r
+       \r
+       function toPrecision (num,fig) {  // override toPrecision method with one which displays \r
+         if (num == 0) return 0;                      // trailing zeros in place of exponential notation\r
+         var scale = Math.ceil(Math.log(num)*Math.LOG10E);\r
+         var mult = Math.pow(10, fig-scale);\r
+         return Math.round(num*mult)/mult;\r
+       }\r
+\r
+\r
+       /** \r
+        * error messages\r
+        * order of %s args: Service name, method name, parameter name \r
+        */\r
+       var msg = {\r
+               msgCommandNotFound                      : '%s : Command Not found',\r
+               msgGetLocationWrongCat          : '%s : %s : wrong category info should be BasicLocationInformation/GenericLocationInfo ',\r
+               msgGetLocationBadArg            : '%s : %s : BadArgument - Updateoptions',\r
+               msgGetLocationNegInt            : '%s : %s : Negative Time Interval',\r
+               msgGetLocationWrongType         : '%s : %s : UpdateOptions Type mismatch',\r
+               msgTraceWrongCat                        : '%s : %s : Invalid LocationInformationClass',\r
+               msgCalcMissingMathReq           : '%s : %s : Missing argument - MathRequest',\r
+               msgCalcWrongTypeMathReq         : '%s : %s : Wrong argument - MathRequest',\r
+               msgCalcMissingArgLocCord        : '%s : %s : Missing argument - locationcoordinate',\r
+               msgCalcMissingArgMoveDist       : '%s : %s : Missing argument - MoveByThisDistance',\r
+               msgCalcMissingArgMoveBear       : '%s : %s : Missing argument - MoveByThisBearing',\r
+               msgCalcWrongTypeMoveDist        : '%s : %s : TypeMismatch - MoveByThisDistance',\r
+               msgCalcWrongTypeMoveBear        : '%s : %s : TypeMismatch - MoveByThisBearing',\r
+               msgCancelBadArg                         : '%s : %s : BadArgument – cancel type',\r
+               msgCancelMissingType            : '%s : %s : Missing cancel type',\r
+               msgCancelWrongType                      : '%s : %s : Wrong cancel type' ,\r
+               msgNone                                         : ''    \r
+       };\r
+               \r
+\r
+}) ()\r
+\r
diff --git a/wrt/zouba/preview/script/lib/sapi/Logging.js b/wrt/zouba/preview/script/lib/sapi/Logging.js
new file mode 100644 (file)
index 0000000..d3589e8
--- /dev/null
@@ -0,0 +1,535 @@
+/**\r
+ * Logging.js\r
+ * \r
+ * Nokia Web Runtime Service API emulation \r
+ * WRT v1.1\r
+ * \r
+ * Copyright 2009 Nokia Corporation. All rights reserved.\r
+*/\r
+\r
\r
+(function(){\r
+       \r
+       var provider = 'Service.Logging',\r
+               Interface = 'IDataSource';\r
+\r
+       /**\r
+        * Landmark service\r
+        */\r
+       var LoggingService = function(){\r
+               this.Add                                        = __Add;\r
+               this.GetList                            = __GetList;\r
+               this.Delete                                     = __Delete;\r
+               this.RequestNotification        = __RequestNotification;                \r
+               this.Cancel                                     = __Cancel;             \r
+\r
+       }\r
+\r
+       device.implementation.extend(provider, Interface, new LoggingService() );\r
+\r
+\r
+       /******************************************************/        \r
+       /******************************************************/        \r
+       /******************************************************/        \r
+\r
+       var     context = device.implementation.context,\r
+               _t = context._t,\r
+               method = '',\r
+               result = false,\r
+               DBase = null;\r
+\r
+       var transactionIds = new Array();\r
+       var tTransactionId = -1;\r
+       var isTraceInProgress = false;\r
+       var criteriaReq;\r
+       var callbackReq;\r
+\r
+       /**\r
+        * Logging: Add\r
+        * @param {Object} criteria\r
+        * @param (function) callback\r
+        */\r
+       function __Add(criteria, callback, flag){\r
+               method = "Add";\r
+               //      Async call\r
+               flag = flag || false;\r
+\r
+               if (!flag) {\r
+                       var result = ValidateAdd(criteria, callback);\r
+                       if (result.ErrorCode != 0) \r
+                               return result;\r
+               }                       \r
+               \r
+               \r
+               if(typeof callback == 'function')\r
+               {\r
+                       return context.callAsync(this, arguments.callee, criteria, callback);\r
+               }\r
+               DBase = context.getData(provider);\r
+               var returnValue = DBase[criteria.Type];\r
+               criteria.Item.id =      GenerateRandomNumber()+'';\r
+               criteria.Item["EventTime"] = GetCurrDate();\r
+               returnValue.push(criteria.Item);\r
+               return context.Result(criteria.Item.id,0);\r
+       }\r
+\r
+       /**\r
+        * Logging: GetList\r
+        * @param {Object} criteria\r
+        * @param (function) callback\r
+        */\r
+       function __GetList(criteria, callback, flag){   \r
+               method = "GetList";\r
+               //      Async call\r
+               flag = flag || false;\r
+\r
+               if (!flag) {\r
+                       var result = ValidateGetList(criteria, callback);\r
+                       if (result.ErrorCode != 0) \r
+                               return result;\r
+               }                       \r
+               \r
+               \r
+               if(typeof callback == 'function')\r
+               {\r
+                       return context.callAsync(this, arguments.callee, criteria, callback);\r
+               }\r
+               if(criteria.Filter){\r
+                       context.notify(_t('%s:: GetList : filter not implemented in preview').arg(provider));\r
+               }\r
+                               \r
+               DBase = context.getData(provider);\r
+               var returnValue;\r
+               // @todo: apply filter criteria\r
+               returnValue = context.Iterator( DBase[criteria.Type] || [] );\r
+               \r
+               return context.Result(returnValue,0);\r
+       }\r
+\r
+       /**\r
+        * Logging: Delete\r
+        * @param {Object} criteria\r
+        * @param (function) callback\r
+        */\r
+       function __Delete(criteria, callback, flag){\r
+               method = "Delete";\r
+               //      Async call\r
+               flag = flag || false;           \r
+               if (!flag) {\r
+                       if (!criteria || !criteria.Type) \r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgTypeMissing);\r
+\r
+                       if (typeof criteria.Type != 'string') \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgTypeInvalid);\r
+                       \r
+                       if (criteria.Type != 'Log') \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgTypeInvalid);\r
+                       \r
+                       if (!criteria.Data) \r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgDataMissing);\r
+                       \r
+                       if(typeof criteria.Data != 'object')\r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgDataInvalid);\r
+\r
+                       if(typeof criteria.Data.id == 'undefined')\r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgid);\r
+                       \r
+                       if (typeof criteria.Data.id != "string") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgidInvalid);\r
+                               \r
+                       if(criteria.Data.id == '')\r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgidInvalid);\r
+               }\r
+               DBase = context.getData(provider);\r
+               var returnValue,found = false;\r
+               returnValue = DBase[criteria.Type];\r
+               for(var i=0; i<returnValue.length; i++){\r
+                       if(returnValue[i].id == criteria.Data.id)\r
+                       {\r
+                               found = true;\r
+                               returnValue.splice(i,1);\r
+                       }                       \r
+               }\r
+               if(!found)\r
+                       return error(device.implementation.ERR_NOT_FOUND, msg.msgidInvalid);\r
+               \r
+               return context.Result(undefined,0);\r
+       }\r
+\r
+       /**\r
+        * Logging: RequestNotification\r
+        * @param {Object} criteria\r
+        * @param (function) callback\r
+        */\r
+       function __RequestNotification(criteria, callback, flag){\r
+               method = "RequestNotification";\r
+               \r
+               //      Async call\r
+               flag = flag || false;           \r
+               if (!flag) {\r
+                       if (!criteria || !criteria.Type) \r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgTypeMissing);\r
+\r
+                       if (typeof criteria.Type != 'string') \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgTypeInvalid);\r
+                       \r
+                       if (criteria.Type != 'Log') \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgTypeInvalid);\r
+                       \r
+                       if (!criteria.Filter)\r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgFilterMissing);\r
+\r
+                       if(typeof criteria.Filter != 'object') \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgFilterInvalid);\r
+                       \r
+                       if(typeof criteria.Filter.DelayTime == 'undefined') \r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgDelayTimeMissing);\r
+                       \r
+                       if(typeof criteria.Filter.DelayTime != 'number')\r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgDelayTimeInvalid);\r
+                       if(criteria.Filter.DelayTime <= 0)\r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgDelayTimeInvalid);\r
+                       \r
+                       if(criteria.Filter.DelayTime < 1000000 )\r
+                       {\r
+                               criteria.Filter.DelayTime = 1000000;\r
+                               context.notify(_t('%s:: RequestNotification : Using DelayTime = 1000000').arg(provider));\r
+                       }\r
+               }\r
+               if(typeof callback != 'function')\r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgMissingCallback);\r
+\r
+               criteriaReq = criteria;\r
+               callbackReq = callback;\r
+               isTraceInProgress = true;\r
+\r
+               return notificationCall(criteria,callback);\r
+       }\r
+\r
+       /**\r
+        * Logging: Cancel\r
+        * @param {Object} criteria\r
+        * @param (function) callback\r
+        */\r
+       function __Cancel(criteria){\r
+                       method = "Cancel";\r
+                       if (!criteria || typeof criteria.TransactionID == 'undefined') \r
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgTransactionIdMissing);\r
+                       \r
+                       if (typeof criteria.TransactionID != 'number') \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgTransactionIdInvalid);\r
+                       \r
+                       clearTimeout(criteria.TransactionID);\r
+                       if (criteria.TransactionID == tTransactionId) {\r
+                               isTraceInProgress = false;\r
+                               tTransactionId = -1;\r
+                       }\r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);\r
+\r
+       }\r
+       \r
+\r
+       /**\r
+        * Location: error\r
+        * @param {number,string} ErrorCode and ErrorString\r
+        * Replaces Error String with method name\r
+        */\r
+       function error(code, msg /*, args...*/){\r
+\r
+               var args = ['Logging',method].concat([].slice.call(arguments,2));\r
+               msg = msg ? _t().arg.apply(msg,args) : undefined;\r
+               return context.ErrorResult(code, msg);\r
+       }\r
+       \r
+       /**\r
+        * Logging: notificationCall\r
+        * @param {} \r
+        * This function Calls callback function after given delay\r
+        */\r
+       function notificationCall(){\r
+               var tid = setTimeout(function(){\r
+               if(!isTraceInProgress)\r
+                       return;\r
+                       \r
+               DBase = context.getData(provider);\r
+               var returnValue;\r
+               returnValue = context.Iterator( DBase[criteriaReq.Type] || [] );\r
+\r
+               var result,\r
+                       eventCode = {completed:2, error:4, progress:9},\r
+               code = eventCode.completed;\r
+\r
+               callbackReq(tTransactionId,code,context.Result(returnValue,0));\r
+               //notificationCall();\r
+               }, criteriaReq.Filter.DelayTime/1000);\r
+               if(tTransactionId == -1)\r
+                       tTransactionId = tid;\r
+               return context.AsyncResult(tTransactionId);\r
+       }\r
+       \r
+       /**\r
+        * Helper functions\r
+        */\r
+\r
+       /**\r
+        * GenerateRandomNumber\r
+        * @param {}array of log data for getting unique ID \r
+        * \r
+        */\r
+       function GenerateRandomNumber(arr)\r
+       {\r
+               var randomnumber = Math.floor(Math.random() * 10001);\r
+               randomnumber +=200;\r
+               return randomnumber;\r
+       }\r
+\r
+       /**\r
+        * GetCurrDate\r
+        * @param {}Gets date in internet format\r
+        * \r
+        */\r
+       function GetCurrDate()\r
+       {\r
+               var d_names = new Array("Sunday", "Monday", "Tuesday",\r
+               "Wednesday", "Thursday", "Friday", "Saturday");\r
+               \r
+               var m_names = new Array("January", "February", "March", \r
+               "April", "May", "June", "July", "August", "September", \r
+               "October", "November", "December");\r
+               \r
+               var ampm = "am";\r
+               \r
+               var d = new Date();\r
+               var curr_day = d.getDay();\r
+               var curr_date = d.getDate();\r
+               if(curr_date <10)\r
+                       curr_date = "0"+curr_date;\r
+               var curr_month = d.getMonth();\r
+               var curr_year = d.getFullYear();\r
+               var curr_hour = d.getHours();\r
+               if(curr_hour > 11)\r
+               {\r
+                       ampm = "pm";\r
+               }\r
+               else if(curr_hour <10)\r
+               {\r
+                       curr_hour = "0"+curr_hour;\r
+               }       \r
+               var curr_min = d.getMinutes();\r
+               if(curr_min <10)\r
+                       curr_min = "0"+curr_min;\r
+       \r
+               var curr_sec = d.getSeconds();\r
+               if(curr_sec <10)\r
+                       curr_sec = "0"+curr_sec;\r
+               \r
+               var strDate = d_names[curr_day]+', '+curr_date+' '+m_names[curr_month]+', '+curr_year+' '+curr_hour+':'+curr_min+':'+curr_sec+' '+ampm;\r
+               return strDate;\r
+       }       \r
+\r
+       /**\r
+        * ValidateAdd\r
+        * @param {object,function}\r
+        * Validates ADD arguments\r
+        */     \r
+       function ValidateAdd(criteria,callback)\r
+       {\r
+               var type;\r
+               if(!criteria || !criteria.Type)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT,msg.msgTypeMissing);\r
+\r
+               if (typeof criteria.Type != 'string') \r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgTypeInvalid);\r
+               \r
+               if(criteria.Type != 'Log')\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT,msg.msgTypeInvalid);\r
+               \r
+               if (!criteria.Item)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgItemMissing);\r
+\r
+               if(typeof criteria.Item != 'object') \r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgItemInvalid);\r
+               \r
+               \r
+               if(typeof criteria.Item.EventType == "undefined")\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT,msg.msgEventTypeMissing);\r
+\r
+               if(typeof criteria.Item.EventType != "number" )\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgEventTypeInvalid);\r
+               \r
+               if(typeof criteria.Item.EventType == "number" && !(criteria.Item.EventType >=0 && criteria.Item.EventType <=4))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT,msg.msgEventTypeInvalid);\r
+               \r
+               type = typeof criteria.Item.RemoteParty;\r
+               if(type != 'undefined' &&  type != "string")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgRemotePartyInvalid);\r
+               \r
+               type = typeof criteria.Item.Direction;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgDirectionInvalid);\r
+                       \r
+                       if (type == "number" && (criteria.Item.Direction < 0 || criteria.Item.Direction > 6)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgDirectionInvalid);\r
+               }\r
+\r
+               type = typeof criteria.Item.EventDuration;\r
+               if(type != 'undefined' &&  type != "number")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgEventDurationInvalid);\r
+                       \r
+               type = typeof criteria.Item.DeliveryStatus;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgDeliveryStatusInvalid);\r
+                       \r
+                       if (type == "number" && (criteria.Item.DeliveryStatus < 0 || criteria.Item.DeliveryStatus > 6)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgDeliveryStatusInvalid);\r
+               }\r
+               \r
+               type = typeof criteria.Item.Subject;\r
+               if(type != 'undefined' &&  type != "string")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgSubjectInvalid);\r
+\r
+               type = typeof criteria.Item.PhoneNumber;\r
+               if(type != 'undefined' &&  type != "string")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgPhoneNumberInvalid);\r
+\r
+               type = typeof criteria.Item.Link;\r
+               if(type != 'undefined' &&  type != "number")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgLinkInvalid);\r
+\r
+               type = typeof criteria.Item.LogFlags;\r
+               if(type != 'undefined' && (type != "number" || (criteria.Item.LogFlags != 1 && criteria.Item.LogFlags != 0)))\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgLogFlagsInvalid);\r
+\r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS, "");\r
+       }       \r
+\r
+       /**\r
+        * ValidateGetList\r
+        * @param {object,function}\r
+        * Validates GetList function\r
+        */     \r
+       function ValidateGetList(criteria,callback)\r
+       {\r
+               var type;\r
+               if(!criteria || !criteria.Type)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT,msg.msgTypeMissing);\r
+\r
+               if (typeof criteria.Type != 'string') \r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgTypeInvalid);\r
+               \r
+               if(criteria.Type != 'Log')\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT,msg.msgTypeInvalid);\r
+\r
+               type = typeof criteria.Filter;\r
+               if(type != 'undefined' &&  type != "object")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgFilterInvalid);\r
+               \r
+               if(type == 'undefined')\r
+                       return context.ErrorResult(device.implementation.ERR_SUCCESS, "");              \r
+               \r
+               type = typeof criteria.Filter.id;\r
+               if(type != 'undefined' &&  type != "string")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgid);\r
+               \r
+               if(type != 'undefined')\r
+                       return context.ErrorResult(device.implementation.ERR_SUCCESS, "");  // if id is given all other filters will be ignored\r
+\r
+               type = typeof criteria.Filter.EventType;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgEventTypeInvalid);\r
+               \r
+                       if (type != "number" || !(criteria.Filter.EventType >= 0 && criteria.Filter.EventType <= 4)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgEventTypeInvalid);\r
+               }               \r
+               type = typeof criteria.Filter.RecentList;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgRecentListInvalid);\r
+                       if (type == "number" && (criteria.Filter.RecentList < -1 || criteria.Filter.RecentList > 3)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgRecentListInvalid);\r
+               }\r
+               \r
+               type = typeof criteria.Filter.RemoteParty;\r
+               if(type != 'undefined' &&  type != "string")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgRemotePartyInvalid);\r
+               \r
+               type = typeof criteria.Filter.Direction;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgDirectionInvalid);\r
+                       if (type == "number" && (criteria.Filter.Direction < 0 || criteria.Filter.Direction > 6)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgDirectionInvalid);\r
+               }\r
+               \r
+               type = typeof criteria.Filter.DeliveryStatus;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgDeliveryStatusInvalid);\r
+                       if (type == "number" && (criteria.Filter.DeliveryStatus < 0 || criteria.Filter.DeliveryStatus > 6)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgDeliveryStatusInvalid);\r
+               }\r
+\r
+               type = typeof criteria.Filter.EndTime;\r
+               if(type != 'undefined' && (type != "object" ||  typeof criteria.Filter.EndTime.getTime != "function"))\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgEndTimeInvalid);\r
+\r
+               type = typeof criteria.Filter.PhoneNumber;\r
+               if(type != 'undefined' &&  type != "string")\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE,msg.msgPhoneNumberInvalid);\r
+\r
+\r
+               type = typeof criteria.Filter.LogFlags;\r
+               if (type != 'undefined') {\r
+                       if (type != "number") \r
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgLogFlagsInvalid);\r
+                       if (type == "number" && (criteria.Filter.LogFlags != 1 && criteria.Filter.LogFlags != 0)) \r
+                               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgLogFlagsInvalid);\r
+               }\r
+               return context.ErrorResult(device.implementation.ERR_SUCCESS, "");\r
+       }       \r
+\r
+\r
+       /** \r
+        * error messages\r
+        * order of %s args: Service name, method name, parameter name \r
+        */\r
+       var msg = {\r
+               msgTypeInvalid                          : '%s:%s:TypeInvalid',\r
+               msgTypeMissing                          : '%s:%s:Type Missing',\r
+               msgFilterInvalid                        : '%s:%s:FilterInvalid',\r
+               msgidInvalid                            : '%s:%s:idInvalid',\r
+               msgRecentListInvalid            : '%s:%s:RecentListInvalid',\r
+               msgPhoneNumberInvalid           : '%s:%s:PhoneNumberInvalid',\r
+               msgDirectionInvalid                     : '%s:%s:DirectionInvalid',\r
+               msgDeliveryStatusInvalid        : '%s:%s:DeliveryStatusInvalid',\r
+               msgLogFlagsInvalid                      : '%s:%s:LogFlagsInvalid',\r
+               msgEndTimeInvalid                       : '%s:%s:EndTimeInvalid',\r
+               msgRemotePartyInvalid           : '%s:%s:RemotePartyInvalid',\r
+               msgEventTypeInvalid                     : '%s:%s:EventTypeInvalid',\r
+               msgItemInvalid                          : '%s:%s:ItemInvalid',\r
+               msgItemMissing                          : '%s:%s:ItemMissing',\r
+               msgEventTypeInvalid                     : '%s:%s:EventTypeInvalid',\r
+               msgEventTypeMissing                     : '%s:%s:EventType Missing',\r
+               msgEventDurationInvalid         : '%s:%s:EventDurationInvalid',\r
+               msgSubjectInvalid                       : '%s:%s:SubjectInvalid',\r
+               msgEventDataInvalid                     : '%s:%s:EventDataInvalid',\r
+               msgLinkInvalid                          : '%s:%s:LinkInvalid',\r
+               msgDataInvalid                          : '%s:%s:DataInvalid',\r
+               msgDataMissing                          : '%s:%s:Data Missing',\r
+               msgid                                           : '%s:%s:id',\r
+               msgFilterInvalid                        : '%s:%s:FilterInvalid',\r
+               msgFilterMissing                        : '%s:%s:Filter Missing',\r
+               msgDelayTimeInvalid                     : '%s:%s:DelayTimeInvalid',\r
+               msgDelayTimerMissing            : '%s:%s:DelayTimerMissing',\r
+               msgTransactionIdInvalid         : '%s:%s:TransactionIdInvalid',\r
+               msgTransactionIdMissing         : '%s:%s:TransactionID Missing',\r
+               msgMissingCallback                      : '%s:%s:Missing Callback',\r
+               msgNoMsg                                        : '%s:%s:'\r
+       };\r
+               \r
+\r
+}) ()\r
+\r
diff --git a/wrt/zouba/preview/script/lib/sapi/MediaManagement.js b/wrt/zouba/preview/script/lib/sapi/MediaManagement.js
new file mode 100644 (file)
index 0000000..fe1639b
--- /dev/null
@@ -0,0 +1,157 @@
+/**
+ * MediaManagement.js
+ * 
+ * Nokia Web Runtime Service API emulation 
+ * WRT v1.1
+ * 
+ * Copyright 2009 Nokia Corporation. All rights reserved.
+*/
+
+(function(){
+       
+       var provider = 'Service.MediaManagement' ,
+               Interface = 'IDataSource';
+
+       /**
+        * MediaManagement service
+        */
+       var MediaManagementService = function(){
+               this.GetList    = __GetList;
+               this.Cancel     = __Cancel;
+       }
+
+       device.implementation.extend(provider, Interface, new MediaManagementService() );
+
+
+       /******************************************************/        
+       /******************************************************/        
+       /******************************************************/        
+
+       var     context = device.implementation.context,
+               _t = context._t,
+               method = '',
+               result = false,
+               DBase = null;
+       
+       /**
+        * MediaManagement: GetList
+        * @param {Object} criteria
+        * @param {Function} callback function for async call (mandatory)
+        */
+       function __GetList(criteria, callback, _flag){
+
+               if ((result = validator.apply('GetList', arguments)) !== false)
+                       return result; 
+
+               // _flag=true indicates re-called state
+               _flag = _flag || false;
+               if (!_flag) {
+
+                       // callback is mandatory
+                       if (typeof callback != 'function')
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.badAsync);
+                       
+                       // continue validation after callback check             
+                       if (!criteria.Filter) 
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.is_missing, 'Filter');
+                       
+                       if (!criteria.Filter.FileType) 
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.is_missing, 'FileType');
+                       
+                       if (!/^(Music|Sound|Image|Video|StreamingURL)$/i.test(criteria.Filter.FileType)) 
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE);
+                       
+                       // process callback
+                       _flag = true;
+                       return context.callAsync(this, arguments.callee, criteria, callback, _flag);
+               }
+               
+               var returnValue = [], 
+                       match = null,
+                       fileType = criteria.Filter.FileType,
+                       filter = criteria.Filter;
+               // normalize filetype
+               fileType = fileType[0].toUpperCase() + fileType.substr(1).toLowerCase();
+               fileType = fileType.replace(/url/i, 'URL');
+               
+               DBase = context.getData(provider);
+
+               // unsupported filters 
+               if (filter 
+                       && (match = context.keys(filter).join().match(/Key|StartRange|EndRange/ig)) ) {
+                       context.notify(_t('%s:: GetList : filter %s not implemented in preview').arg(provider, match.join()));
+               }
+               // unsupported sort                     
+               if (criteria.Sort) { 
+                       context.notify(_t('%s:: GetList : sort not implemented in preview').arg(provider));
+               }
+
+               returnValue = DBase[fileType];
+               return context.Result(context.Iterator(returnValue));
+       }
+                       
+                       
+       /**
+        * MediaManagement: Cancel
+        * @param {Object} criteria
+        */
+       function __Cancel(criteria){
+               method = 'Cancel';
+               if (!criteria || !criteria.TransactionID)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingTID);
+               
+               clearTimeout(criteria.TransactionID);
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);
+       }
+
+
+       
+       /*******************************
+        * helper functions
+        *******************************/
+       
+       function error(code, msg /*, args...*/){
+
+               var args = ['MediaMgmt',method].concat([].slice.call(arguments,2));
+               msg = msg ? _t().arg.apply(msg,args) : undefined;
+               return context.ErrorResult(code, msg);
+       }
+
+       /**
+        * validate common input arguments
+        * 'this' is string (object) name of calling function
+        * 
+        * @param {arguments} arguments of calling function
+        * @return {Result} Result object if error, false if no error.
+        */
+       function validator() {
+               method = ''+this;
+               var     failed = false,
+                       criteria = arguments[0] || false;
+                       
+               if (!criteria || typeof criteria != 'object' || typeof criteria.Type == 'undefined')
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.is_missing, 'Type');
+               
+               if (!/^FileInfo$/i.test(criteria.Type)) 
+                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.badType);
+
+               return failed;
+       }
+
+       /** 
+        * error messages
+        * order of %s args: Service name, method name, parameter name 
+        */
+       var msg = {
+               badType                 : '%s : %s : Type not supported',
+               missingTID              : '%s : %s : TransactionID is missing',
+               badAsync                : '%s : %s : Insufficient arguments for async request',
+               is_missing              : '%s : %s : %s is missing',
+               is_invalid              : '%s : %s : %s is invalid'
+       };
+               
+
+}) ()
+
diff --git a/wrt/zouba/preview/script/lib/sapi/Messaging.js b/wrt/zouba/preview/script/lib/sapi/Messaging.js
new file mode 100644 (file)
index 0000000..1b49ef0
--- /dev/null
@@ -0,0 +1,366 @@
+/**
+ * Messaging.js
+ * 
+ * Nokia Web Runtime Service API emulation 
+ * WRT v1.1
+ * 
+ * Copyright 2009 Nokia Corporation. All rights reserved.
+*/
+  
+(function(){
+       
+       var provider = 'Service.Messaging' ,
+               Interface = 'IMessaging';
+               
+       /**
+        * Messaging service
+        */
+       var MessagingService = function(){
+               this.GetList                            = __GetList;
+               this.Send                                       = __Send;
+               this.RegisterNotification       = __RegisterNotification;
+               this.CancelNotification         = __CancelNotification;
+               this.ChangeStatus                       = __ChangeStatus;
+               this.Delete                                     = __Delete;
+               this.Cancel                             = __Cancel;
+       }
+
+       device.implementation.extend(provider, Interface, new MessagingService() );
+
+
+       /******************************************************/        
+       /******************************************************/        
+       /******************************************************/        
+
+       var     context = device.implementation.context,
+               _t = context._t,
+               method = '',
+               result = false,
+               DBase = null;
+       
+       /**
+        * Messaging: GetList
+        * @param {Object} criteria
+        */
+       function __GetList(criteria){
+
+               if ((result = validator.apply('GetList', arguments)) !== false)
+                       return result; 
+       
+               if (!criteria.Type)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);
+
+               if (!/^Inbox$/i.test(criteria.Type))
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);
+       
+               var returnValue = [], 
+                       match = null,
+                       filter = criteria.Filter || null;
+               DBase = context.getData(provider);
+
+               // filter by MessageId
+               if (filter && filter.MessageId) {
+                       returnValue = findByKey(DBase.Inbox, filter.MessageId, 'MessageId'); 
+                       if (returnValue.length == 0)
+                               return error(device.implementation.ERR_NOT_FOUND);
+               }
+               // return all messages
+               else {
+                       returnValue = DBase.Inbox;
+               }
+
+               // unsupported filters 
+               if (filter 
+                       && (match = context.keys(filter).join().match(/MessageTypeList|SenderList|Subject|StartDate|EndDate/ig)) ) {
+                       context.notify(_t('%s:: GetList : filter %s not implemented in preview').arg(provider, match.join()));
+               }
+               // unsupported sort                     
+               if (criteria.Sort) { 
+                       context.notify(_t('%s:: GetList : sort not implemented in preview').arg(provider));
+               }
+               return context.Result(context.Iterator(returnValue));
+       }
+                       
+       /**
+        * Messaging: Send
+        * @param {Object} criteria
+        * @param {Function} [callback] function for async call (optional)
+        */
+       function __Send(criteria, callback){
+
+               if ((result = validator.apply('Send', arguments)) !== false)
+                       return result; 
+
+               if (!criteria.MessageType)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.missingMessageType);
+                       
+               if (!/^(SMS|MMS)$/i.test(criteria.MessageType))
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badMessageType);
+
+               if (!criteria.To)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingTo);
+               
+               // async call?
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               context.notify(_t('%s:: Send : message sent!').arg(provider));
+
+               // return success
+               return error(device.implementation.ERR_SUCCESS);
+       }
+                       
+
+       /**
+        * Messaging: RegisterNotification
+        * @param {Object} criteria
+        * @param {function} callback function for async call (mandatory)
+        */
+       function __RegisterNotification(criteria, callback){
+
+               if ((result = validator.apply('RegisterNotification', arguments)) !== false)
+                       return result; 
+
+               // callback is mandatory
+               if (typeof callback != 'function')
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badAsync);
+               
+               // continue validation after callback check             
+               if (typeof criteria.Type == 'undefined') 
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);
+               
+               if (!/^NewMessage$/i.test(criteria.Type)) 
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);
+
+               var eventType =  'NewMessage';
+
+               // check for multiple registration
+               if (context.hasListener(provider, eventType))
+                       return error(device.implementation.ERR_ENTRY_EXISTS);
+                               
+               // process notify
+               return context.addListener(provider, eventType, criteria, callback, notifyHandler);
+       }
+                       
+       function notifyHandler(transactionID, criteria, callback, data){
+               
+               var result,
+                       eventCode = {completed:2, error:4, progress:9},
+                       code = eventCode.progress;
+               try{
+                       DBase = context.getData(provider);
+                       
+                       // make new message
+                       var now = new Date();
+                       var message = {
+                               "MessageType": "SMS",
+                               "Sender": "0435445454",
+                               "Subject": "new message",
+                               "Time": _t("%s, %s").arg(now.toString().substr(0,3), now.toLocaleString()),
+                               "Priority": "Medium",
+                               "Attachment": false,
+                               "Unread": true,
+                               "MessageId": context.getUniqueID(),
+                               "BodyText": "My hovercraft is full of eels!"
+                       };
+                       
+                       // extend with optional data
+                       data = typeof data=='object' && !(data instanceof Array) ? data : {};
+                       var returnValue = context.extend(message, data);
+
+                       result = context.Result(returnValue);
+                       
+                       /// add to top of inbox
+                       DBase.Inbox.unshift(message);
+               } 
+               catch(e){
+                       code = eventCode.error;
+               }
+               callback(transactionID, code, result);
+       }
+       
+       /**
+        * Messaging: CancelNotification
+        * @param {Object} criteria
+        */
+       function __CancelNotification(criteria){
+
+               if ((result = validator.apply('CancelNotification', arguments)) !== false)
+                       return result; 
+
+               if (typeof criteria.Type == 'undefined') 
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingType);
+
+               if (!/^NewMessage$/i.test(criteria.Type)) 
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badType);
+
+               var eventType = 'NewMessage';
+               context.removeListener(provider, eventType);
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);
+       }
+                       
+                       
+       /**
+        * Messaging: ChangeStatus
+        * @param {Object} criteria
+        */
+       function __ChangeStatus(criteria){
+
+               if ((result = validator.apply('ChangeStatus', arguments)) !== false)
+                       return result; 
+
+               if (!criteria.MessageId)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.is_missing ,'MessageId');
+                       
+               if (typeof criteria.MessageId != 'number')
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badMessageIdType);
+                       
+               if (!criteria.Status)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.is_missing ,'Status');
+
+               if (!/^(Read|Unread|Replied|Forwarded)$/i.test(criteria.Status))
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badStatus);
+       
+               // check if a callback was provided
+               if (arguments.length > 1)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badAsync2);
+                       
+               DBase = context.getData(provider);
+
+               var i,item, found = false;
+               for (i in DBase.Inbox) {
+                       item = DBase.Inbox[i];
+                       if (criteria.MessageId == item.MessageId) {
+                               item.Unread = /Unread/i.test(criteria.Status);
+                               found = true;
+                       }
+               }
+               if (!found)
+                       return error(device.implementation.ERR_NOT_FOUND);
+
+               // return success
+               return error(device.implementation.ERR_SUCCESS);                                
+       }
+                                               
+       /**
+        * Messaging: Delete
+        * @param {Object} criteria
+        */
+       function __Delete(criteria){
+               
+               if ((result = validator.apply('Delete', arguments)) !== false)
+                       return result; 
+
+               if (typeof criteria.MessageId == 'undefined')
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingMessageId);
+
+               if (typeof criteria.MessageId != 'number')
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badMessageIdType);
+                                       
+               if (criteria.MessageId < 0)
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.badMessageId);
+                       
+               DBase = context.getData(provider);
+
+               var i,item, found = false;
+               for (i in DBase.Inbox) {
+                       item = DBase.Inbox[i];
+                       if (criteria.MessageId == item.MessageId) {
+                               DBase.Inbox.splice(i, 1);
+                               found = true;
+                       }
+               }
+               if (!found)
+                       return error(device.implementation.ERR_NOT_FOUND);
+                       
+               // return success
+               return error(device.implementation.ERR_SUCCESS);                                
+       }
+                       
+
+       /**
+        * Messaging: Cancel
+        * @param {Object} criteria
+        */
+       function __Cancel(criteria){
+               method = 'Cancel';
+               if (!criteria || !criteria.TransactionID)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.is_missing, 'TransactionID');
+               
+               clearTimeout(criteria.TransactionID);
+               return context.ErrorResult(device.implementation.ERR_SUCCESS);
+       }
+
+       
+       /*******************************
+        * helper functions
+        *******************************/
+       
+       function error(code, msg /*, args...*/){
+
+               var args = ['Messaging',method].concat([].slice.call(arguments,2));
+               msg = msg ? _t().arg.apply(msg,args) : undefined;
+               return context.ErrorResult(code, msg);
+       }
+
+       /**
+        * validate common input arguments
+        * 'this' is string (object) name of calling function
+        * 
+        * @param {arguments} arguments of calling function
+        * @return {Result} Result object if error, false if no error.
+        */
+       function validator() {
+               method = ''+this;
+               var     failed = false,
+                       criteria = arguments[0] || false;
+
+               if (!criteria || typeof criteria != 'object')
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, 
+                               method == 'Send' 
+                               ? msg.missingMessageType 
+                               : (/ChangeStatus|Delete/.test(method) 
+                                       ? msg.missingMessageId 
+                                       : msg.missingType) );
+                       
+               return failed;
+       }
+
+
+       function findByKey(dbase, value, key){
+               var result = [];
+               for (var i in dbase) {
+                       if (value == dbase[i][key]) {
+                               result.push(dbase[i]);
+                       }
+               }
+               return result;
+       }
+
+       /** 
+        * error messages
+        * order of %s args: Service name, method name, parameter name 
+        */
+       var msg = {
+               missingType             : '%s:%s:Type Missing',
+               badType                 : '%s:%s:Type Value Incorrect',
+               missingTo               : '%s:%s:To Missing',
+               badTo                   : '%s:%s:To Value Incorrect',
+               missingMessageType      : '%s:%s:MessageType Missing',
+               badMessageType  : '%s:%s:MessageType Value Incorrect',
+               badAsync                : '%s:%s:Synchronous Operation not supported',
+               badAsync2               : '%s:%s:Asynchronous Operation not supported',
+               missingMessageId        : '%s:%s:MessageId Missing',
+               badMessageIdType: '%s:%s:MessageId Type Invalid',
+               badMessageId    : '%s:%s:MessageId Value Incorrect',
+               badStatus               : '%s:%s:Status Value Incorrect',
+
+               is_missing              : '%s:%s:%s Missing',
+               is_invalid              : '%s:%s:%s Value Incorrect'
+       };
+               
+
+}) ()
+
diff --git a/wrt/zouba/preview/script/lib/sapi/Sensor.js b/wrt/zouba/preview/script/lib/sapi/Sensor.js
new file mode 100644 (file)
index 0000000..b1bb4e4
--- /dev/null
@@ -0,0 +1,250 @@
+/**\r
+ * Sensor.js\r
+ * \r
+ * Nokia Web Runtime Service API emulation \r
+ * WRT v1.1\r
+ * \r
+ * Copyright 2009 Nokia Corporation. All rights reserved.\r
+*/\r
+\r
+(function(){\r
+\r
+       var provider = 'Service.Sensor',\r
+               Interface = 'ISensor';\r
+       var transID = new Array();\r
+       /**\r
+        * Sensor service\r
+        */\r
+       var SensorService = function(){\r
+               this.FindSensorChannel                  = __FindSensorChannel;\r
+               this.RegisterForNotification    = __RegisterForNotification;\r
+               this.Cancel                                             = __Cancel;\r
+               this.GetChannelProperty                 = __GetChannelProperty;         \r
+       }\r
+\r
+       device.implementation.extend(provider, Interface, new SensorService() );\r
+\r
+       /******************************************************/        \r
+       /******************************************************/        \r
+       /******************************************************/        \r
+\r
+       var     context = device.implementation.context,\r
+               _t = context._t,\r
+               method = '',\r
+               result = false,\r
+               DBase = null;\r
+\r
+\r
+       /**\r
+        * Sensor: FindSensorChannel\r
+        * @param {Object} criteria\r
+        */\r
+       function __FindSensorChannel(criteria){\r
+               method = 'FindSensorChannel';\r
+               if(!criteria)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgCriteriaMissing);\r
+                       \r
+               if(typeof criteria != 'object')\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgCriteriaMissing);\r
+                                               \r
+               if(typeof criteria.SearchCriterion == 'undefined')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgDataMissing);\r
+\r
+               if(typeof criteria.SearchCriterion != 'string')\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgidInvalid);\r
+\r
+               if(!(criteria.SearchCriterion== "All" || criteria.SearchCriterion== "AccelerometerAxis" || criteria.SearchCriterion=="AccelerometerDoubleTapping" || criteria.SearchCriterion=="Orientation" || criteria.SearchCriterion=="Rotation"))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgSearchParamInvalid);\r
+\r
+               if(arguments.length > 1)\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgCriteriaMissing);                       \r
+\r
+               DBase = context.getData(provider);\r
+               var returnValue;\r
+               returnValue = DBase[criteria.SearchCriterion] || [] ;\r
+               \r
+               return context.Result(returnValue,0);                   \r
+       }\r
+\r
+\r
+\r
+       /**\r
+        * Sensor: RegisterForNotification\r
+        * @param {Object} criteria, callback\r
+        */\r
+       function __RegisterForNotification(criteria, callback, flag){\r
+               flag = flag || false;\r
+               method = 'RegisterForNotification';\r
+               context.notify(_t('%s:: RegisterForNotification not implemented in preview').arg(provider));\r
+               \r
+               if(arguments.length >2 && (typeof flag != "undefined" && typeof flag != "boolean"))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgCriteriaMissing);\r
+\r
+               if(typeof callback != 'function')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgInsufficentArgument);\r
+               \r
+               \r
+               if(!criteria)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgIncompleteInput);\r
+                       \r
+               if(typeof criteria != 'object')\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgIncompleteInput);\r
+                                               \r
+               if(typeof criteria.ListeningType == 'undefined' || typeof criteria.ChannelInfoMap == 'undefined')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgIncompleteInput);\r
+\r
+               if(typeof criteria.ListeningType != 'string')\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgListenTypeInvalid);\r
+                       \r
+               if(typeof criteria.ChannelInfoMap != 'object')\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgChannelInfoMapInvalid);\r
+               \r
+               if(!(criteria.ListeningType== "ChannelData" ))\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgOutofRange);\r
+\r
+               if(typeof callback == 'function')\r
+               {\r
+                       var result = context.callAsync(this, arguments.callee, criteria, callback);\r
+                       transID.push(result.TransactionID);\r
+                       return result;\r
+               }\r
+               if(flag)\r
+                       transID.shift();\r
+                               \r
+               return context.ErrorResult();\r
+       }\r
+\r
+\r
+       /**\r
+        * Sensor: Cancel\r
+        * @param {Object} criteria\r
+        */\r
+       function __Cancel(criteria){\r
+               method = 'Cancel';\r
+\r
+               if(arguments.length > 1 && typeof criteria != "object" && typeof criteria.TransactionID != "number" && arguments[1])\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgCriteriaMissing);\r
+\r
+               if (!criteria || typeof criteria.TransactionID == 'undefined') \r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgTransIDMissing);\r
+\r
+               if (criteria.TransactionID == Infinity || criteria.TransactionID == -Infinity) \r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgTransIDMissing);\r
+               \r
+               if (typeof criteria.TransactionID != 'number') \r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgIncorrectTransID);             \r
+\r
+               for (var i=0; i<transID.length; i++) {
+                       if (criteria.TransactionID == transID[i]){\r
+                               clearTimeout(criteria.TransactionID);\r
+                               return context.ErrorResult();\r
+                       }
+               };\r
+               \r
+               return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgInvalidTransID);\r
+\r
+       }\r
+\r
+\r
+       /**\r
+        * Sensor: GetChannelProperty\r
+        * @param {Object} criteria\r
+        */\r
+       function __GetChannelProperty(criteria){\r
+               method = 'GetChannelProperty';\r
+\r
+               if(!criteria)\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgIncompleteInput);\r
+                       \r
+               if(typeof criteria != 'object')\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgIncompleteInput);\r
+\r
+               if(typeof criteria.ChannelInfoMap == 'undefined' || typeof criteria.PropertyId == 'undefined')\r
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.msgIncompleteInput);\r
+               \r
+               if(typeof criteria.ChannelInfoMap != 'object')\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgChannelInfoMapInvalid);\r
+               \r
+               if(typeof criteria.PropertyId != 'string')\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgInvalidPropertyID);\r
+               \r
+               if(criteria.PropertyId != 'Availability' && criteria.PropertyId != "ChannelAccuracy" && criteria.PropertyId != "ChannelDataFormat" && criteria.PropertyId != "ChannelScale" && criteria.PropertyId != "ChannelUnit" && criteria.PropertyId != "ConnectionType" && criteria.PropertyId != "DataRate" && criteria.PropertyId != "Description" && criteria.PropertyId != "MeasureRange" && criteria.PropertyId != "ScaledRange" && criteria.PropertyId != "SensorModel")\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgInvalidPropertyID);\r
+\r
+               if(arguments.length > 1)\r
+                       return error(device.implementation.ERR_INVALID_SERVICE_ARGUMENT, msg.msgCriteriaMissing);                       \r
+\r
+               DBase = context.getData(provider);\r
+               var property = DBase['SensorProperty'];\r
+               if(typeof criteria.ChannelInfoMap['ChannelId'] == 'undefined' || typeof criteria.ChannelInfoMap['ChannelId'] != 'number')\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgChannelInfoMapInvalid);\r
+\r
+               var channel = null;\r
+               if(criteria.ChannelInfoMap['ChannelId'] == 7)\r
+               {\r
+                       channel = 'AccelerometerAxis';\r
+               }\r
+               else if(criteria.ChannelInfoMap['ChannelId'] == 8)\r
+               {\r
+                       channel = 'AccelerometerDoubleTapping';\r
+               }\r
+               else if(criteria.ChannelInfoMap['ChannelId'] == 10)\r
+               {\r
+                       channel = 'Orientation';\r
+               }\r
+               else if(criteria.ChannelInfoMap['ChannelId'] == 11)\r
+               {\r
+                       channel = 'Rotation';\r
+               }\r
+       \r
+               if(channel == null)\r
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.msgChannelInfoMapInvalid);\r
+               \r
+               var returnValue = property[channel][criteria.PropertyId];\r
+               if(typeof returnValue == 'undefined')\r
+                       return context.ErrorResult(device.implementation.ERR_NOT_FOUND);\r
+               return context.Result(returnValue,0)\r
+       }\r
+\r
+       /**\r
+        * Sensor: error\r
+        * @param {number,string} ErrorCode and ErrorString\r
+        * Replaces Error String with method name\r
+        */\r
+       function error(code, msg /*, args...*/){\r
+\r
+               var args = ['Sensors',method].concat([].slice.call(arguments,2));\r
+               msg = msg ? _t().arg.apply(msg,args) : undefined;\r
+               return context.ErrorResult(code, msg);\r
+       }\r
+\r
+\r
+       /** \r
+        * error messages\r
+        * order of %s args: Service name, method name, parameter name \r
+        */\r
+       var msg = {     \r
+               msgInterfaceNotSupported        : '%s:Requested interface not supported by the provider',\r
+               msgInterfaceMissing             : '%s:Interface name missing',\r
+               msgInsufficentArgument          : '%s:%s:Insufficent argument for asynchronous request',\r
+               msgListenTypeMissing            : '%s:%s:Listening type missing',\r
+               msgListenTypeInvalid            : '%s:%s:Listening type is invalid',\r
+               msgChannelInfoMissing           : '%s:%s:ChannelInfoMap missing',\r
+               msgIncompleteInput                      : '%s:%s:Incomplete input param list',\r
+               msgOutofRange                           : '%s:%s:Listening type is out of allowed range',\r
+               msgCallbackMissing                      : '%s:%s:Callback missing',\r
+               msgAlreadyRegistered            : '%s:%s:Notification is already registered on this channel',\r
+               msgCriteriaMissing                      : '%s:%s:Search criterion is missing',\r
+               msgInvalidSearchCriteria        : '%s:%s:Invalid Search Criterion',\r
+               msgChannelSearchInvalid         : '%s:%s:Channel search param type invalid',\r
+               msgSearchParamInvalid           : '%s:%s:Invalid channel search param',\r
+               msgTransIDMissing                       : '%s:%s:Transaction id is missing',\r
+               msgIncorrectTransID                     : '%s:%s:Incorrect TransactionID',\r
+               msgInvalidTransID                       : '%s:%s:Invalid TransactionID',\r
+               msgPropertyIDMissing            : '%s:%s:Property id missing',\r
+               msgInvalidPropertyID            : '%s:%s:Property id is invalid',\r
+               msgChannelNotSupported          : '%s:%s:Channel property not supported',\r
+               msgChannelInfoMapInvalid        : '%s:%s:ChannelInfoMap Type Invalid'\r
+       };\r
+\r
+}) ()
\ No newline at end of file
diff --git a/wrt/zouba/preview/script/lib/sapi/SysInfo.js b/wrt/zouba/preview/script/lib/sapi/SysInfo.js
new file mode 100644 (file)
index 0000000..bc04a87
--- /dev/null
@@ -0,0 +1,398 @@
+/**
+ * SysInfo.js
+ * 
+ * Nokia Web Runtime Service API emulation 
+ * WRT v1.1
+ * 
+ * Copyright 2009 Nokia Corporation. All rights reserved.
+*/
+
+(function(){
+       
+       var provider = 'Service.SysInfo' ,
+               Interface = 'ISysInfo';
+
+       var supportedEntitiesAndKeys = {
+               "battery":{
+                       "batterystrength":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "chargingstatus":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true}
+               },
+               "connectivity":{
+                       "bluetooth":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       "infrared":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       "activeconnections":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":false},
+                       "connectionstatus":{"GetInfo":false,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "wlanmacaddress":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true}
+               },
+       "device":{
+                       "firmwareversion":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "platformversion":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "producttype":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "manufacturer":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "machineid":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "phonemodel":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "imei":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true}
+               },
+       "display":{
+                       "brightness":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "screensavertimeout":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "userinactivity":{"GetInfo":false,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "keyguardtime":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "autolocktime":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "autolockstatus":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       "wallpaper":{"GetInfo":false,"SetInfo":true,"GetNotification":false,"GetInfoModeSync":false,"InputDataType":"string"},
+                       "lighttimeout":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "displayresolution":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "displayorientation":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true}
+               },
+       "features":{
+                       "bluetooth":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "infrared":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "camera":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "memorycard":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "fmradio":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "qwerty":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "wlan":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "usb":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "pen":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "led":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "coverui":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "sidevolumekeys":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "vibra":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true}
+               },
+       "general":{
+                       "accessorystatus":{"GetInfo":false,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "connectedaccessories":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "inputlanguage":{"GetInfo":true,"SetInfo":true,"GetNotification":true,"GetInfoModeSync":true},
+                       "supportedlanguages":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "predictivetext":{"GetInfo":true,"SetInfo":true,"GetNotification":true,"GetInfoModeSync":true},
+                       "vibraactive":{"GetInfo":true,"SetInfo":true,"GetNotification":true,"GetInfoModeSync":true},
+                       "availableusbmodes":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "activeusbmode":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "flipstatus":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       "gripstatus":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       
+               },
+       "memory":{
+                       "driveinfo":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "listdrives":{"GetInfo":true,"SetInfo":false,"GetNotification":false,"GetInfoModeSync":true},
+                       "criticalmemory":{"GetInfo":false,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "memorycard":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true}
+               },
+       "network":{
+                       "signalstrength":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "registrationstatus":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       "networkmode":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":true},
+                       "currentnetwork":{"GetInfo":true,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "locationarea":{"GetInfo":false,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false},
+                       "cellid":{"GetInfo":false,"SetInfo":false,"GetNotification":true,"GetInfoModeSync":false}
+               }
+         };
+         
+       /**
+        * SysInfo service
+        */
+       var SysInfoService = function(){
+               this.GetInfo                    = __GetInfo;
+               this.SetInfo                    = __SetInfo;
+               this.GetNotification    = __GetNotification;
+               this.Cancel                     = __Cancel;
+       }
+
+       device.implementation.extend(provider, Interface, new SysInfoService() );
+
+       var     context = device.implementation.context,
+               _t = context._t,
+               method = '',
+               result = false,
+               DBase = null,
+               default_device = 'default';
+               
+       /**
+        * SysInfo: GetInfo
+        * @param {Object} criteria
+        * @param {function} callback function for async call (optional)
+        */
+       function __GetInfo(criteria, callback){
+               var retVal = ValidateArguments("GetInfo",criteria,callback);
+               if(retVal.ErrorCode != 0)
+               {
+                       return retVal;
+               }
+               //      Async call
+               if (typeof callback == 'function') {
+                       return context.callAsync(this, arguments.callee, criteria, callback);
+               }
+
+               DBase = context.getData(provider);
+               var returnValue = DBase;
+               returnValue = returnValue[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()];
+               returnValue.Key = criteria.Key;
+               returnValue.Entity = criteria.Entity;
+
+               if(/^Connectivity$/i.test(criteria.Entity)&& /^ActiveConnections$/i.test(criteria.Key))
+               {
+                       var temp = returnValue.ConnectionList;
+                       returnValue.ConnectionList = context.Iterator(temp);
+               }
+               else if(/^General$/i.test(criteria.Entity)&& /^ConnectedAccessories$/i.test(criteria.Key))
+               {
+                       var temp = returnValue.AccessoryList;
+                       returnValue.AccessoryList = context.Iterator(temp);                     
+               }
+               else if(/^Memory$/i.test(criteria.Entity)&& /^DriveInfo$/i.test(criteria.Key))
+               {
+                       try {
+                               var temp = criteria.SystemData.Drive;
+                               if(temp.length > 3)
+                               {
+                                       temp = temp.substring(0,3);
+                               }
+                               temp= returnValue.Drive[temp.toUpperCase()];
+                               if (!temp) {
+                                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.no_msg);
+                               }
+                               var driveInfo = new Object();
+                               driveInfo.Key = returnValue.Key;
+                               driveInfo.Entity = returnValue.Entity;
+                               driveInfo.DriveInfo = temp;
+                               return context.Result(driveInfo);
+                       }
+                       catch(err)
+                       {
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.no_msg);
+                       }
+                       
+               }
+               return context.Result(returnValue);
+       }
+                       
+
+       /**
+        * SysInfo: SetInfo
+        * @param {Object} criteria
+        * @param {function} callback function for async call (optional)
+        */
+       function __SetInfo(criteria, callback){
+               var retVal = ValidateArguments("SetInfo",criteria,callback);
+               if(retVal.ErrorCode != 0)
+               {
+                       return retVal;
+               }
+
+               //      Current implementation support only for 'General' -> 'InputLanguage' || 'PredictiveText'
+               if (/^General$/i.test(criteria.Entity) && ( /^InputLanguage$/i.test(criteria.Key) || /^PredictiveText/i.test(criteria.Key) || /^VibraActive/i.test(criteria.Key))) {
+                       //      get the DBase data
+                       DBase = context.getData(provider);
+                       var returnValue = DBase;
+                       
+                       //      Check the 'SupportedLanguages' entries for Setting the new Status
+                       if (/^InputLanguage$/i.test(criteria.Key)) {
+                               var found = false;
+                               var languageList = returnValue['general']['supportedlanguages']['LanguageList'];
+                               for (var key in languageList) {
+                                       if (languageList[key] == criteria.SystemData.Status) {
+                                               found = true;
+                                       }
+                               }
+                               //      Update the 'InputLanguage' if the value value found in the ['SupportedLanguages']
+                               if (found) 
+                                       returnValue[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()]['Status'] = criteria.SystemData.Status;
+                               else 
+                                       return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.not_supported);
+                       }
+                       else if (/^PredictiveText$/i.test(criteria.Key)) {
+                               if (criteria.SystemData.Status == 0 || criteria.SystemData.Status == 1) 
+                                       returnValue[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()]['Status'] = criteria.SystemData.Status;
+                               else 
+                                       return error(device.implementation.ERR_NOT_FOUND, msg.badType);
+                       }
+                       else if (/^VibraActive$/i.test(criteria.Key)) {
+                               if (criteria.SystemData.Status == 0 || criteria.SystemData.Status == 1) 
+                                       returnValue[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()]['Status'] = criteria.SystemData.Status;
+                       }
+                       else {
+                               return error(device.implementation.ERR_SERVICE_NOT_SUPPORTED, msg.not_supported);
+                       }
+               }
+               else if(/^Display/i.test(criteria.Entity) && /^Wallpaper/i.test(criteria.Key)) {
+                       if(typeof criteria.SystemData.StringData == 'undefined')
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingArgs);
+                       returnValue[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()]['StringData'] = criteria.SystemData.StringData;
+                       return context.ErrorResult(device.implementation.ERR_SUCCESS);
+               }
+               return context.Result(result);
+       }
+                       
+
+       /**
+        * SysInfo: GetNotification
+        * @param {Object} criteria
+        * @param {function} callback function for async call
+        */
+       function __GetNotification(criteria, callback){
+               var retVal = ValidateArguments("GetNotification",criteria,callback);
+               if(retVal.ErrorCode != 0)
+               {
+                       return retVal;
+               }
+               
+               // unsupported
+               if (!/^(Battery|Memory)$/i.test(criteria.Entity) ||
+                       !/^(BatteryStrength|ChargingStatus|MemoryCard)$/i.test(criteria.Key)) {
+                       context.notify(_t('%s:: GetNotification : entity %s, key %s not implemented in preview.').arg(provider, criteria.Entity, criteria.Key));
+                       // register callback anyway so Cancel works. 
+               }
+
+               // evenType = 'entity.key'
+               var eventType = criteria.Entity+'.'+criteria.Key;
+                                               
+               // process notify
+               return context.addListener(provider, eventType, criteria, callback, notifyHandler);
+       }
+                       
+       function notifyHandler(transactionID, criteria, callback, data){
+               
+               var result,
+                       eventCode = {completed:2, error:4, progress:9},
+                       code = eventCode.progress;
+               try{
+                       DBase = context.getData(provider);
+                       var entity = criteria.Entity.toLowerCase(),
+                               key = criteria.Key.toLowerCase();
+                                               
+                       // make a copy of return value
+                       var returnValue = context.extend({},DBase[entity][key]);
+                       
+                       // augment with data
+                       context.extend(returnValue, data);
+
+                       result = context.Result(returnValue);
+               } 
+               catch(e){
+                       code = eventCode.error;
+               }
+               callback(transactionID, code, result);
+       }
+               
+                       
+
+       /**
+        * SysInfo: Cancel
+        * @param {Object} criteria
+        */
+       function __Cancel(criteria){
+               method = 'Cancel';
+
+               if (!criteria || !criteria.TransactionID)
+                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingTID);
+
+               var found = context.removeListener(provider, null, criteria.TransactionID);
+               if (!found)
+                       return error(device.implementation.ERR_NOT_FOUND);
+               else
+                       return context.ErrorResult(device.implementation.ERR_SUCCESS);
+       }
+
+
+       
+       /*******************************
+        * helper functions
+        *******************************/
+       
+       function error(code, msg /*, args...*/){
+
+               var args = ['SysInfo',method].concat([].slice.call(arguments,2));
+               msg = msg ? _t().arg.apply(msg,args) : undefined;
+               return context.ErrorResult(code, msg);
+       }
+
+       function cancelRegisteredNotify(result)
+       {
+               __Cancel({'TransactionID':result.TransactionID});
+               method = 'GetNotification';
+       }
+
+       /** 
+        * error messages
+        * order of %s args: Service name, method name, parameter name 
+        */
+       var msg = {
+               badType                         : '%s: %s: Type is invalid',
+               badSysInfo                      : '%s: %s: SysInfoName is invalid',
+               missingSysInfo          : '%s: %s: SysInfoName is missing',
+               missingTID                      : '%s: %s: Transaction ID missing',
+               not_supported           : '%s: %s: Not Supported',
+               is_invalid                      : '%s: %s: Is invalid',
+               missingArgs                     : '%s: %s: SystemData Argument Missing',
+               inSufficientArgs        : '%s: %s: Insufficient Arguments to process',
+               missingInputParam       : '%s: %s: Input Parameter Missing',
+               not_supportedSyncVer: '%s: %s: Sync Version Not Supported',
+               noEntity                        : '%s: %s: Entity: Input Parameter Missing',
+               noKey                           : '%s: %s: Key: Input Parameter Missing',
+               IncorrectSytemData      : '%s: %s: Incorrect SystemData Type, SystemData Must be a Map',
+               callbackNotFound        : '%s: %s: Callback object not found',
+               commandNotFound         : '%s: %s: Command Not Supported',
+               unsupInterface          : 'SysInfo:Requested interface not supported by the provider',
+               no_msg                          : '%s: %s: '
+       };
+
+       /**
+        * Common validator for all functions
+        *       
+        *  
+        * @param {arguments} function name and arguments of calling function
+        * @return {Result} Error object
+        */             
+         function ValidateArguments(funName,criteria,callback)
+         {
+               method = funName;
+
+               try {
+                       if (/^GetNotification$/i.test(funName) && typeof callback != "function") {
+                               return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.not_supportedSyncVer);
+                       }
+                       
+                       if (typeof criteria == "undefined" || typeof criteria.Entity == "undefined" || typeof criteria.Key == "undefined") {
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.inSufficientArgs);
+                       }
+                       
+                       if (criteria.Entity == "") {
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.noEntity);
+                       }
+                       
+                       if (criteria.Key == "") {
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.noKey);
+                       }
+                       
+                       if (/^SetInfo$/i.test(funName)) {
+                               if (typeof criteria.SystemData == "undefined" || criteria.SystemData == '') {
+                                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingArgs);
+                               }
+                               if (typeof criteria.SystemData.StringData == "undefined" && typeof criteria.SystemData.Status == "undefined") {
+                                       return error(device.implementation.ERR_MISSING_ARGUMENT, msg.missingArgs);
+                               }
+                       }
+                       
+                       if (typeof supportedEntitiesAndKeys[criteria.Entity.toLowerCase()] == 'undefined' || typeof supportedEntitiesAndKeys[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()] == 'undefined') {
+                               return error(device.implementation.ERR_NOT_FOUND, msg.no_msg);
+                       }
+                       
+                       if (!supportedEntitiesAndKeys[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()][funName]) {
+                               return error(device.implementation.ERR_NOT_FOUND, msg.no_msg);
+                       }
+                       
+                       if (funName == "GetInfo" && !supportedEntitiesAndKeys[criteria.Entity.toLowerCase()][criteria.Key.toLowerCase()]["GetInfoModeSync"] && typeof callback != "function") {
+                               return error(device.implementation.ERR_MISSING_ARGUMENT, msg.not_supportedSyncVer);
+                       }
+                       
+                       return context.ErrorResult(device.implementation.ERR_SUCCESS, "");
+               }
+               catch(err){
+                       return error(device.implementation.ERR_BAD_ARGUMENT_TYPE, msg.badType);
+               }
+               
+         }
+
+}) ()
\ No newline at end of file
diff --git a/wrt/zouba/preview/script/lib/systeminfo.js b/wrt/zouba/preview/script/lib/systeminfo.js
new file mode 100644 (file)
index 0000000..1e5a61a
--- /dev/null
@@ -0,0 +1,107 @@
+/**\r
+       This API is used to provide system related data.\r
+       It takes the sysObject as an argument that is the embeded API in the main HTML file.\r
+       While using this API outside mobile environment, User or developer need not to take any extara action in oprder to support SYSAPI.\r
+*/\r
+\r
+function systemAPI(sysObject)\r
+{\r
+       /*\r
+        *      System Language information services\r
+        */\r
+       sysObject.language = 'EN';\r
+\r
+\r
+\r
+\r
+       /*\r
+        *      Power information services\r
+        */\r
+       \r
+       //      Properties\r
+       sysObject.chargelevel = 5;\r
+       sysObject.chargerconnected = 0;\r
+\r
+       //      Event triggers\r
+       sysObject.onchargelevel = null;\r
+       sysObject.onchargerconnected = null;\r
+\r
+\r
+\r
+       /*\r
+        *      Beep tone control services\r
+        */     \r
+       sysObject.beep = function(frequency, duration){ }\r
+\r
+\r
+\r
+       /*\r
+        *      Network Information services\r
+        */\r
+       \r
+       //      value range between: {0-7}\r
+       sysObject.signalbars = 7;\r
+\r
+       sysObject.networkname = 'No network';\r
+\r
+       //      value range between: {0-7}\r
+       sysObject.networkregistrationstatus = 0;\r
+       \r
+\r
+\r
+       /*\r
+        *      Display and keypad illumination information and control services\r
+        */\r
+\r
+       //      Properties\r
+       sysObject.lightminintensity = 1;\r
+       sysObject.lightmaxintensity = 100;\r
+       sysObject.lightdefaultintensity = 0;\r
+       \r
+       sysObject.lightinfiniteduration = 0;\r
+       sysObject.lightmaxduration = 1;\r
+       sysObject.lightdefaultcycletime = 0;\r
+\r
+       sysObject.lighttargetprimarydisplayandkeyboard = 0x3;\r
+       sysObject.lighttargetsystem = 1;\r
+\r
+       //      functions\r
+       sysObject.lighton       = function(lighttarget, duration, intensity, fadein){   }\r
+       sysObject.lightblink    = function(lighttarget, duration, onduration, offduration, intensity){  }\r
+       sysObject.lightoff      = function(lighttarget, duration, fadeout){     }\r
+\r
+\r
+\r
+       /*\r
+        *      Vibration information and control services\r
+        */\r
+       sysObject.vibraminintensity = 1;\r
+       sysObject.vibramaxintensity = 10;\r
+       sysObject.vibramaxduration = 100;\r
+       \r
+       //      Vibration setting in the user profile is off.\r
+       sysObject.vibrasettings = 2; \r
+\r
+       sysObject.startvibra    = function(duration, intensity){        }\r
+\r
+       sysObject.stopvibra     = function(){   }\r
+\r
+\r
+\r
+\r
+       /*\r
+        *      Memory and file system information services\r
+        */\r
+       sysObject.totalram = 32;        \r
+       sysObject.freeram = 10; \r
+       sysObject.drivelist = 'C';      \r
+\r
+       sysObject.drivesize     = function(drive){      return 64;      }\r
+       \r
+       sysObject.drivefree     = function(drive){      return 32;      }\r
+\r
+}\r
+\r
+\r
+//     make TRUE systeminfo.js script loaded\r
+window.parent.NOKIA.scriptsLoaded.systeminfo = true;
\ No newline at end of file
diff --git a/wrt/zouba/preview/script/lib/widget.js b/wrt/zouba/preview/script/lib/widget.js
new file mode 100644 (file)
index 0000000..93ff656
--- /dev/null
@@ -0,0 +1,286 @@
+/**\r
+ * widget object constructor\r
+ * @param {void}\r
+ *     widget()\r
+ * @return {void}\r
+ */ \r
+\r
+if (typeof window.widget == "undefined" || !window.widget) {\r
+       window.widget = {\r
+               author : 'Nokia WRT Emulation Library',\r
+               //      widget identifier, dummy value\r
+               identifier: 14021981,\r
+               isrotationsupported: true,\r
+               \r
+               //      widget event triggers\r
+               onshow: null,\r
+               onhide: null,\r
+               \r
+               sysInfo: [],\r
+               onload: null,\r
+               opacity: 50,\r
+               interval: 20,\r
+               isFront: false,\r
+               preferenceArray: [],\r
+               preferenceKey: 0\r
+       };\r
+       \r
+       \r
+       /**\r
+        * Launches the browser with the specified url\r
+        * @param {String} url\r
+        *     openURL()\r
+        * @return {Void}\r
+        */\r
+       widget.openURL = function(url){\r
+               if (url) {\r
+                       window.open(url, "New Widget Window", 'height=200 width=250');\r
+               }\r
+       }\r
+       \r
+       \r
+       /**\r
+        * Returns previously stored preference associated with the specified key\r
+        * @param {String} Key preference value to be fetch\r
+        *     preferenceForKey()\r
+        * @return {String} Value\r
+        */\r
+       widget.preferenceForKey = function(name){\r
+               return _BRIDGE_REF.nokia.helper.readCookie(name);\r
+       }\r
+       \r
+       \r
+       /**\r
+        * Stores the key associated with the specified preference\r
+        * @param {String} Preference value to be stored\r
+        * @param {String} Key Preference value associated to\r
+        *     setPreferenceForKey()\r
+        * @return {Void}\r
+        */\r
+       widget.setPreferenceForKey = function(preference, key){\r
+               _BRIDGE_REF.nokia.helper.createCookie(key, preference);\r
+       }\r
+       \r
+       \r
+       \r
+       /**\r
+        * Toggle between Tabbed navigation mode or Cursor mode\r
+        * @param {Boolean} Value\r
+        *     setNavigationEnabled()\r
+        * @return {Void}\r
+        */\r
+       widget.setNavigationEnabled = function(bool){\r
+               //This function can not be used on preview browser\r
+       }\r
+       \r
+       \r
+       \r
+       /**\r
+        * Open S0-Application identified by UID along with the specified params\r
+        * @param {Integer} Uid hexadecimal value to a specified application\r
+        * @param {String} Value\r
+        *     openApplication()\r
+        * @return {Void}\r
+        */\r
+       widget.openApplication = function(Uid, param){\r
+               alert("openApplication function won't be simulated in this application");\r
+       }\r
+       \r
+       \r
+       \r
+       /**\r
+        * Prepares the Widget.to do transition to specified transitionState\r
+        * @param {String} Value Transition state\r
+        *     prepareForTransition()\r
+        * @return {Void}\r
+        */\r
+       widget.prepareForTransition = function(transitionState){\r
+               this.isFront = ("" + transitionState).toLowerCase() != "toback";\r
+               window.document.getElementsByTagName("body")[0].style.opacity = "0.3";\r
+       }\r
+       \r
+       \r
+       \r
+       \r
+       /**\r
+        * Does the animation to make the transition between the specified transitionState\r
+        * @param {Void}\r
+        *     performTransition()\r
+        * @return {Void}\r
+        */\r
+       widget.performTransition = function(){\r
+               var _self = this;\r
+               this.opacity = 0;\r
+               this.interval = window.setInterval(function(){\r
+                       _self.opacity += 0.2;\r
+                       if (_self.opacity > 1) {\r
+                               _self.opacity = 1;\r
+                       }\r
+                       window.document.getElementsByTagName("body")[0].style.opacity = _self.opacity + "";\r
+                       if (_self.opacity >= 1) {\r
+                               window.clearInterval(_self.interval);\r
+                               window.document.getElementsByTagName("body")[0].style.opacity = "1";\r
+                       }\r
+                       //do nothing\r
+               }, 50);\r
+               //do nothing\r
+       }\r
+       \r
+       \r
+       \r
+       \r
+       \r
+       /**\r
+        * Set the preferred screen orientation to landscape.\r
+        * The display will flip if the phone display orientation\r
+        * is portrait and the phone supports landscape mode.\r
+        * @param {Void}\r
+        *     setDisplayLandscape()\r
+        * @return {Void}\r
+        */\r
+       widget.setDisplayLandscape = function(){\r
+               try {\r
+                       if (this.isrotationsupported && _BRIDGE_REF.nokia.emulator.orientationSupports()) {\r
+                               _BRIDGE_REF.nokia.emulator.setMode('landscape');\r
+                       }\r
+               } \r
+               catch (e) {\r
+               }\r
+       }\r
+       \r
+       \r
+       \r
+       \r
+       /**\r
+        * Set the preferred screen orientation to portrait.\r
+        * The display will flip if the phone display orientation\r
+        * is landscape and the phone supports portrait mode.\r
+        * @param {Void}\r
+        *     setDisplayPortrait()\r
+        * @return {Void}\r
+        */\r
+       widget.setDisplayPortrait = function(){\r
+               try {\r
+                       if (this.isrotationsupported && _BRIDGE_REF.nokia.emulator.orientationSupports()) {\r
+                               _BRIDGE_REF.nokia.emulator.setMode('portrait');\r
+                       }\r
+               } \r
+               catch (e) {\r
+               }\r
+       }\r
+       \r
+       /**\r
+        * Allows the definition of a function to be called\r
+        * when a Widget.is displayed\r
+        * @param {Void}\r
+        *     onshow()\r
+        * @return {Void}\r
+        */\r
+       widget.onshow = function(){\r
+               // to be implemented\r
+       }\r
+       \r
+       \r
+       \r
+       \r
+       /**\r
+        * Allows the definition of a function to be called\r
+        * when a Widget.sent into the background (hidden)\r
+        * @param {Void}\r
+        *     onhide()\r
+        * @return {Void}\r
+        */\r
+       widget.onhide = function(){\r
+               // to be implemented\r
+       }\r
+       \r
+       \r
+       \r
+       /**\r
+        * This function returns the System API if sysinfo is included in document embed\r
+        */\r
+       widget.enableSystemApi = function(){\r
+       \r
+               //      Identify, and Attach System-Info-Object properties\r
+               try {\r
+                       var parentIframeRef = window.parent.frames[0];\r
+                       if (typeof parentIframeRef == 'object') {\r
+                               if (parentIframeRef.document.embeds.length > 0) {\r
+                                       for (var i = 0; i < parentIframeRef.document.embeds.length; i++) {\r
+                                               //match the system Info API embed tag\r
+                                               if (parentIframeRef.document.embeds[i].type == 'application/x-systeminfo-widget') {\r
+                                                       new systemAPI(parentIframeRef.document.embeds[i]);\r
+//                                                     widget.sysInfo = parentIframeRef.document.embeds[i];\r
+                                                       \r
+                                                       // hide the <embed> object\r
+                                                       parentIframeRef.document.embeds[i].style.display='none';\r
+                                                       \r
+                                                       // push the reference object into widget\r
+                                                       widget.sysInfo.push(parentIframeRef.document.embeds[i]);\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+               } \r
+               catch (e) {\r
+                       alert('Error in attachSysInfo: ' + e);\r
+               }\r
+       }\r
+       \r
+       /**\r
+        * \r
+        */\r
+       \r
+       widget.triggerListener = function(provider, eventType, data){\r
+               if(widget.sysInfo.length){\r
+                       for(var i=0; i<widget.sysInfo.length; i++){\r
+                               if(provider == "power"){\r
+                                       switch(eventType){\r
+                                               case "chargerconnected" : \r
+                                                                                                 widget.sysInfo[i].chargerconnected = data;\r
+                                                                                                 if(widget.sysInfo[i].onchargerconnected != null){\r
+                                                                                                       setTimeout(widget.sysInfo[i].onchargerconnected, 0);\r
+                                                                                                 }else{\r
+                                                                                                               console.info("System API-1.0 Notice -- no listeners defined for eventType:"+eventType);\r
+                                                                                                 }\r
+                                                                                                 break;\r
+\r
+                                               case "chargelevel"              :\r
+                                                                                                 widget.sysInfo[i].chargelevel = data;\r
+                                                                                                 if(widget.sysInfo[i].onchargelevel != null){\r
+                                                                                                       setTimeout(widget.sysInfo[i].onchargelevel, 0);\r
+                                                                                                 }else{\r
+                                                                                                               console.info("System API-1.0 Notice -- no listeners defined for eventType:"+eventType);\r
+                                                                                                 }\r
+                                                                                                break;\r
+                                       }\r
+                               }\r
+                       }\r
+               }else{\r
+                       console.info("System API-1.0 Notice -- no listeners defined for eventType:"+eventType);\r
+               }\r
+       }\r
+       \r
+       //      make TRUE widget.js script loaded\r
+       window.parent.NOKIA.scriptsLoaded.widget = true;\r
+}\r
+\r
+(function(){\r
+\r
+       //      attach the System-Info api specific functionality\r
+       _BRIDGE_REF.helper.addEvent(window, 'load', function(){\r
+               widget.enableSystemApi();\r
+               \r
+       });\r
+\r
+       if (_BRIDGE_REF.nokia) {\r
+               _BRIDGE_REF.nokia.menu.lsk_event = function(){\r
+                       _BRIDGE_REF.nokia.emulator.child.menu.show();\r
+               };\r
+               \r
+               //      Add THIS window Reference on FRAME WINDOW\r
+               //      NOKIA.emulator.child object reference\r
+               _BRIDGE_REF.nokia.emulator.child = window;\r
+               _BRIDGE_REF.nokia.menu.init();\r
+       }       \r
+})()\r
diff --git a/wrt/zouba/preview/script/nokia.js b/wrt/zouba/preview/script/nokia.js
new file mode 100644 (file)
index 0000000..024120f
--- /dev/null
@@ -0,0 +1,1495 @@
+/*
+       @chinnapp
+*/
+
+if(typeof NOKIA == "undefined" || !NOKIA) 
+{
+       var NOKIA = {
+               version : 'WRT 1.1',
+               currentDevice : '240x320',
+               mode : 'portrait',
+               resolution : ['240x320', '320x240', '360x640', '800x352'],
+               scriptsLoaded : {
+                       loader : false,
+                       widget : false,
+                       systeminfo : false,
+                       menu   : false,
+                       menuItem : false,
+                       console : false
+               }
+       };
+       NOKIA.namespace = function(name)
+       {
+               var parts = name.split('.');
+               var current = NOKIA;
+               for(var key in parts){
+                       if(!current[parts[key]]){
+                               current[parts[key]] = {};
+                       }
+                       current = current[parts[key]];
+               }  
+       };
+       
+       NOKIA.init = function()
+       {
+               // Not-Supported Browser check
+               NOKIA.emulator.is_browserReady = (/MSIE/i.test(navigator.userAgent));
+               if(NOKIA.emulator.is_browserReady)
+               {
+                       var notSupportedBrowser = NOKIA.helper.readCookie('NOKIA_NOT_SUPPORTED_BROWSER');
+                       if (notSupportedBrowser != 1) {
+                               $("#NotificationDiv")[0].className = 'show';
+                               $("#NotificationDiv").dialog({
+                                       width: 550,
+                                       minWidth: 550,
+                                       minHeight: 350,
+                                       height: 150,
+                                       autoOpen: true,
+                                       position: top,
+                                       title: 'Notification window',
+                                       buttons: {
+                                               Cancel: function(){
+                                                       $("#NotificationDiv").dialog('close');
+                                               },
+                                               Continue: function(){
+                                                       $("#NotificationDiv").dialog('close');
+                                                       NOKIA.helper.createCookie('NOKIA_NOT_SUPPORTED_BROWSER', 1);
+                                                       NOKIA.init();
+                                               }
+                                       }
+                               });
+                               return false;
+                       }else{
+                               $("#BrowserNotificationBar").css({display:'block'});
+                               $("#BrowserNotificationBar > p > a").click(function(){ $("#BrowserNotificationBar").hide(); });
+                       }
+               }
+       
+               $('iframe')[0].src = "wrt_preview_main.html";
+
+               NOKIA.data.load(deviceResolutionList);
+               
+               var url = window.location.toString();                   
+               url = url.split('/');
+               
+               var pointer = 3;
+               if(url[0] == 'http:')
+                       pointer = 2;
+
+               var t = ''; 
+               for(var i=pointer; i<url.length-1; i++){        t = t + url[i] + '/';   }
+               if(url[0] == 'file:')
+                       NOKIA.emulator.url = 'file:///' + t;
+               else
+                       NOKIA.emulator.url = 'http://' + t;
+
+               //      Common Error/Notification Dialog
+               NOKIA.helper.errorDailog = $("#Dialog").dialog({
+                       bgiframe: true, minHeight: 150, width: 450, modal: true, autoOpen: false,
+                       buttons: {      
+                                       Cancel: function(){ $(this).dialog('close');    },                      
+                                       Reload: function(){ 
+                                               $(this).dialog('close');
+                                               $("#loaderDiv").html("Widget is reloading. Please wait...");
+                                               $("#loaderDiv")[0].className = 'green';
+                                               $("#loaderDiv").show();
+                                               window.setTimeout(function(){
+                                                       document.location = document.location;
+                                               }, 3000);
+                                       }                       
+                               }
+               });
+
+               //      validating Info.plist
+               this.helper.getInfo('Info.plist', NOKIA.helper.getInfoCallback);        
+
+               //      For getting Icon.png
+               this.helper.getInfo('Icon.png', NOKIA.helper.getIconCallback);  
+       };
+
+       /*
+        * NOKIA.data
+        */
+       NOKIA.namespace('data.load');
+
+       NOKIA.data.load = function(data){
+               NOKIA.deviceList = data;
+       }
+
+
+
+       /*
+        * NOKIA.emulator
+        */
+       NOKIA.namespace('menu');
+       NOKIA.menu = {
+               is_menu_visible : false,                // true/false
+               is_softkeys_visible : false,    // true : only when MenuItem's are displayed
+               softkeys_visibility : true,             // true/false : for hide/show SFK's
+               is_dimmed : false,
+               is_rsk_overridden : false,
+               log_counter : 1,
+               enable_log : false,
+               rsk_label : '',
+               rsk_event : false,
+               highlighted_item : null,
+               
+               hide : function()
+               {
+                       $("#MenuItemsArea").fadeIn("slow");
+
+                       //      Hide the SFK's If user hidden them from his code
+                       if(NOKIA.menu.softkeys_visibility)
+                               $("#SoftKeysArea").fadeIn("slow");
+                       
+                       NOKIA.menu.is_softkeys_visible = false;
+               },
+
+               log : function(str)
+               {
+                       if(!this.enable_log)
+                               return false;
+                       NOKIA.layout.log("log", NOKIA.menu.log_counter + ' ' +str);
+                       NOKIA.layout.log("log", 'is_rsk_overridden: '+NOKIA.menu.is_rsk_overridden);
+                       NOKIA.layout.log("log", 'rsk_label: '+NOKIA.menu.rsk_label);
+                       NOKIA.layout.log("log", 'rsk_event: '+NOKIA.menu.rsk_event);
+                       
+                       NOKIA.menu.log_counter++;
+               },
+
+               show : function()
+               {
+                       if(NOKIA.menu.is_dimmed)
+                               return false;
+                               
+                       NOKIA.menu.showSoftKeys();
+                       
+                       NOKIA.menu.is_menu_visible = true;
+                       $("#MenuItemsArea").show();
+                       
+                       NOKIA.menu.highlighted_item = $("#MenuItemsArea > ul > li")[0];
+                       NOKIA.menu.highlighted_item.className = 'active';
+
+
+                       $("#MenuItemsArea > ul > li").mouseover(function(){
+                               if(NOKIA.menu.highlighted_item != null)
+                               {
+                                       NOKIA.menu.highlighted_item.className = '';
+                                       NOKIA.menu.highlighted_item = null;
+                               }
+
+                               NOKIA.menu.highlighted_item = this;
+                               NOKIA.menu.highlighted_item.className = 'active';
+                       });
+
+                       $("#SoftKeysArea").mouseout(function(){
+                               if (!NOKIA.menu.is_menu_visible) {
+                                       return false;
+                               }
+                               
+                               if (NOKIA.helper.intervalId) {
+                                       clearInterval(NOKIA.helper.intervalId);
+                               }
+                               NOKIA.helper.intervalId = setTimeout(function(){
+                                       NOKIA.menu.cancel()
+                               }, 500);
+                       });
+
+
+                       //      Change the label "Options" to "Select" to LSK
+                       $("#LskLabel > a")[0].innerHTML = "Select";
+                       NOKIA.menu.setLsk(NOKIA.menu.selectMenu);
+                       
+                       //      Change the label "Exit" to "Cancel" to RSK
+                       $("#RskLabel > a")[0].innerHTML = 'Cancel';
+                       NOKIA.menu.setRsk(NOKIA.menu.cancel);
+                       
+
+                       NOKIA.emulator.setMenuItemsStyle();
+                       
+               },
+               
+               selectMenu : function(){
+                       try {
+                               if(typeof NOKIA.menu.highlighted_item.onclick != 'undefined'){
+                                       eval(NOKIA.menu.highlighted_item.onclick)();
+                               }
+                       } catch (e) {
+                               
+                       }
+//                     NOKIA.menu.cancel();
+               },
+
+               
+               cancel : function()
+               {
+                       if(NOKIA.menu.is_dimmed)
+                               return false;
+                               
+                       NOKIA.menu.hideSoftKeys();
+
+                       NOKIA.menu.is_menu_visible = false;
+                       $("#MenuItemsArea").hide();
+
+                       //      Reset the "OPTION" label to LSK
+                       $("#LskLabel > a")[0].innerHTML = 'Options';
+                       NOKIA.menu.setLsk(NOKIA.emulator.child.menu.show);
+
+                       //      Change the label "CANCEL" to "EXIT" to RSK
+                       if(!NOKIA.menu.is_rsk_overridden)
+                       {
+                               $("#RskLabel > a")[0].innerHTML = 'Exit';
+                               NOKIA.menu.setRsk(NOKIA.menu.exit);     
+                       }
+                       else
+                       {
+                               $("#RskLabel > a")[0].innerHTML = NOKIA.menu.rsk_label;
+                               NOKIA.menu.setRsk(NOKIA.menu.rsk_event);        
+                       }
+                       
+               },
+
+               exit : function()
+               {
+                       if(NOKIA.menu.is_dimmed)
+                               return false;
+                               
+                       if(NOKIA.helper.setHomeScreen())
+                               return false;
+
+                       //      clear the Menu Settings
+                       NOKIA.menu.cancel();
+                       NOKIA.emulator.child.menu.setRightSoftkeyLabel('', null);
+                       NOKIA.emulator.child.menu.items = [];
+                       NOKIA.menu.softkeys_visibility = false;
+                       
+                       // Hide Widget DIV
+                       NOKIA.menu.hideSoftKeys();
+                       NOKIA.menu.setLsk(function(){});
+                       NOKIA.menu.setRsk(function(){});
+                       
+                       $("#WidgetArea").hide();
+
+                       //      Show Icon
+                       var style = NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode]['style'];
+                       $('#IconArea').css({
+                               'width'         :       '100%',
+                               'height'        :       style['widget']['height']+'px',
+                               'float'         :       style['widget']['float']
+                       });
+                       
+                       $('#IconArea')[0].className = NOKIA.mode+NOKIA.currentDevice;
+                       
+                       var img = document.createElement('img');
+                       img.src = NOKIA.emulator.iconFile;
+                       img.border = 0;
+                       
+                       var div = document.createElement('div');
+                       var p = document.createElement('p');
+                       
+                       if(NOKIA.emulator.plist.DisplayName.length <= 12)
+                               p.innerHTML = NOKIA.emulator.plist.DisplayName; 
+                       else
+                               p.innerHTML = NOKIA.emulator.plist.DisplayName.substr(0, 11) + '...' 
+
+                       div.className = 'IconFile';
+                       div.style.marginTop = parseInt(parseInt(style['widget']['height']/2)-80) + 'px';
+                       div.appendChild(img);
+                       img.onclick = function(){
+                               
+                               //      close the console DIV
+                               NOKIA.layout._console_enabled = false;
+                               NOKIA.layout.render();
+                               
+                               $("#loaderDiv").html("Widget is loading. Please wait...");
+                               $("#loaderDiv")[0].className = 'green';
+                               $("#loaderDiv").show();
+                               window.setTimeout(function(){
+                                       document.location = document.location;
+                               }, 3000);
+                               
+                       };
+                       
+                       div.appendChild(p);
+
+                       $("#loaderDiv").html("Click on Icon to Launch Widget");
+                       $("#loaderDiv").show();
+                       $("#loaderDiv")[0].className = 'yellow';
+
+                       $('#IconArea').append(div);
+                       $('#IconArea').show();
+
+                       NOKIA.menu.is_dimmed = true;
+                       
+                       $("#PreferencesBtn").hide();
+                       $("#PreferencesTab").dialog('close');
+                       
+               },
+               
+               setLsk : function(func)
+               {
+                       //      for RSK
+                       $('#LskArea')[0].onclick = function(){
+                               if(!NOKIA.menu.is_dimmed)
+                                       func();
+                       };
+               
+                       $('#LskLabel > a')[0].onclick = function(){
+                               if(!NOKIA.menu.is_dimmed)
+                                       func();
+                       };
+
+                       return true;
+               },
+               
+               setRsk : function(func)
+               {
+                       //      for RSK
+                       $('#RskArea')[0].onclick = function(){
+                               if(!NOKIA.menu.is_dimmed)
+                                       func();
+                       };
+                       
+                       $('#RskLabel > a')[0].onclick = function(){
+                               if(!NOKIA.menu.is_dimmed)
+                                       func();
+                       };
+                       
+                       return true;
+               },
+
+
+               triggerLsk : function(event)
+               {
+                       var callback;
+                       if(NOKIA.mode == 'portrait')
+                               callback = NOKIA.menu.lsk_event;
+                       else if( (NOKIA.mode == 'landscape') && (event.id =='LskLabel') )
+                               callback = NOKIA.menu.lsk_event;
+                       else
+                               callback = NOKIA.menu.rsk_event;
+                       
+                       if(typeof callback == 'function' && !NOKIA.menu.is_dimmed)
+                       {
+                               callback();
+                       }
+               },
+
+               triggerRsk : function(event)
+               {
+                       var callback;
+                       if(NOKIA.mode == 'portrait')
+                               callback = NOKIA.menu.rsk_event;
+                       else if( (NOKIA.mode == 'landscape') && (event.id =='RskLabel') )
+                               callback = NOKIA.menu.rsk_event;
+                       else
+                               callback = NOKIA.menu.lsk_event;
+                       
+                       if(typeof callback == 'function')
+                       {
+                               if(!NOKIA.menu.is_dimmed)
+                               {
+                                       callback();
+                                       NOKIA.menu.cancel();
+                               }
+                       }
+               },
+               
+               render : function()
+               {
+                       if(!NOKIA.menu.softkeys_visibility)
+                               NOKIA.menu.hideSoftKeys();
+                       else
+                               NOKIA.menu.showSoftKeys();
+                       
+                       NOKIA.emulator.setWidgetStyle();
+               },
+               
+
+               init : function()
+               {
+                       NOKIA.menu.render();
+               },
+               
+               createSFKArea : function()
+               {
+                       var a = $('#SoftKeys > a');
+                       a.html('');
+                       
+                       var preferences = NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode];
+                       
+                       var lsk = document.createElement('img');
+                       lsk.border="0";
+                       lsk.id = "LskArea";
+                       lsk.name ="LskArea";
+                       lsk.src = "preview/images/TransperantImage.png";
+                       lsk.style.width = preferences.style.softkeysImg.width; 
+                       lsk.style.height = preferences.style.softkeysImg.height;
+                       
+                       var rsk = document.createElement('img');
+                       rsk.border = 0;
+                       rsk.id = "RskArea";
+                       rsk.name = "RskArea";
+                       rsk.src = "preview/images/TransperantImage.png";
+                       rsk.style.width = preferences.style.softkeysImg.width; 
+                       rsk.style.height = preferences.style.softkeysImg.height;
+
+                       if(NOKIA.mode == 'portrait')
+                       {       
+                               lsk.onclick = function(){
+                                       $("#LskLabel > a").trigger('click');
+                               }
+                               a[0].appendChild(lsk);
+
+                               rsk.onclick = function(){
+                                       $("#RskLabel > a").trigger('click');
+                               }
+                               a[1].appendChild(rsk);
+
+                       }else{
+
+                               rsk.onclick = function(){
+                                       $("#RskLabel > a").trigger('click');
+                               }
+                               a[0].appendChild(rsk);
+
+                               lsk.onclick = function(){
+                                       $("#LskLabel > a").trigger('click');
+                               }
+                               a[1].appendChild(lsk);
+                       }
+                       
+                       
+               },
+
+               showSoftKeys : function()
+               {
+                       NOKIA.menu.is_softkeys_visible = true;
+
+                       NOKIA.emulator.setWidgetStyle();
+                       $("#SoftKeysArea").show();
+               },
+               
+               hideSoftKeys : function()
+               {
+                       //      Hide the SFK's If user hidden them from his code
+                       if(!NOKIA.menu.softkeys_visibility)
+                               $("#SoftKeysArea").hide();
+                       
+                       NOKIA.menu.is_softkeys_visible = false;
+
+                       NOKIA.emulator.setWidgetStyle();
+               }
+       };
+
+
+
+       /*
+        * NOKIA.emulator
+        */
+       NOKIA.namespace('emulator');
+       NOKIA.emulator = {
+               child : false,
+               iconFile : 'preview/images/default-Icon.png',
+               loaded : false,
+               plist : {
+                       DisplayName     :       '',
+                       Identifier      :       '',
+                       MainHTML        :       '',
+                       AllowNetworkAccess      :       "false",
+                       Version         :       '',
+                       MiniViewEnabled         :       "false",
+                       is_browserReady : false
+               },
+               
+               load : function()
+               {
+                       if(this.loaded)
+                               return false;
+                               
+                       //      load the saved device Info
+                       var device = NOKIA.helper.readCookie('NOKIA_EMULATOR_DEVICE');
+                       NOKIA.currentDevice = device || NOKIA.currentDevice;
+
+
+                       //      load the saved device mode
+                       var mode = NOKIA.helper.readCookie('NOKIA_EMULATOR_DEVICE_MODE');
+                       if(mode != null)
+                               NOKIA.mode = mode;
+
+                       //      SAVE the device DATA
+                       NOKIA.helper.createCookie('NOKIA_EMULATOR_DEVICE', NOKIA.currentDevice);
+                       NOKIA.helper.createCookie('NOKIA_EMULATOR_DEVICE_MODE', NOKIA.mode);
+                       
+                       this.loaded = true;
+                       
+               },
+       
+               render : function()
+               {
+                       this.load();
+                       
+                       if(!NOKIA.emulator.orientationSupports())
+                               NOKIA.mode = NOKIA.deviceList[NOKIA.currentDevice]['default'];
+                       
+                       if(typeof NOKIA.deviceList == 'undefined' || typeof NOKIA.deviceList[NOKIA.currentDevice] == 'undefined' || typeof NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode] == 'undefined')
+                       {
+                               alert('Deive resolution: '+NOKIA.currentDevice+' or the mode: '+NOKIA.mode+' not found');
+                               return false;
+                       }
+                       
+                       this.setStyle();
+               },
+               
+               setMode : function(mode)
+               {
+                       NOKIA.mode = mode;
+
+                       //      SAVE the device DATA
+                       NOKIA.helper.createCookie('NOKIA_EMULATOR_DEVICE_MODE', NOKIA.mode);
+
+                       NOKIA.emulator.render();
+               },
+               
+               orientationSupports : function()
+               {
+                       return NOKIA.deviceList[NOKIA.currentDevice]['orientation'];
+               },
+               
+               setStyle:function()
+               {
+                       if(!NOKIA.helper.checkDependencies())
+                       {
+                               setTimeout(NOKIA.emulator.setStyle, 1000);
+                       }
+                       
+                       var deviceProperties = NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode];
+                       var style = deviceProperties['style'];
+
+                       //      Apply Style and propertis to Device layers
+                       $("#DeviceDisplayLayout").css(style['layout']);
+                       $('#DisplayArea').css(style['display']);
+                       
+                       NOKIA.emulator.setWidgetStyle();
+                       
+                       $('#SoftKeysArea').css({
+                               'width' :       style['menu']['width']+'px',
+                               'height'        :       style['menu']['height']+'px',
+                               'float'         :       style['menu']['float']
+                       });
+                       
+                       $('#SoftKeysArea > ul > li').css('width', parseInt(style['menu']['width']/2)-10);
+
+                       
+                       NOKIA.emulator.setMenuItemsStyle();
+                       
+                       $('#SoftKeys').css(style['softkeys']);
+//                     $('#SoftKeys > a > img').css(style['softkeysImg']);
+
+                       NOKIA.menu.createSFKArea();
+                       
+                       $("#DeviceDisplayLayout").show();
+                       $("#PreferencesTab").show();
+                       
+                       if(!NOKIA.menu.is_dimmed)
+                               $("#PreferencesBtn").show();
+               },
+               
+               setWidgetStyle : function()
+               {
+                       var style = NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode]['style'];
+                       var height;
+                       if(NOKIA.menu.softkeys_visibility || NOKIA.menu.is_softkeys_visible)
+                               height = parseInt(style['widget']['height'] - style['menu']['height']);
+                       else
+                               height = style['widget']['height'];
+
+                       $('#WidgetArea').css({
+                               'width'         :       style['widget']['width']+'px',
+                               'height'        :       height+'px',
+                               'float'         :       style['widget']['float']
+                       });
+               },
+               
+               setMenuItemsStyle : function()
+               {
+                       var style       = NOKIA.deviceList[NOKIA.currentDevice][NOKIA.mode]['style'];
+                       var count = 1;
+                       try {
+                               if (NOKIA.emulator.child.menu) {
+                                       count = parseInt(NOKIA.helper.getElementsLengthInObject(NOKIA.emulator.child.menu.items)) + 1;
+                               }
+                       } catch (e) {
+                               count = 1;
+                       }
+                       var height      = parseInt(count*style['menu']['optionKeysheight']) + 10;
+                       var top         = parseInt(style['widget']['height'] - height); 
+
+                       $('#MenuItemsArea').css({
+                               'width'         :       style['widget']['width']+'px',
+                               'height'        :       height+'px',
+                               'marginTop'     :       '-2px',
+                               'top'           :       (style['widget']['height']-height-style['menu']['height']+2)+'px',
+                               'position'      :       'relative'
+                       });
+               }
+       };
+
+       /*
+        * NOKIA.helper functions
+        */
+       NOKIA.namespace('helper.loadScript');
+       NOKIA.helper = {
+               path : document.location.pathname,
+               errorDailog     : null,
+               prefDailog : null,
+               intervalId : null,
+               infoPlistCounter : false,
+               IconFileCounter  : false,
+               loadScript : function(path)
+               {
+                       var head = document.getElementsByTagName("head")[0] || document.documentElement;
+                       var script = document.createElement("script");
+       
+                       script.type = "text/javascript";
+                       script.src = src;
+                       head.appendChild( script );
+               },
+
+               loadPreferences : function()
+               {
+                       if(/dreamweaver/i.test(navigator.userAgent))
+                       {
+                               $("#dwDeviceHelp")[0].className = '';
+                               $("#resSupportLink")[0].className = 'hide';
+                       }
+                       //      Selecting Resoltion
+                       var resOptions = $("#resOptions")[0];
+                       for(var i=0; i<NOKIA.resolution.length; i++)
+                       {
+                               if(NOKIA.resolution[i] == NOKIA.currentDevice)
+                               {
+                                       resOptions.options[i].selected = true;
+                                       $("#resSupportLink")[0].href = resOptions.options[i].value;
+                                       break;
+                               }                               
+                       }
+                       
+                       //      Selecting Orientation
+                       if(NOKIA.mode == 'portrait')
+                               $('#input_portrait')[0].checked = true;
+                       else
+                               $('#input_landscape')[0].checked = true;
+
+                       if (!NOKIA.emulator.orientationSupports()) {
+                               if (NOKIA.mode == 'portrait') 
+                                       $("#input_landscape")[0].disabled = true;
+                               else 
+                                       $("#input_portrait")[0].disabled = true;
+                                       
+                               $("#Orientation_Info").html("Not supported");
+                               $("#Orientation_Info").show();
+                               $("#Orientation_Controls").hide();
+                       }
+                       else {
+                               $("#input_landscape")[0].disabled = false;
+                               $("#input_portrait")[0].disabled = false;
+
+                               $("#Orientation_Info").hide();
+                               $("#Orientation_Controls").show();
+                       }
+                       
+                       //      Selecting Version
+                       if(NOKIA.version == 'WRT 1.0')
+                               $('#wrt_version_1_0')[0].checked = true;
+                       else
+                               $('#wrt_version_1_1')[0].checked = true;
+                               
+                       //      HomeScreen Support
+                       if(NOKIA.deviceList[NOKIA.currentDevice].homeScreenSupport)
+                       {
+                               if (typeof NOKIA.emulator.plist.MiniViewEnabled != 'undefined') {
+                                       if (NOKIA.emulator.plist.MiniViewEnabled == 'false') 
+                                               $('#HS_Control_Info').html("<span id='wrt-help' onclick='javascipt:NOKIA.helper.showMiniviewHelp();'></span><strong>Not Enabled</strong><br/><small>Click on help to read more about enabling Mini view support</small>");
+                                       else 
+                                               $('#HS_Control_Info').html("Supported");
+                               }
+                               else
+                                       $('#HS_Control_Info').html("<span id='wrt-help'></span>Not Supported");
+
+                               $('#HS_Control_Info').show();
+
+                       }
+                       else
+                       {
+                               $('#HS_Control_Info').html("Not Supported for the selected Device resolution");
+                               $('#HS_Control_Info').show();
+                       }
+               },
+
+               getInfo : function(url, callback)
+               {
+                       try {
+                               var xhr = this.ajax();
+                               
+                               if ((/AppleWebKit/i.test(navigator.userAgent)))
+                                       xhr.open("GET", url, false);
+                               else
+                                       xhr.open("GET", url, true);
+                               
+                               
+                               xhr.onreadystatechange = function() 
+                               {
+                                               // readyState = 4 ; "complete"
+                                               if (xhr.readyState==4)
+                                               {
+                                                       // status = 200 ; "ok"
+                                                       if( (xhr.status == 200) || (!xhr.status) )
+                                                       {
+                                                               callback(true, xhr);
+                                                       }
+                                                       else
+                                                       { 
+                                                               callback(false, xhr);
+                                                       }
+                                               }
+       
+                               }
+                               xhr.send(null);
+                       } catch (e) {
+                               if (e.name == 'NS_ERROR_FILE_NOT_FOUND') {
+                                       callback(false, xhr);
+                               }                       
+                       }
+               },
+
+               getInfoCallback : function(flag, xhr)
+               {
+                       //      If Info.plis NOT FOUND / FAILED LOAD
+                       //      an ERROR!, unable to proceed further
+                       //      STOP there
+                       if(!flag)
+                       {
+                               if(!NOKIA.helper.infoPlistCounter)
+                               {
+                                       NOKIA.helper.infoPlistCounter = true;
+                                       NOKIA.helper.getInfo('info.plist', NOKIA.helper.getInfoCallback);
+                                       return false;
+                               }
+
+                               NOKIA.helper.error('Unable to intialize the widget, failed to process Info.plist file. <br/>Please ensure <strong style="color:#efe352;">Info.plist</strong> file exists on the widget root folder <br/>or check the filename of <strong style="color:#efe352;">Info.plist</strong> It is case-sensitive');
+                               return false;
+                       }
+                       else{
+                               
+                               var xmlString = xhr.responseText;
+                               
+                               // do some cheating here
+                               xmlString = xmlString.replace(/<\s*true\s*\/>/gi, "<string>true</string>");
+                               xmlString = xmlString.replace(/<\s*false\s*\/>/gi, "<string>false</string>");
+       
+                       /*
+                        *      DomParser Logic
+                               var appXml = new DOMParser();
+                               var xmlobject = appXml.parseFromString(xmlString, "text/xml");
+                        */
+                       
+                               //      return the JSON Object
+                               NOKIA.helper.validate(xml2json.parser(xmlString));
+                       }
+                       
+               },
+               
+               getIconCallback : function(flag, xhr)
+               {
+                       
+                       if(!flag)
+                       {
+                               if(!NOKIA.helper.IconFileCounter)
+                               {
+                                       NOKIA.helper.IconFileCounter = true;
+                                       NOKIA.helper.getInfo('icon.png', NOKIA.helper.getIconCallback);
+                                       return false;   
+                               }
+                       }
+                       else
+                               NOKIA.emulator.iconFile =  (NOKIA.helper.IconFileCounter) ? "icon.png" : "Icon.png";
+               },
+               
+
+               validate : function(xmlObject)
+               {
+                       window.xmlObject = xmlObject;
+                       
+                       //      <plist>
+                       if(typeof xmlObject.plist != 'object' || xmlObject.plist == 'undefined')
+                       {
+                               NOKIA.helper.error('Corrupted Info.plist file');
+                               return false;
+                       }
+                       //      <dict>
+                       xmlObject = xmlObject.plist;
+                       if(typeof xmlObject.dict != 'object' || xmlObject.dict == 'undefined')
+                       {
+                               NOKIA.helper.error('Corrupted Info.plist file');
+                               return false;
+                       }
+
+                       //      <key>
+                       xmlObject = xmlObject.dict;
+                       if(typeof xmlObject.key != 'object' || xmlObject.key == 'undefined')
+                       {
+                               NOKIA.helper.error('Corrupted Info.plist file');
+                               return false;
+                       }
+
+                       //      <string>
+                       if(typeof xmlObject.string != 'object' || xmlObject.string == 'undefined')
+                       {
+                               NOKIA.helper.error('Corrupted Info.plist file');
+                               return false;
+                       }
+
+                       //      num of <key> = num of <string>
+                       if(xmlObject.key.length != xmlObject.string.length)
+                       {
+                               NOKIA.helper.error('Corrupted Info.plist file');
+                               return false;
+                       }
+
+                       for(var val in xmlObject.key)
+                       {
+                               if(NOKIA.emulator.plist[xmlObject.key[val]] != 'undefined'){
+                                       NOKIA.emulator.plist[xmlObject.key[val]] = xmlObject.string[val].toString(); 
+                               }
+                       }
+
+                       try {
+                               if(typeof NOKIA.emulator.plist.DisplayName != 'undefined'){
+                                       document.title = NOKIA.emulator.plist.DisplayName + ' - ' + document.title;
+                               }
+                       } catch (e) {}
+
+                       //      Add UI-Event listeners
+                       NOKIA.helper.addListeners();
+                       NOKIA.layout.init();
+                       NOKIA.emulator.render();
+               },
+
+
+               ajax : function() 
+               {
+                       //      xmlHttpRequest object   
+                       var request = null;
+               
+                   // branch for native XMLHttpRequest object
+                   if(window.XMLHttpRequest && !(window.ActiveXObject)) {
+                       try 
+                               {
+                                       request = new XMLHttpRequest();
+                                       try
+                                       {
+                                               //      attach the Bypass code, if the browser is firefox
+                                               if(netscape.security.PrivilegeManager.enablePrivilege)
+                                               {
+                                                       //      duplicate the function
+                                                       request._open = request.open;
+                                                       
+                                                       //      redefine the function definition
+                                                       request.open = function(method, url, flag)
+                                                       {
+                                                               try
+                                                               {
+                                                                       // Enable Universal Browser Read
+                                                                       netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
+               
+                                                                       //      call the native XmlHttpRequest.open method
+                                                                       this._open(method, url, flag);
+                                                               }catch(e)
+                                                               {
+                                                                       //      call the native XmlHttpRequest.open method
+                                                                       this._open(method, url, flag);
+                                                               }
+                                                       }
+                                               }
+                                       }
+                                       catch(e)
+                                       {
+                                               //      eatup all exceptions
+                                       }
+                               } 
+                               catch(e) {
+                                       request = null;
+                       }
+                   // branch for IE/Windows ActiveX version
+                   } else if(window.ActiveXObject) {
+                       try {
+                               request = new ActiveXObject("Msxml2.XMLHTTP");
+                       } catch(e) {
+                               try {
+                                       request = new ActiveXObject("Microsoft.XMLHTTP");
+                               } catch(e) {
+                                       alert('Failed to create XmlHttprequest');
+                                               return null;
+                               }
+                               }
+                   }
+                       
+                       return (request);
+               },
+
+               error : function(msg)
+               {
+                       if(NOKIA.menu.enable_log)
+                               NOKIA.layout.log("log", msg);
+                       
+                       $("#Dialog").html(msg);
+                       $("#Dialog").dialog('open');
+               },
+
+               createCookie : function(name,value) 
+               {
+                       var days = 240000;
+                   if (days) {
+                               var date = new Date();
+                               date.setTime(date.getTime()+(days*24*60*60*1000));
+                               var expires = "; expires="+date.toGMTString();
+                       }
+                       else var expires = "";
+                       document.cookie = "Nokia_WRT#" + NOKIA.helper.path + "#" + name + "=" + value + expires + "; path=/";
+               },
+               
+               readCookie : function(name) 
+               {
+                       var nameEQ = "Nokia_WRT#" + NOKIA.helper.path + "#" + name + "=";
+                       var ca = document.cookie.split(';');
+                       for(var i=0;i < ca.length;i++) {
+                               var c = ca[i];
+                               while (c.charAt(0)==' ') c = c.substring(1,c.length);
+                               if (c.indexOf(nameEQ) == 0) {
+                                       return c.substring(nameEQ.length,c.length);
+                               }
+                       }
+                       return undefined;
+               },
+
+               toggle : function(ele)
+               {
+                       if (NOKIA.emulator.orientationSupports()) {
+//                             var mode = (NOKIA.mode == 'portrait') ? 'landscape' : 'portrait';
+                               NOKIA.emulator.setMode(ele.value);
+                       }
+                       else
+                       {       
+                               ele.checked = false;
+                               if(ele.value == 'portrait')
+                                       $("#input_landscape")[0].checked = true;
+                               else
+                                       $("#input_portrait")[0].checked = true;
+                       }
+               },
+
+               version : function(ele)
+               {
+                       if (confirm('Would you like to reload the widget to apply the changes on the Version settings?')) 
+                       {
+                               NOKIA.helper.createCookie('_WRT_VERSION', ele.value);
+                               $("#loaderDiv").html("Applying the " + ele.value + ", please wait...");
+                               $("#loaderDiv").show();
+                               $("#loaderDiv")[0].className = 'green';
+                               
+                               $("#PreferencesTab").dialog('close');
+                               
+                               window.setTimeout(function(){
+                                       document.location = document.location;
+                               }, 3000);
+                       }
+                       else
+                       {
+                               ele.checked = false;
+                               if(ele.value != 'WRT 1.0')
+                                       $("#wrt_version_1_0")[0].checked = true;
+                               else
+                                       $("#wrt_version_1_1")[0].checked = true;
+                       }
+               },
+
+               addListeners : function()
+               {
+                       /*
+                        * Render Emulator for Interaction
+                        */
+                       NOKIA.helper.prefDailog = $("#PreferencesTab").dialog({
+                                       width: 550,     minWidth: 550, minHeight: 350, height: 350, autoOpen: false, position : top, title : '&nbsp;',
+                                       buttons : {
+                                               Close : function(){
+                                                       $("#PreferencesTab").dialog('close');
+
+                                                       //      Hack for Mac firefox
+                                                       if(/Mac/i.test(navigator.userAgent))
+                                                       {
+                                                               $("#WidgetArea iframe").css({overflow:'auto'});
+                                                       }
+                                                       
+                                                       //      select index : 0 tab selected
+                                                       $('#tabs').tabs( 'select' , 0);
+                                               }
+                                       }
+                               });
+                               
+                       $('#PreferencesBtn').click(function(){
+                               //      Load preferences
+                               NOKIA.helper.loadPreferences();
+                               $('#PreferencesTab').dialog('open');
+
+                               //      Hack for Mac firefox
+                               if(/Mac/i.test(navigator.userAgent))
+                               {
+                                       $("#WidgetArea iframe").css({overflow:'hidden'});
+                               }
+                       });
+                       
+                       $('#input_portrait').change(function(){
+                               NOKIA.helper.toggle(this);
+                       });
+
+                       $('#input_landscape').change(function(){
+                               NOKIA.helper.toggle(this);
+                       });
+
+                       $('#resOptions').change(function(ele){
+                               ele = ele.target || this;
+                               
+                               NOKIA.currentDevice = ele.options[ele.selectedIndex].text;
+                               $("#resSupportLink")[0].href = ele.value;
+               
+                               //      SAVE the device DATA
+                               NOKIA.helper.createCookie('NOKIA_EMULATOR_DEVICE', NOKIA.currentDevice);
+               
+                               NOKIA.emulator.render();
+                               NOKIA.helper.loadPreferences();
+                       });
+
+                       //      Hack for Mac firefox
+                       if (/Mac/i.test(navigator.userAgent)) {
+                               if (!(/AppleWebKit/i.test(navigator.userAgent))) {
+                                       $("#resOptions")[0].size = '4';
+                               }
+                       }
+
+
+                       //      WRT Version controls
+                       $('#wrt_version_1_0').change(function(){
+                               NOKIA.helper.version(this);
+                       });
+                       
+                       $('#wrt_version_1_1').change(function(){
+                               NOKIA.helper.version(this);
+                       });
+
+
+                       $("#orientationIcon").click(function(){
+                               var mode = (NOKIA.mode == 'portrait') ? 'landscape' : 'portrait';
+                               NOKIA.emulator.setMode(mode);
+                               $("#WidgetArea")[0].className = 'hs_'+NOKIA.mode;
+                       });
+
+
+                       $("#iframeMask").click(function(){
+
+                               $("#PreferencesBtn").show();
+                               $("#orientationIcon").hide();
+                               $("#iframeMask").hide();
+                               $("#loaderDiv").hide();
+
+                               NOKIA.menu.is_dimmed = false;
+                               
+                               $("#WidgetArea")[0].className = '';
+                               
+                               NOKIA.menu.softkeys_visibility = true;
+                               NOKIA.menu.showSoftKeys();
+
+                       });
+
+
+                       //      MenuItems DIV events
+                       $("#MenuItemsArea").mouseover(function(){
+                               if(NOKIA.helper.intervalId)
+                                       clearInterval(NOKIA.helper.intervalId);
+
+                               $("#MenuItemsArea").show();
+                       });
+
+                       $("#MenuItemsArea").mouseout(function(){
+                               if(NOKIA.helper.intervalId)
+                                       clearInterval(NOKIA.helper.intervalId);
+
+                               NOKIA.helper.intervalId = setTimeout(function(){
+                                       NOKIA.menu.cancel()
+                               }, 500);
+                       });
+
+
+                       // Tabs
+                       $('#tabs').tabs({
+                               select : function(event, ui){
+                                       if(parseInt(ui.index) == 1)
+                                       {
+                                               $("#event-icons").show();
+                                               $("#event-battery-info").hide();
+                                               $("#event-messaging-info").hide();
+                                               $("#event-memory-info").hide();
+                                               
+                                               //      WRT versionn check
+                                               if(NOKIA.version == 'WRT 1.1')
+                                               {
+                                                       $("#event-messaging")[0].className = 'active';
+                                                       $("#event-memory")[0].className = 'active';
+                                               }else
+                                               {
+                                                       $("#event-messaging")[0].className = 'inactive';
+                                                       $("#event-memory")[0].className = 'inactive';
+                                               }
+                                               $("#event-battery")[0].className = 'active';
+                                       }else if(parseInt(ui.index) == 0)
+                                       {
+                                               $("#settings-view").show();
+                                               $("#mini-view-info").hide();
+                                       }
+                               }
+                       });
+
+                       
+                       /*      
+                        *      Event triggering
+                        */
+                       
+                       //      for battery
+                       $("#event-battery").click(function(event){
+                               if(event.target.className == 'active')
+                               {
+                                       $("#event-icons").hide();
+                                       $("#event-battery-info").show();
+
+/*
+                               $('#slider').slider('option', 'value', NOKIA.emulator.child._BRIDGE_REF.helper.getBatteryStrength());
+                               NOKIA.emulator.child._BRIDGE_REF.helper.getBatteryStrength()
+                               $('#slider').slider('option', 'value', 10);
+                               $('#slider').slider();
+*/
+                               }
+                       });
+
+                       $("#event-battery-back").click(function(event){
+                               $("#event-icons").show();
+                               $("#event-battery-info").hide();
+                       });
+
+
+                       //      for messaging
+                       $("#event-messaging").click(function(event){
+                               if(event.target.className == 'active')
+                               {
+                                       $("#event-icons").hide();
+                                       $("#event-messaging-info").show();
+                               }
+                       });
+
+                       $("#event-messaging-back").click(function(event){
+                               $("#event-icons").show();
+                               $("#event-messaging-info").hide();
+                       });
+
+
+                       //      for memory
+                       $("#event-memory").click(function(event){
+                               if(event.target.className == 'active')
+                               {
+                                       $("#event-icons").hide();
+                                       $("#event-memory-info").show();
+                               }
+                       });
+
+                       $("#event-memory-back").click(function(event){
+                               $("#event-icons").show();
+                               $("#event-memory-info").hide();
+                       });
+
+
+                       //      for minView more info
+                       $("#mini-view-back").click(function(event){
+                               $("#settings-view").show();
+                               $("#mini-view-info").hide();
+                       });
+
+
+                       // Slider
+                       $('#slider').slider({
+                               range: true,
+                               min : 0,
+                               max : 100,
+                               step : 1,
+                               value : 10,
+                               animate: true,
+                               slide: function(event, ui) {
+                                       $("#slider-value-panel > span").html(ui.value.toString());
+                               }
+                               });
+
+                       //      Bind Buttons to trigger values to WRT 1.0 / 1.1 bindings
+                       
+                       $("#connect-charger").click(NOKIA.helper.triggerEvents);
+                       $("#disconnect-charger").click(NOKIA.helper.triggerEvents);
+                       $("#update-batter-strength").click(NOKIA.helper.triggerEvents);
+
+                       $("#send-sms").click(NOKIA.helper.triggerEvents);
+                       $("#send-mms").click(NOKIA.helper.triggerEvents);
+
+                       $("#connect-memory-card").click(NOKIA.helper.triggerEvents);
+                       $("#disconnect-memory-card").click(NOKIA.helper.triggerEvents);
+                       
+               },
+               
+               setHomeScreen : function()
+               {
+                       //      HomeScreen Support
+                       if (NOKIA.deviceList[NOKIA.currentDevice].homeScreenSupport) {
+
+                               if (typeof NOKIA.emulator.plist.MiniViewEnabled != 'undefined') {
+                                       if (NOKIA.emulator.plist.MiniViewEnabled != 'false') 
+                                       {
+                                               $("#WidgetArea")[0].className = 'hs_' + NOKIA.mode;
+                                               
+                                               //      menu handlining
+                                               NOKIA.menu.softkeys_visibility = false;
+                                               NOKIA.menu.cancel();
+                                               NOKIA.menu.is_dimmed = true;
+                                               
+
+                                               $("#loaderDiv").html("Click on widget for Return to Full view");
+                                               $("#loaderDiv")[0].className = 'green';
+                                               $("#loaderDiv").show();
+
+                                               $("#iframeMask").show();
+                                               $("#orientationIcon").show();
+                                               $("#PreferencesBtn").hide();
+
+                                               $("#PreferencesTab").dialog('close');
+                                               return true;
+                                       }
+                               }
+                       }
+                       return false;                   
+               },
+               
+               getElementsLengthInObject : function(items){
+                       var count = 0;
+                       for (var i in items) 
+                       {
+                               if(!items[i].isDimmed)
+                                       count++;
+                       }
+                       
+                       return count;
+               },
+               
+               triggerEvents : function(event)
+               {
+                       if(typeof event.target.id == 'undefined')
+                       return false;
+                       
+                       switch(event.target.id)
+                       {
+                               //      for battery
+                               case 'connect-charger': 
+                                                                               NOKIA.helper.trigger("power", "chargerconnected", 1);
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.SysInfo", "Battery.ChargingStatus", {Status: 1});
+                                                                               break;
+
+                               case 'disconnect-charger': 
+                                                                               NOKIA.helper.trigger("power", "chargerconnected", 0);
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.SysInfo", "Battery.ChargingStatus", {Status: 0});
+                                                                               break;
+
+                               case 'update-batter-strength': 
+                                                                               var chargeValue = parseInt($('#slider').slider('value'));
+                                                                               NOKIA.helper.trigger("power", "chargelevel", chargeValue);
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.SysInfo", "Battery.BatteryStrength", {Status: chargeValue});
+                                                                               break;
+
+                               //      for messaging
+                               case 'send-sms': 
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.Messaging", "NewMessage", {MessageType: 'SMS'});
+                                                                               break;
+                               case 'send-mms': 
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.Messaging", "NewMessage", {MessageType: 'MMS'});
+                                                                               break;
+
+                               //      for memory
+                               case 'connect-memory-card': 
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.SysInfo", "Memory.MemoryCard", {Status: 1});
+                                                                               break;
+                               case 'disconnect-memory-card': 
+                                                                               if(NOKIA.version == 'WRT 1.1')
+                                                                                       NOKIA.helper.triggerSapi("Service.SysInfo", "Memory.MemoryCard", {Status: 0});
+                                                                               break;
+                       }
+               },      
+
+               triggerSapi : function(provider, eventType, data){
+                       NOKIA.emulator.child.device.implementation.triggerListener(provider, eventType, data);
+               },      
+
+               trigger : function(provider, eventType, data){
+                       NOKIA.emulator.child.widget.triggerListener(provider, eventType, data);
+               },
+               
+               showMiniviewHelp : function(){
+                       $("#settings-view").hide();
+                       $("#mini-view-info").show();
+               },
+               
+               checkDependencies : function(){
+                       
+                       for(var key in NOKIA.scriptsLoaded)
+                       {
+                               if(!NOKIA.scriptsLoaded[key])
+                                       return false;
+                       }
+
+                       //      for LSK
+                       NOKIA.menu.setLsk(NOKIA.emulator.child.menu.show);
+               
+                       //      for RSK
+                       NOKIA.menu.setRsk(NOKIA.menu.exit);
+
+                       return true;
+               }
+       };
+       
+
+       /*
+        * NOKIA.layout functions
+        */
+       NOKIA.namespace('layout');
+       NOKIA.layout = {
+               _console_minimized : true,
+               _console_enabled : false,
+               _consoleWindowHeight : 200,
+               _consoleHeaderHeight : 31,
+
+               init : function(){
+                       
+                       //      Toggle console window
+                       $('#Console-Toggle-Button').click(function(){
+                               
+                               NOKIA.layout._console_minimized = (NOKIA.layout._console_minimized) ? false : true;
+                               NOKIA.layout.render();
+                       });
+                       
+                       // clear Log
+                       $("#Console-Clear-Button").click(function(){
+                               $("#preview-ui-bottom-body")[0].innerHTML = '';
+                       });
+
+
+                       $('#preview-ui-bottom').show();
+                       NOKIA.layout.render();
+               },
+               
+               log : function(type, msg){
+                       var p = document.createElement('p');
+                       p.className = type;
+                       p.innerHTML = msg;
+                       var divBody = $('#preview-ui-bottom-body')
+                       divBody.append(p);
+                       divBody[0].scrollTop = divBody[0].scrollHeight;
+               },
+               
+               
+               render : function(){
+                       var _width = parseInt(window.innerWidth);
+                       var _height = parseInt(window.innerHeight);
+                       
+                       if(!NOKIA.layout._console_enabled)
+                       {
+                               $('#preview-ui-bottom').css({
+                                       display: 'none'
+                               });
+                               
+                               $('#preview-ui-top').css({
+                                       height: _height+'px'
+                               });
+
+                               return false;
+                       }
+                       
+                       
+                       if(!NOKIA.layout._console_minimized)
+                       {
+                               $('#Console-Toggle-Button')[0].className = 'open';
+                               
+                               //      set STYLE details for TOP window
+                               $('#preview-ui-top').css({
+                                       height: parseInt(_height - NOKIA.layout._consoleWindowHeight) + 'px'
+                               });
+                               
+                               //      set STYLE details for Bottom window
+                               $('#preview-ui-bottom').css({
+                                       height: NOKIA.layout._consoleWindowHeight + 'px',
+                                       display : 'block'
+                               });
+
+                               $('#preview-ui-bottom-header').css({
+                                       height: NOKIA.layout._consoleHeaderHeight + 'px'
+                               });
+
+                               $('#preview-ui-bottom-body').css({
+                                       height: parseInt(NOKIA.layout._consoleWindowHeight - NOKIA.layout._consoleHeaderHeight) + 'px',
+                                       display : 'block'
+                               });
+                               
+                               // Auto scroll when console window opened from MINIMIZED => MAXIMIZED state
+                               window.setTimeout(function(){
+                                       $('#preview-ui-bottom-body')[0].scrollTop = $('#preview-ui-bottom-body')[0].scrollHeight;
+                               }, 100);
+                               
+                       }else{
+                               $('#Console-Toggle-Button')[0].className = 'close';
+
+                               //      set STYLE details for TOP window
+                               $('#preview-ui-top').css({
+                                       height: parseInt(_height - NOKIA.layout._consoleHeaderHeight) + 'px'
+                               });
+                               
+                               //      set STYLE details for Bottom window
+                               $('#preview-ui-bottom').css({
+                                       height: NOKIA.layout._consoleHeaderHeight + 'px',
+                                       display : 'block'
+                               });
+
+                               $('#preview-ui-bottom-header').css({
+                                       height: NOKIA.layout._consoleHeaderHeight + 'px',
+                                       display : 'block'
+                               });
+
+                               $('#preview-ui-bottom-body').css({
+                                       display : 'none'
+                               });
+                       }
+               }
+               
+       };
+}
+
+$(document).ready(function () {
+       NOKIA.init();   
+});
+
+window.onresize = NOKIA.layout.render;
diff --git a/wrt/zouba/preview/script/resolution.js b/wrt/zouba/preview/script/resolution.js
new file mode 100644 (file)
index 0000000..0f91f61
--- /dev/null
@@ -0,0 +1,303 @@
+/*\r
+ * Device Resolution details\r
+ */\r
+var deviceResolutionList = {\r
+       '240x320'       :       {\r
+               'default'                       :       'portrait',\r
+               'orientation'           :       true,\r
+               'homeScreenSupport'     :       false,\r
+               'fontSize'                      :       '12px',\r
+               'portrait'      :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/240x320/Portrait.png)',\r
+                                       'width'                         : '600px',\r
+                                       'height'                        : '536px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '240px',\r
+                                       'height'        :       '320px',\r
+                                       'paddingTop':   '108px',\r
+                                       'marginLeft':   'auto'                          \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       240,\r
+                                       'height'        :       320,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       240,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '240px',\r
+                                       'height':       '50px',\r
+                                       'left'  :       '0px',\r
+                                       'top'   :       '0px',\r
+                                       'position':     'relative'\r
+                               },\r
+                               'softkeysImg' : {\r
+                                       'width' :       "50%",\r
+                                       'height':       "100%"\r
+                               }\r
+                       }\r
+               },\r
+               'landscape'     :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/240x320/Landscape.png)',\r
+                                       'width'                         : '848px',\r
+                                       'height'                        : '408px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '320px',\r
+                                       'height'        :       '240px',\r
+                                       'paddingTop':   '84px',\r
+                                       'marginLeft':   'auto'                          \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       320,\r
+                                       'height'        :       240,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       320,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '50px',\r
+                                       'height':       '240px',\r
+                                       'left'  :       '200px',\r
+                                       'top'   :       '-250px',\r
+                                       'position':     'relative'\r
+                               },      \r
+                               'softkeysImg' : {\r
+                                       'width' :       "100%",\r
+                                       'height':       "50%"\r
+                               }\r
+                       }\r
+               }\r
+       },\r
+\r
+       '320x240'       :       {\r
+               'default'                       :       'portrait',\r
+               'orientation'           :       true,\r
+               'homeScreenSupport'     :       false,\r
+               'fontSize'                      :       '12px',\r
+               'portrait'      :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/320x240/Portrait.png)',\r
+                                       'width'                         : '640px',\r
+                                       'height'                        : '472px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '320px',\r
+                                       'height'        :       '240px',\r
+                                       'paddingTop':   '113px',\r
+                                       'marginLeft':   '163px'                         \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       320,\r
+                                       'height'        :       240,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       320,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '320px',\r
+                                       'height':       '38px',\r
+                                       'left'  :       '0px',\r
+                                       'top'   :       '0px',\r
+                                       'position':     'relative'\r
+                               },\r
+                               'softkeysImg' : {\r
+                                       'width' :       "50%",\r
+                                       'height':       "100%"\r
+                               }\r
+                       }\r
+               },\r
+               'landscape'     :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/320x240/Landscape.png)',\r
+                                       'width'                         : '680px',\r
+                                       'height'                        : '472px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '240px',\r
+                                       'height'        :       '320px',\r
+                                       'paddingTop':   '76px',\r
+                                       'marginLeft':   '223px'                         \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       240,\r
+                                       'height'        :       320,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       240,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '30px',\r
+                                       'height':       '320px',\r
+                                       'left'  :       '150px',\r
+                                       'top'   :       '-330px',\r
+                                       'position':     'relative'\r
+                               },      \r
+                               'softkeysImg' : {\r
+                                       'width' :       "100%",\r
+                                       'height':       "50%"\r
+                               }\r
+                       }\r
+               }\r
+       },\r
+\r
+       '360x640'       :       {\r
+               'default'                       :       'portrait',\r
+               'orientation'           :       true,\r
+               'homeScreenSupport'     :       true,\r
+               'fontSize'                      :       '12px',\r
+               'portrait'      :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/360x640/Portrait.png)',\r
+                                       'width'                         : '678px',\r
+                                       'height'                        : '838px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '360px',\r
+                                       'height'        :       '640px',\r
+                                       'paddingTop':   '89px',\r
+                                       'marginLeft':   '158px'                         \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       360,\r
+                                       'height'        :       640,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       360,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '360px',\r
+                                       'height':       '50px',\r
+                                       'left'  :       '0px',\r
+                                       'top'   :       '0px',\r
+                                       'position':     'relative',\r
+                                       'marginLeft' : '159px'\r
+                               },\r
+                               'softkeysImg' : {\r
+                                       'width' :       "50%",\r
+                                       'height':       "100%"\r
+                               },\r
+                               'homeScreenDisplay':    {\r
+                                       'width'         :       '306px',\r
+                                       'height'        :       '76px'\r
+                               }\r
+                       }\r
+               },\r
+               'landscape'     :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/360x640/Landscape.png)',\r
+                                       'width'                         : '1054px',\r
+                                       'height'                        : '572px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '640px',\r
+                                       'height'        :       '360px',\r
+                                       'paddingTop':   '104px',\r
+                                       'marginLeft':   '206px'                         \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       640,\r
+                                       'height'        :       360,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       640,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '50px',\r
+                                       'height':       '360px',\r
+                                       'left'  :       '350px',\r
+                                       'top'   :       '-370px',\r
+                                       'position':     'relative',\r
+                                       'marginLeft':   'auto'  \r
+                               },      \r
+                               'softkeysImg' : {\r
+                                       'width' :       "100%",\r
+                                       'height':       "50%"\r
+                               },\r
+                               'homeScreenDisplay':    {\r
+                                       'width'         :       '306px',\r
+                                       'height'        :       '76px'\r
+                               }\r
+                       }\r
+               }\r
+       },\r
+\r
+       '800x352'       :       {\r
+               'default'                       :       'landscape',\r
+               'orientation'           :       false,\r
+               'homeScreenSupport'     :       false,\r
+               'fontSize'                      :       '12px',\r
+               'landscape'     :       {\r
+                       'style' :       {\r
+                               'layout'        :       {\r
+                                       'backgroundImage'       : 'url(preview/images/device/800x352/Landscape.png)',\r
+                                       'width'                         : '1180px',\r
+                                       'height'                        : '572px'\r
+                                       },\r
+                               'display':      {\r
+                                       'width'         :       '800px',\r
+                                       'height'        :       '352px',\r
+                                       'paddingTop':   '108px',\r
+                                       'marginLeft':   '190px'                         \r
+                                       },\r
+                               'widget':       {\r
+                                       'width'         :       800,\r
+                                       'height'        :       352,\r
+                                       'float'         :       'left'\r
+                                       },\r
+                               'menu'  :       {\r
+                                       'width'         :       800,\r
+                                       'height'        :       30,\r
+                                       'float'         :       'right',\r
+                                       'optionKeysheight'      :       24\r
+                                       },\r
+                               'softkeys'      :       {\r
+                                       'width' :       '50px',\r
+                                       'height':       '352px',\r
+                                       'left'  :       '432px',\r
+                                       'top'   :       '-364px',\r
+                                       'position':     'relative',\r
+                                       'marginLeft':   'auto'  \r
+                               },      \r
+                               'softkeysImg' : {\r
+                                       'width' :       "100%",\r
+                                       'height':       "50%"\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+\r
+};\r
diff --git a/wrt/zouba/preview/script/xml2json.js b/wrt/zouba/preview/script/xml2json.js
new file mode 100644 (file)
index 0000000..750548f
--- /dev/null
@@ -0,0 +1,172 @@
+/*\r
+xml2json v 1.1\r
+copyright 2005-2007 Thomas Frank\r
+\r
+This program is free software under the terms of the \r
+GNU General Public License version 2 as published by the Free \r
+Software Foundation. It is distributed without any warranty.\r
+*/\r
+\r
+var xml2json={ \r
+       parser:function(xmlcode,ignoretags,debug){\r
+               if(!ignoretags){ignoretags=""};\r
+               xmlcode=xmlcode.replace(/\s*\/>/g,'/>');\r
+               xmlcode=xmlcode.replace(/<\?[^>]*>/g,"").replace(/<\![^>]*>/g,"");\r
+               if (!ignoretags.sort){ignoretags=ignoretags.split(",")};\r
+               var x=this.no_fast_endings(xmlcode);\r
+               x=this.attris_to_tags(x);\r
+               x=escape(x);\r
+               x=x.split("%3C").join("<").split("%3E").join(">").split("%3D").join("=").split("%22").join("\"");\r
+               for (var i=0;i<ignoretags.length;i++){\r
+                       x=x.replace(new RegExp("<"+ignoretags[i]+">","g"),"*$**"+ignoretags[i]+"**$*");\r
+                       x=x.replace(new RegExp("</"+ignoretags[i]+">","g"),"*$***"+ignoretags[i]+"**$*")\r
+               };\r
+               x='<JSONTAGWRAPPER>'+x+'</JSONTAGWRAPPER>';\r
+               this.xmlobject={};\r
+               var y=this.xml_to_object(x).jsontagwrapper;\r
+               if(debug){y=this.show_json_structure(y,debug)};\r
+               return y\r
+       },\r
+       xml_to_object:function(xmlcode){\r
+               var x=xmlcode.replace(/<\//g,"§");\r
+               x=x.split("<");\r
+               var y=[];\r
+               var level=0;\r
+               var opentags=[];\r
+               for (var i=1;i<x.length;i++){\r
+                       var tagname=x[i].split(">")[0];\r
+                       opentags.push(tagname);\r
+                       level++\r
+                       y.push(level+"<"+x[i].split("§")[0]);\r
+                       while(x[i].indexOf("§"+opentags[opentags.length-1]+">")>=0){level--;opentags.pop()}\r
+               };\r
+               var oldniva=-1;\r
+               var objname="this.xmlobject";\r
+               for (var i=0;i<y.length;i++){\r
+                       var preeval="";\r
+                       var niva=y[i].split("<")[0];\r
+                       var tagnamn=y[i].split("<")[1].split(">")[0];\r
+                       tagnamn=tagnamn.toLowerCase();\r
+                       var rest=y[i].split(">")[1];\r
+                       if(niva<=oldniva){\r
+                               var tabort=oldniva-niva+1;\r
+                               for (var j=0;j<tabort;j++){objname=objname.substring(0,objname.lastIndexOf("."))}\r
+                       };\r
+                       objname+="."+tagnamn;\r
+                       var pobject=objname.substring(0,objname.lastIndexOf("."));\r
+                       if (eval("typeof "+pobject) != "object"){preeval+=pobject+"={value:"+pobject+"};\n"};\r
+                       var objlast=objname.substring(objname.lastIndexOf(".")+1);\r
+                       var already=false;\r
+                       for (k in eval(pobject)){if(k==objlast){already=true}};\r
+                       var onlywhites=true;\r
+                       for(var s=0;s<rest.length;s+=3){\r
+                               if(rest.charAt(s)!="%"){onlywhites=false}\r
+                       };\r
+                       if (rest!="" && !onlywhites){\r
+                               if(rest/1!=rest){\r
+                                       rest="'"+rest.replace(/\'/g,"\\'")+"'";\r
+                                       rest=rest.replace(/\*\$\*\*\*/g,"</");\r
+                                       rest=rest.replace(/\*\$\*\*/g,"<");\r
+                                       rest=rest.replace(/\*\*\$\*/g,">")\r
+                               }\r
+                       } \r
+                       else {rest="{}"};\r
+                       if(rest.charAt(0)=="'"){rest='unescape('+rest+')'};\r
+                       if (already && !eval(objname+".sort")){preeval+=objname+"=["+objname+"];\n"};\r
+                       var before="=";after="";\r
+                       if (already){before=".push(";after=")"};\r
+                       var toeval=preeval+objname+before+rest+after;\r
+                       eval(toeval);\r
+                       if(eval(objname+".sort")){objname+="["+eval(objname+".length-1")+"]"};\r
+                       oldniva=niva\r
+               };\r
+               return this.xmlobject\r
+       },\r
+       show_json_structure:function(obj,debug,l){\r
+               var x='';\r
+               if (obj.sort){x+="[\n"} else {x+="{\n"};\r
+               for (var i in obj){\r
+                       if (!obj.sort){x+=i+":"};\r
+                       if (typeof obj[i] == "object"){\r
+                               x+=this.show_json_structure(obj[i],false,1)\r
+                       }\r
+                       else {\r
+                               if(typeof obj[i]=="function"){\r
+                                       var v=obj[i]+"";\r
+                                       //v=v.replace(/\t/g,"");\r
+                                       x+=v\r
+                               }\r
+                               else if(typeof obj[i]!="string"){x+=obj[i]+",\n"}\r
+                               else {x+="'"+obj[i].replace(/\'/g,"\\'").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")+"',\n"}\r
+                       }\r
+               };\r
+               if (obj.sort){x+="],\n"} else {x+="},\n"};\r
+               if (!l){\r
+                       x=x.substring(0,x.lastIndexOf(","));\r
+                       x=x.replace(new RegExp(",\n}","g"),"\n}");\r
+                       x=x.replace(new RegExp(",\n]","g"),"\n]");\r
+                       var y=x.split("\n");x="";\r
+                       var lvl=0;\r
+                       for (var i=0;i<y.length;i++){\r
+                               if(y[i].indexOf("}")>=0 || y[i].indexOf("]")>=0){lvl--};\r
+                               tabs="";for(var j=0;j<lvl;j++){tabs+="\t"};\r
+                               x+=tabs+y[i]+"\n";\r
+                               if(y[i].indexOf("{")>=0 || y[i].indexOf("[")>=0){lvl++}\r
+                       };\r
+                       if(debug=="html"){\r
+                               x=x.replace(/</g,"&lt;").replace(/>/g,"&gt;");\r
+                               x=x.replace(/\n/g,"<BR>").replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;")\r
+                       };\r
+                       if (debug=="compact"){x=x.replace(/\n/g,"").replace(/\t/g,"")}\r
+               };\r
+               return x\r
+       },\r
+       no_fast_endings:function(x){\r
+               x=x.split("/>");\r
+               for (var i=1;i<x.length;i++){\r
+                       var t=x[i-1].substring(x[i-1].lastIndexOf("<")+1).split(" ")[0];\r
+                       x[i]="></"+t+">"+x[i]\r
+               }       ;\r
+               x=x.join("");\r
+               return x\r
+       },\r
+       attris_to_tags: function(x){\r
+               var d=' ="\''.split("");\r
+               x=x.split(">");\r
+               for (var i=0;i<x.length;i++){\r
+                       var temp=x[i].split("<");\r
+                       for (var r=0;r<4;r++){temp[0]=temp[0].replace(new RegExp(d[r],"g"),"_jsonconvtemp"+r+"_")};\r
+                       if(temp[1]){\r
+                               temp[1]=temp[1].replace(/'/g,'"');\r
+                               temp[1]=temp[1].split('"');\r
+                               for (var j=1;j<temp[1].length;j+=2){\r
+                                       for (var r=0;r<4;r++){temp[1][j]=temp[1][j].replace(new RegExp(d[r],"g"),"_jsonconvtemp"+r+"_")}\r
+                               };\r
+                               temp[1]=temp[1].join('"')\r
+                       };\r
+                       x[i]=temp.join("<")\r
+               };\r
+               x=x.join(">");\r
+               x=x.replace(/ ([^=]*)=([^ |>]*)/g,"><$1>$2</$1");\r
+               x=x.replace(/>"/g,">").replace(/"</g,"<");\r
+               for (var r=0;r<4;r++){x=x.replace(new RegExp("_jsonconvtemp"+r+"_","g"),d[r])}  ;\r
+               return x\r
+       }\r
+};\r
+\r
+\r
+if(!Array.prototype.push){\r
+       Array.prototype.push=function(x){\r
+               this[this.length]=x;\r
+               return true\r
+       }\r
+};\r
+\r
+if (!Array.prototype.pop){\r
+       Array.prototype.pop=function(){\r
+               var response = this[this.length-1];\r
+               this.length--;\r
+               return response\r
+       }\r
+};\r
+\r
diff --git a/wrt/zouba/test.xml b/wrt/zouba/test.xml
new file mode 100644 (file)
index 0000000..b00a94a
--- /dev/null
@@ -0,0 +1,264 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<MTRXML version="1.0">
+       <ROUTE from="start" to="dest">
+               <LENGTH time="13.444" dist="2429.651"/>
+               <POINT uid="start" x="2549183.0" y="6672570.0">
+                       <ARRIVAL date="20091022" time="1847"/>
+                       <DEPARTURE date="20091022" time="1847"/>
+               </POINT>
+               <WALK>
+                       <LENGTH time="6.127" dist="492.346"/>
+                       <POINT uid="start" x="2549183.0" y="6672570.0">
+                               <ARRIVAL date="20091022" time="1847"/>
+                               <DEPARTURE date="20091022" time="1847"/>
+                       </POINT>
+                       <MAPLOC x="2549376.8" y="6672603.7" type="0">
+                               <ARRIVAL date="20091022" time="1851"/>
+                               <DEPARTURE date="20091022" time="1851"/>
+                               <NAME lang="1" val="Koillisväylä"/>
+                       </MAPLOC>
+                       <MAPLOC x="2549326.7" y="6672446.7" type="0">
+                               <ARRIVAL date="20091022" time="1853"/>
+                               <DEPARTURE date="20091022" time="1853"/>
+                               <NAME lang="1" val="Lauttasaarentie"/>
+                       </MAPLOC>
+                       <STOP code="6:1310104" x="2549390.0" y="6672438.0" id="1359">
+                               <ARRIVAL date="20091022" time="1854"/>
+                               <DEPARTURE date="20091022" time="1854"/>
+                               <NAME lang="1" val="Koillisväylä"/>
+                               <NAME lang="2" val="Nordostpassagen"/>
+                       </STOP>
+               </WALK>
+               <LINE id="120" code="1020  2" type="1" mobility="3">
+                       <LENGTH time="5.000" dist="1731.461"/>
+                       <STOP code="6:1310104" x="2549390.0" y="6672438.0" id="1359" ord="10">
+                               <ARRIVAL date="20091022" time="1854"/>
+                               <DEPARTURE date="20091022" time="1854"/>
+                               <NAME lang="1" val="Koillisväylä"/>
+                               <NAME lang="2" val="Nordostpassagen"/>
+                       </STOP>
+                       <STOP code="6:1310102" x="2549667.0" y="6672491.0" id="1357">
+                               <ARRIVAL date="20091022" time="1855"/>
+                               <DEPARTURE date="20091022" time="1855"/>
+                               <NAME lang="1" val="Lauttasaaren silta"/>
+                               <NAME lang="2" val="Drumsö bro"/>
+                       </STOP>
+                       <STOP code="6:1201132" x="2550475.0" y="6672792.0" id="748">
+                               <ARRIVAL date="20091022" time="1857"/>
+                               <DEPARTURE date="20091022" time="1857"/>
+                               <NAME lang="1" val="Salmisaari"/>
+                               <NAME lang="2" val="Sundholmen"/>
+                       </STOP>
+                       <STOP code="6:1201130" x="2550894.0" y="6672861.0" id="746" ord="13">
+                               <ARRIVAL date="20091022" time="1859"/>
+                               <DEPARTURE date="20091022" time="1859"/>
+                               <NAME lang="1" val="Länsiväylä"/>
+                               <NAME lang="2" val="Västerleden"/>
+                       </STOP>
+               </LINE>
+               <WALK>
+                       <LENGTH time="2.317" dist="205.844"/>
+                       <STOP code="6:1201130" x="2550894.0" y="6672861.0" id="746">
+                               <ARRIVAL date="20091022" time="1859"/>
+                               <DEPARTURE date="20091022" time="1859"/>
+                               <NAME lang="1" val="Länsiväylä"/>
+                               <NAME lang="2" val="Västerleden"/>
+                       </STOP>
+                       <MAPLOC x="2550949.3" y="6672867.5" type="15">
+                               <ARRIVAL date="20091022" time="1859"/>
+                               <DEPARTURE date="20091022" time="1859"/>
+                       </MAPLOC>
+                       <MAPLOC x="2550977.7" y="6672869.1" type="7">
+                               <ARRIVAL date="20091022" time="1900"/>
+                               <DEPARTURE date="20091022" time="1900"/>
+                               <NAME lang="1" val="Porkkalankatu"/>
+                       </MAPLOC>
+                       <MAPLOC x="2551034.9" y="6672875.6" type="7">
+                               <ARRIVAL date="20091022" time="1901"/>
+                               <DEPARTURE date="20091022" time="1901"/>
+                       </MAPLOC>
+                       <POINT uid="dest" x="2551042.0" y="6672829.0">
+                               <ARRIVAL date="20091022" time="1901"/>
+                               <DEPARTURE date="20091022" time="1901"/>
+                       </POINT>
+               </WALK>
+               <POINT uid="dest" x="2551042.0" y="6672829.0">
+                       <ARRIVAL date="20091022" time="1901"/>
+                       <DEPARTURE date="20091022" time="1901"/>
+               </POINT>
+       </ROUTE>
+       <ROUTE from="start" to="dest">
+               <LENGTH time="13.459" dist="2431.106"/>
+               <POINT uid="start" x="2549183.0" y="6672570.0">
+                       <ARRIVAL date="20091022" time="1849"/>
+                       <DEPARTURE date="20091022" time="1849"/>
+               </POINT>
+               <WALK>
+                       <LENGTH time="6.155" dist="495.850"/>
+                       <POINT uid="start" x="2549183.0" y="6672570.0">
+                               <ARRIVAL date="20091022" time="1849"/>
+                               <DEPARTURE date="20091022" time="1849"/>
+                       </POINT>
+                       <MAPLOC x="2549376.8" y="6672603.7" type="0">
+                               <ARRIVAL date="20091022" time="1853"/>
+                               <DEPARTURE date="20091022" time="1853"/>
+                               <NAME lang="1" val="Koillisväylä"/>
+                       </MAPLOC>
+                       <MAPLOC x="2549326.7" y="6672446.7" type="0">
+                               <ARRIVAL date="20091022" time="1855"/>
+                               <DEPARTURE date="20091022" time="1855"/>
+                               <NAME lang="1" val="Lauttasaarentie"/>
+                       </MAPLOC>
+                       <STOP code="6:1310204" x="2549393.0" y="6672438.0" id="1405">
+                               <ARRIVAL date="20091022" time="1856"/>
+                               <DEPARTURE date="20091022" time="1856"/>
+                               <NAME lang="1" val="Koillisväylä"/>
+                               <NAME lang="2" val="Nordostpassagen"/>
+                       </STOP>
+               </WALK>
+               <LINE id="586" code="2106T 2" type="5" mobility="3">
+                       <LENGTH time="5.000" dist="1731.231"/>
+                       <STOP code="6:1310204" x="2549393.0" y="6672438.0" id="1405" ord="37">
+                               <ARRIVAL date="20091022" time="1856"/>
+                               <DEPARTURE date="20091022" time="1856"/>
+                               <NAME lang="1" val="Koillisväylä"/>
+                               <NAME lang="2" val="Nordostpassagen"/>
+                       </STOP>
+                       <STOP code="6:1310202" x="2549670.0" y="6672492.0" id="1403">
+                               <ARRIVAL date="20091022" time="1858"/>
+                               <DEPARTURE date="20091022" time="1858"/>
+                               <NAME lang="1" val="Lauttasaaren silta"/>
+                               <NAME lang="2" val="Drumsö bro"/>
+                       </STOP>
+                       <STOP code="6:1201232" x="2550473.0" y="6672790.0" id="760">
+                               <ARRIVAL date="20091022" time="1859"/>
+                               <DEPARTURE date="20091022" time="1859"/>
+                               <NAME lang="1" val="Salmisaari"/>
+                               <NAME lang="2" val="Sundholmen"/>
+                       </STOP>
+                       <STOP code="6:1201228" x="2550896.0" y="6672861.0" id="756" ord="40">
+                               <ARRIVAL date="20091022" time="1901"/>
+                               <DEPARTURE date="20091022" time="1901"/>
+                               <NAME lang="1" val="Länsiväylä"/>
+                               <NAME lang="2" val="Västerleden"/>
+                       </STOP>
+               </LINE>
+               <WALK>
+                       <LENGTH time="2.303" dist="204.026"/>
+                       <STOP code="6:1201228" x="2550896.0" y="6672861.0" id="756">
+                               <ARRIVAL date="20091022" time="1901"/>
+                               <DEPARTURE date="20091022" time="1901"/>
+                               <NAME lang="1" val="Länsiväylä"/>
+                               <NAME lang="2" val="Västerleden"/>
+                       </STOP>
+                       <MAPLOC x="2550949.3" y="6672867.5" type="15">
+                               <ARRIVAL date="20091022" time="1901"/>
+                               <DEPARTURE date="20091022" time="1901"/>
+                       </MAPLOC>
+                       <MAPLOC x="2550977.7" y="6672869.1" type="7">
+                               <ARRIVAL date="20091022" time="1902"/>
+                               <DEPARTURE date="20091022" time="1902"/>
+                               <NAME lang="1" val="Porkkalankatu"/>
+                       </MAPLOC>
+                       <MAPLOC x="2551034.9" y="6672875.6" type="7">
+                               <ARRIVAL date="20091022" time="1903"/>
+                               <DEPARTURE date="20091022" time="1903"/>
+                       </MAPLOC>
+                       <POINT uid="dest" x="2551042.0" y="6672829.0">
+                               <ARRIVAL date="20091022" time="1903"/>
+                               <DEPARTURE date="20091022" time="1903"/>
+                       </POINT>
+               </WALK>
+               <POINT uid="dest" x="2551042.0" y="6672829.0">
+                       <ARRIVAL date="20091022" time="1903"/>
+                       <DEPARTURE date="20091022" time="1903"/>
+               </POINT>
+       </ROUTE>
+       <ROUTE from="start" to="dest">
+               <LENGTH time="12.459" dist="2431.106"/>
+               <POINT uid="start" x="2549183.0" y="6672570.0">
+                       <ARRIVAL date="20091022" time="1859"/>
+                       <DEPARTURE date="20091022" time="1859"/>
+               </POINT>
+               <WALK>
+                       <LENGTH time="6.155" dist="495.850"/>
+                       <POINT uid="start" x="2549183.0" y="6672570.0">
+                               <ARRIVAL date="20091022" time="1859"/>
+                               <DEPARTURE date="20091022" time="1859"/>
+                       </POINT>
+                       <MAPLOC x="2549376.8" y="6672603.7" type="0">
+                               <ARRIVAL date="20091022" time="1903"/>
+                               <DEPARTURE date="20091022" time="1903"/>
+                               <NAME lang="1" val="Koillisväylä"/>
+                       </MAPLOC>
+                       <MAPLOC x="2549326.7" y="6672446.7" type="0">
+                               <ARRIVAL date="20091022" time="1905"/>
+                               <DEPARTURE date="20091022" time="1905"/>
+                               <NAME lang="1" val="Lauttasaarentie"/>
+                       </MAPLOC>
+                       <STOP code="6:1310204" x="2549393.0" y="6672438.0" id="1405">
+                               <ARRIVAL date="20091022" time="1906"/>
+                               <DEPARTURE date="20091022" time="1906"/>
+                               <NAME lang="1" val="Koillisväylä"/>
+                               <NAME lang="2" val="Nordostpassagen"/>
+                       </STOP>
+               </WALK>
+               <LINE id="596" code="2110T 2" type="5" mobility="3">
+                       <LENGTH time="4.000" dist="1731.231"/>
+                       <STOP code="6:1310204" x="2549393.0" y="6672438.0" id="1405" ord="33">
+                               <ARRIVAL date="20091022" time="1906"/>
+                               <DEPARTURE date="20091022" time="1906"/>
+                               <NAME lang="1" val="Koillisväylä"/>
+                               <NAME lang="2" val="Nordostpassagen"/>
+                       </STOP>
+                       <STOP code="6:1310202" x="2549670.0" y="6672492.0" id="1403">
+                               <ARRIVAL date="20091022" time="1907"/>
+                               <DEPARTURE date="20091022" time="1907"/>
+                               <NAME lang="1" val="Lauttasaaren silta"/>
+                               <NAME lang="2" val="Drumsö bro"/>
+                       </STOP>
+                       <STOP code="6:1201232" x="2550473.0" y="6672790.0" id="760">
+                               <ARRIVAL date="20091022" time="1909"/>
+                               <DEPARTURE date="20091022" time="1909"/>
+                               <NAME lang="1" val="Salmisaari"/>
+                               <NAME lang="2" val="Sundholmen"/>
+                       </STOP>
+                       <STOP code="6:1201228" x="2550896.0" y="6672861.0" id="756" ord="36">
+                               <ARRIVAL date="20091022" time="1910"/>
+                               <DEPARTURE date="20091022" time="1910"/>
+                               <NAME lang="1" val="Länsiväylä"/>
+                               <NAME lang="2" val="Västerleden"/>
+                       </STOP>
+               </LINE>
+               <WALK>
+                       <LENGTH time="2.303" dist="204.026"/>
+                       <STOP code="6:1201228" x="2550896.0" y="6672861.0" id="756">
+                               <ARRIVAL date="20091022" time="1910"/>
+                               <DEPARTURE date="20091022" time="1910"/>
+                               <NAME lang="1" val="Länsiväylä"/>
+                               <NAME lang="2" val="Västerleden"/>
+                       </STOP>
+                       <MAPLOC x="2550949.3" y="6672867.5" type="15">
+                               <ARRIVAL date="20091022" time="1910"/>
+                               <DEPARTURE date="20091022" time="1910"/>
+                       </MAPLOC>
+                       <MAPLOC x="2550977.7" y="6672869.1" type="7">
+                               <ARRIVAL date="20091022" time="1911"/>
+                               <DEPARTURE date="20091022" time="1911"/>
+                               <NAME lang="1" val="Porkkalankatu"/>
+                       </MAPLOC>
+                       <MAPLOC x="2551034.9" y="6672875.6" type="7">
+                               <ARRIVAL date="20091022" time="1912"/>
+                               <DEPARTURE date="20091022" time="1912"/>
+                       </MAPLOC>
+                       <POINT uid="dest" x="2551042.0" y="6672829.0">
+                               <ARRIVAL date="20091022" time="1912"/>
+                               <DEPARTURE date="20091022" time="1912"/>
+                       </POINT>
+               </WALK>
+               <POINT uid="dest" x="2551042.0" y="6672829.0">
+                       <ARRIVAL date="20091022" time="1912"/>
+                       <DEPARTURE date="20091022" time="1912"/>
+               </POINT>
+       </ROUTE>
+</MTRXML>
\ No newline at end of file
diff --git a/wrt/zouba/wrt_preview_frame.html b/wrt/zouba/wrt_preview_frame.html
new file mode 100644 (file)
index 0000000..9e81f68
--- /dev/null
@@ -0,0 +1,218 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
+       <title>Nokia WRT Preview</title>\r
+       <!-- jQuery-ui Begins -->\r
+               <link type="text/css" rel="stylesheet"  href="preview/script/jquery-ui/css/ui-darkness/ui.all.css"/>    \r
+               <script type="text/javascript" src="preview/script/jquery-ui/js/jquery-1.2.6.min.js"></script>\r
+               <script type="text/javascript" src="preview/script/jquery-ui/js/jquery-ui-1.6.custom.min.js"></script>\r
+       <!-- jQuery-ui Ends --> \r
+       <script type="text/javascript" language="JavaScript" src="preview/script/xml2json.js"></script>\r
+       <script type="text/javascript" language="JavaScript" src="preview/script/nokia.js"></script>\r
+       <script type="text/javascript" language="JavaScript" src="preview/script/resolution.js"></script>\r
+       <link type="text/css" rel="stylesheet"  href="preview/css/style.css"/>\r
+</head>\r
+<body>\r
+       <div id="preview-ui-top">\r
+               <div id="DeviceDisplayLayout" class="hide">\r
+                       <div id="DisplaySFKWrapper">\r
+                               <div id="DisplayArea">\r
+                                       <div id="IconArea"></div>\r
+                                       <div id="WidgetArea">\r
+                                               <div id="iframeMask" class="hide"></div>\r
+                                               <iframe src=""></iframe>\r
+                                       </div>\r
+                                       <div id="MenuItemsArea" class="scroll-pane">\r
+                                               <ul>\r
+                                                       <li><a href="javascript:void(0);">Exit</a></li>\r
+                                               </ul>\r
+                                       </div>\r
+                                       <div id="SoftKeysArea">\r
+                                               <ul>\r
+                                                       <li id="LskLabel"><a href="javascript:void(0);">Options</a></li>\r
+                                                       <li id="RskLabel"><a href="javascript:void(0);">Exit</a></li>\r
+                                               </ul>\r
+                                       </div>\r
+                               </div>\r
+                               <div id="SoftKeys">\r
+                                       <a href="javascript:void(0);"><img src="preview/images/TransperantImage.png" name="LskArea" border="0" id="LskArea"/></a><a href="javascript:void(0);"><img src="preview/images/TransperantImage.png" name="RskArea" border="0" id="RskArea"/></a> </div>\r
+                               </div>\r
+                       </div>\r
+               <div id="Dialog" title="Notification window"></div>\r
+<div id="PreferencesTab" class="hide">\r
+       <div id="tabs">\r
+               <ul>\r
+                       <li><a href="#tabs-1">Preferences</a></li>\r
+                       <li><a href="#tabs-2">Event Triggers</a></li>\r
+               </ul>\r
+               <div id="tabs-1">\r
+                       <div id="settings-view">\r
+               <table width="100%" cellpadding="0" cellspacing="0">\r
+                       <tr>\r
+                               <th>\r
+                                       Resolution\r
+                               </th>\r
+                               <td>\r
+                                       <select id="resOptions">\r
+                                               <option selected="true" value="http://www.forum.nokia.com/devices/matrix_240x320_1.html">240x320</option>\r
+                                               <option value="http://www.forum.nokia.com/devices/matrix_320x240_1.html">320x240</option>\r
+                                               <option value="http://www.forum.nokia.com/devices/matrix_360x640_1.html">360x640</option>\r
+                                               <option value="http://www.forum.nokia.com/devices/E90_Communicator">800x352</option>\r
+                                       </select>&nbsp; \r
+                                       <a class="link" target="_blank" href="http://www.forum.nokia.com/devices/matrix_240x320_1.html" id="resSupportLink">Device matrix featuring this resolution</a>\r
+                                       <span id="dwDeviceHelp" class="hide" >See WRT Help for device specifications</span>\r
+                               </td>\r
+                       </tr>\r
+                       <tr>\r
+                               <th>\r
+                                       Orientation                                     \r
+                               </th>\r
+                               <td>\r
+                                       <div id="Orientation_Controls" class="hide">\r
+                                               <label><input type="radio" name="input_orientation" id="input_portrait" value="portrait"/> Portrait</label>     \r
+                                               <label><input type="radio" name="input_orientation" id="input_landscape" value="landscape"/> Landscape</label>  \r
+                                       </div>\r
+                                       <div id="Orientation_Info" class="hide">\r
+                                       </div>\r
+                               </td>\r
+                       </tr>\r
+                       <tr>\r
+                               <th>\r
+                                       WRT Version\r
+                               </th>\r
+                               <td>\r
+                                       <label><input type="radio" name="wrt_version" id="wrt_version_1_0" value="WRT 1.0"/> WRT 1.0</label>    \r
+                                       <label><input type="radio" name="wrt_version" id="wrt_version_1_1" value="WRT 1.1"/> WRT 1.1</label>    \r
+                               </td>\r
+                       </tr>\r
+                       <tr>\r
+                               <th>\r
+                                       Home Screen view\r
+                               </th>\r
+                               <td>\r
+                                       <div id="HS_Control_Info">\r
+                                               Hello\r
+                                       </div>\r
+                               </td>\r
+                       </tr>\r
+               </table>\r
+               </div>\r
+               \r
+                       <div id="mini-view-info" class="hide">\r
+                               <div class="ui-panel">\r
+                                       <a class="ui-button" id="mini-view-back">Back</a>\r
+                               </div>\r
+                               <table cellpadding='0' cellspacing='0' width="100%">\r
+                                       <tr>\r
+                                               <th>To enable Mini view support for HomeScreen widget </th>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td>\r
+                                                       Add this line in Info.plist file\r
+                                                       <code>&lt;key&gt;MiniViewEnabled&lt;/key&gt;<br/>&lt;true/&gt;</code>\r
+                                                       and optionally add the following to the MainHTML file\r
+                                                       <code>&lt;div id="miniView"&gt; &lt;--  Define your Home Screen view here  --&gt; &lt;/div&gt;</code><br/>\r
+                                                       See Web Developer's Library for <a class="link" href="http://library.forum.nokia.com/index.jsp?topic=/Web_Developers_Library/GUID-63F4E17E-8895-4054-82AD-762B90610B30.html" target="_blank">more details</a>\r
+                                               </td>\r
+                                       </tr>\r
+                               </table>\r
+                       </div>\r
+               \r
+               \r
+               </div>\r
+               <div id="tabs-2">\r
+                       \r
+                       <div id="event-icons">\r
+                               <div id="event-battery"></div>\r
+                               <div id="event-messaging"></div>\r
+                               <div id="event-memory"></div>\r
+                       </div>\r
+\r
+                       <div id="event-battery-info" class="hide">\r
+                               <div class="ui-panel">\r
+                                       <a class="ui-button" id="event-battery-back">Back</a>\r
+                               </div>\r
+                               <table cellpadding='0' cellspacing='0' width="100%">\r
+                                       <tr>\r
+                                               <th colspan="2">Battery Triggers</th>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td>Charging status</td>\r
+                                               <td>\r
+                                                       <a class="ui-button-fixed" id="connect-charger">Connect charger</a>\r
+                                                       <a class="ui-button-fixed" id="disconnect-charger">Disconnect charger</a>\r
+                                               </td>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td>Battery Strength</td>\r
+                                               <td>\r
+                                                       <div id="slider"></div>\r
+                                                       <div id="slider-value-panel"><span>0</span></div>\r
+                                                       <div><a class="ui-button-fixed" id="update-batter-strength">Update</a></div>\r
+                                               </td>\r
+                                       </tr>\r
+                               </table>\r
+                       </div>\r
+\r
+                       <div id="event-messaging-info" class="hide">\r
+                               <div class="ui-panel">\r
+                                       <a class="ui-button" id="event-messaging-back">Back</a>\r
+                               </div>\r
+                               <table cellpadding='0' cellspacing='0' width="100%">\r
+                                       <tr>\r
+                                               <th colspan="2">Message Triggers</th>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td>New message</td>\r
+                                               <td>\r
+                                                       <a class="ui-button-fixed" id="send-sms">Trigger new SMS</a>\r
+                                                       <a class="ui-button-fixed" id="send-mms">Trigger new MMS</a>\r
+                                               </td>\r
+                                       </tr>\r
+                               </table>\r
+                       </div>\r
+\r
+                       <div id="event-memory-info" class="hide">\r
+                               <div class="ui-panel">\r
+                                       <a class="ui-button" id="event-memory-back">Back</a>\r
+                               </div>\r
+                               <table cellpadding='0' cellspacing='0' width="100%">\r
+                                       <tr>\r
+                                               <th colspan="2">Memory Triggers</th>\r
+                                       </tr>\r
+                                       <tr>\r
+                                               <td>Memory Card</td>\r
+                                               <td>\r
+                                                       <a class="ui-button-fixed" id="connect-memory-card">Connect</a>\r
+                                                       <a class="ui-button-fixed" id="disconnect-memory-card">Disconnect</a>\r
+                                               </td>\r
+                                       </tr>\r
+                               </table>\r
+                       </div>\r
+                       \r
+               </div>\r
+       </div>\r
+</div>\r
+       </div>\r
+       <div id="preview-ui-bottom">\r
+               <div id="preview-ui-bottom-header">\r
+                       <div>Console window</div>\r
+                       <span class="open" id="Console-Toggle-Button"></span>\r
+                       <span id="Console-Clear-Button"></span>\r
+               </div>\r
+               <div style="clear:left;"></div>\r
+               <div id="preview-ui-bottom-body">\r
+               </div>\r
+       </div>\r
+       <div id="PreferencesBtn" class="hide"></div>\r
+       <div id="orientationIcon"></div>\r
+       <div id="loaderDiv"></div>\r
+       <div id="NotificationDiv" class="hide">\r
+               <p>NOKIA WRT Simulation may not work properly on this browser, <br/>Firefox is recommended for widget preview and debugging.  <br/><br/><strong>Continue?</strong></p>\r
+       </div>\r
+       <div id="BrowserNotificationBar" class="hide">\r
+               <p><a></a>NOKIA WRT Simulation may not work properly on this browser, Firefox is recommended for widget preview and debugging</p>\r
+       </div>\r
+</body>\r
+</html>\r
diff --git a/wrt/zouba/wrt_preview_main.html b/wrt/zouba/wrt_preview_main.html
new file mode 100644 (file)
index 0000000..c313c98
--- /dev/null
@@ -0,0 +1,33 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+       <script language="JavaScript" type="text/javascript" src="preview/script/lib/loader.js"></script>
+
+        <title></title>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+        <script type="text/javascript" src="WRTKit/WRTKit.js"></script>
+        <script type="text/javascript" src="basic.js"></script>
+        <link rel="stylesheet" href="basic.css" type="text/css">
+    </head>
+    <body onload="init()">
+        <table id="timeTable" align="center" border="1">
+        </table>
+        <table border="0" align="center">
+        <tr>
+            <td>
+                <button onclick="takeMeHome()">
+                    HOME
+                </button>
+            </td>
+            <td>
+                <button onclick="takeMeToWork()">
+                    WORK
+                </button>
+            </td>
+        </tr>
+               <tr>
+               <td>debug</td>
+               <td id="debug"></td>
+               </tr>
+    </body>
+</html>
diff --git a/wrt/zouba/zouba.wgz b/wrt/zouba/zouba.wgz
new file mode 100644 (file)
index 0000000..394df60
Binary files /dev/null and b/wrt/zouba/zouba.wgz differ