去年の8月に作成したので、すっかり忘れてます。本体のアプリをGoogle App Engineに移したので、ガジェットもリンク先を変更しました。どこのファイルを変えるのかが、思い出せなかったのでファイルの構成を記します。このアプリはPanoramioのグループ写真をスライドショーで見せるツールをガジェット化したものです。ツール本体は今年Google App Engineに移動させました。※justmystageのファイルは未だ残してありますが、現時点では来年の3月で契約終了予定です。
- PGP_slideshow.gadget
- 1597930.jpg 96 x 96 のアイコン(だるまさん) ガジェットの詳細で使用
- camera.png 64 x 64 のアイコン(カメラ) ガジェットのアイコン
- gadget.xml
- index.html
- settings.html
- <js> javascriptのホルダー
- index.js
- settings.js
★最初はgadget.xml
1: <?xml version="1.0" encoding="utf-8" ?>
2: <gadget>
3: <name>PGP_slideshow</name>
4: <namespace>PGP_slideshow.gadgets</namespace>
5: <version>1.0.0.3</version>
6: <author name="junk0128">
7: <info url="http://junk0128-tools.appspot.com/pgp_slideshow/readme.html" />
8: <logo src="1597930.jpg" />
9: </author>
10: <copyright>©2011</copyright>
11: <description>This is a program that displays the Panoramio group photos. </description>
12: <icons>
13: <icon height="48" width="48" src="camera.png" />
14: </icons>
15: <hosts>
16: <host name="sidebar">
17: <base type="HTML" apiVersion="1.0.0" src="index.html" />
18: <permissions>full</permissions>
19: <platform minPlatformVersion="1.0" />
20: </host>
21: </hosts>
22: </gadget>
3~11行目はガジェットウインドウでアイコンを選択し、「詳細表示を表示する」クリックで表示されます。13行目はガジェットウインドウでのアイコンです。今回の様にリンク先が変わる時は7行目の修正が必要です。
★index.html 今回は修正不要
★settings.html 今回は修正不要
★settings.js 今回は修正不要
★index.js
1: /************************************************************************* 2: * 3: * Panoramio Group Photos 4: * 5: ************************************************************************/ 6: var groupId = ""; 7: var defaultId = 6209; 8: var delay = 10; // default time [Sec] 9: 10: // Enable the gadget settings functionality. 11: System.Gadget.settingsUI = "settings.html"; 12: // Delegate for when the Settings dialog is closed. 13: System.Gadget.onSettingsClosed = SettingsClosed; 14: // Delegate for when the Settings dialog is instantiated. 15: System.Gadget.onShowSettings = SettingsShow; 16: 17: // -------------------------------------------------------------------- 18: // Initialize the gadget. 19: window.onload = function(){ 20: groupId = System.Gadget.Settings.readString("groupId"); 21: if (String(groupId) == "") { 22: groupId = defaultId; 23: } 24: insertFrame(groupId); 25: } 26: // -------------------------------------------------------------------- 27: function insertFrame(id){28: var str = '<iframe src="http://junk0128-tools.appspot.com/pgp_slideshow/index.html';
29: str += '?group=' + id;30: str += '&auto=ON&width=300&height=244&deley=' + delay + '" ';
31: str += 'frameborder="0" width="300" height="250" scrolling="no" marginwidth="0" marginheight="0">';
32: pgp_slideshow.innerHTML = str; 33: } 34: // -------------------------------------------------------------------- 35: function SetContentText(){ } 36: // -------------------------------------------------------------------- 37: // Set the text of the gadget based on the user input; 38: // execute this function at startup and after settings changes. 39: // txtGadget = control for displaying user input. 40: function _SetContentText(strFeedback){ } 41: // -------------------------------------------------------------------- 42: // Handle the Settings dialog closed event. 43: // event = System.Gadget.Settings.ClosingEvent argument. 44: function SettingsClosed(event){ 45: // User hit OK on the settings page. 46: if (event.closeAction == event.Action.commit) { 47: groupId = System.Gadget.Settings.readString("groupId"); 48: if (groupId == "") { 49: groupId = defaultId; 50: } 51: insertFrame(groupId); 52: } 53: // User hit Cancel on the settings page. 54: else if (event.closeAction == event.Action.cancel){ 55: insertFrame(groupId); 56: } 57: } 58: // -------------------------------------------------------------------- 59: // Handle the Settings dialog show event. 60: function SettingsShow(){ 61: // SetContentText("Settings opening."); 62: }28行目のリンク先を変更
var str = '<iframe src="http://junk0128-tools.appspot.com/pgp_slideshow/index.html';
7行目は初期設定のグループ番号を変更するときに変更が必要
var defaultId = 6209;
同様なアプリとして、ユーザー指定のスライドショーとPGPCコンテスト入賞作品のスライドショーがあります。これらはすべて、junk0128-toolsにあります。但しガジェット化のファイルは置いていません。必要な方はPanoramioのPMで連絡をお願いします。但しWindows 7 Pro(64bit)以外での動作確認はしていません。
このガジェットは2012/01/28のMy desktopの動画で見ることが出来ます。
0 件のコメント:
コメントを投稿