Fork me on GitHub

RAT (Release Audit Tool) results

The following document contains the results of RAT (Release Audit Tool).

  1. *****************************************************
  2. Summary
  3. -------
  4. Generated at: 2013-11-13T11:31:16-05:00
  5. Notes: 0
  6. Binaries: 0
  7. Archives: 0
  8. Standards: 18
  9.  
  10. Apache Licensed: 1
  11. Generated Documents: 0
  12.  
  13. JavaDocs are generated and so license header is optional
  14. Generated files do not required license headers
  15.  
  16. 17 Unknown Licenses
  17.  
  18. *******************************
  19.  
  20. Unapproved licenses:
  21.  
  22. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/actions/actions-by-path/gadget.xml
  23. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/actions/actions-by-type/gadget.xml
  24. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/actions/actions-with-views/gadget.xml
  25. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/embedded-experiences/YouTube/YouTubePlayer.xml
  26. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/makeRequest/gadget.xml
  27. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/makeRequest/makeRequest.js
  28. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/oauth/oauth10a/YouTube/YouTube.xml
  29. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/oauth/oauth2/google/gadget.xml
  30. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/open-views/all-features/gadget.xml
  31. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/open-views/all-features/open-views.html
  32. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/open-views/all-features/open-views.js
  33. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/preferences/gadget.xml
  34. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/selection/selection-listener/gadget.xml
  35. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/welcome/gadget.xml
  36. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/welcome/welcome.css
  37. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/welcome/welcome.html
  38. /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/welcome/welcome.js
  39.  
  40. *******************************
  41.  
  42. Archives:
  43.  
  44. *****************************************************
  45. Files with Apache License headers will be marked AL
  46. Binary files (which do not require AL headers) will be marked B
  47. Compressed archives will be marked A
  48. Notices, licenses etc will be marked N
  49. AL /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/pom.xml
  50. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/actions/actions-by-path/gadget.xml
  51. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/actions/actions-by-type/gadget.xml
  52. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/actions/actions-with-views/gadget.xml
  53. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/embedded-experiences/YouTube/YouTubePlayer.xml
  54. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/makeRequest/gadget.xml
  55. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/makeRequest/makeRequest.js
  56. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/oauth/oauth10a/YouTube/YouTube.xml
  57. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/oauth/oauth2/google/gadget.xml
  58. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/open-views/all-features/gadget.xml
  59. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/open-views/all-features/open-views.html
  60. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/open-views/all-features/open-views.js
  61. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/preferences/gadget.xml
  62. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/selection/selection-listener/gadget.xml
  63. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/welcome/gadget.xml
  64. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/welcome/welcome.css
  65. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/welcome/welcome.html
  66. !????? /Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/welcome/welcome.js
  67. *****************************************************
  68. Printing headers for files without AL header...
  69. =======================================================================
  70. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/actions/actions-by-path/gadget.xml
  71. =======================================================================
  72. <?xml version="1.0" encoding="UTF-8"?>
  73. <Module>
  74. <ModulePrefs title="Actions by Path">
  75. <Require feature="dynamic-height"></Require>
  76. <Require feature="actions">
  77. <Param name="action-contributions">
  78. <![CDATA[
  79. <actions>
  80. <action id="org-opensocial-explorer-red" path="container/menus/actions" label="Red Action" tooltip="Execute the red action" />
  81. <action id="org-opensocial-explorer-yellow" path="container/menus/actions" label="Yellow Action" tooltip="Execute the yellow action" />
  82. <action id="org-opensocial-explorer-green" path="container/menus/actions" label="Green Action" tooltip="Execute the green action" />
  83. </actions>
  84. ]]>
  85. </Param>
  86. </Require>
  87. </ModulePrefs>
  88. <Content type="html">
  89. <![CDATA[
  90. <script type="text/javascript">
  91. function initActions() {
  92. gadgets.actions.updateAction({
  93. id: "org-opensocial-explorer-red",
  94. callback: function(){execute("red")}
  95. });
  96.  
  97. gadgets.actions.updateAction({
  98. id: "org-opensocial-explorer-yellow",
  99. callback: function(){execute("yellow")}
  100. });
  101.  
  102. gadgets.actions.updateAction({
  103. id: "org-opensocial-explorer-green",
  104. callback: function(){execute("green")}
  105. });
  106. // Adjust the height
  107. gadgets.window.adjustHeight();
  108. }
  109. function execute(color) {
  110. document.body.style.backgroundColor=color;
  111. }
  112. // Register the function to run with the gadget is done loading
  113. gadgets.util.registerOnLoadHandler(initActions);
  114. </script>
  115. <h2>Click on an action to change the background color</h2>
  116. ]]>
  117. </Content>
  118. </Module>
  119.  
  120. =======================================================================
  121. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/actions/actions-by-type/gadget.xml
  122. =======================================================================
  123. <?xml version="1.0" encoding="UTF-8"?>
  124. <Module>
  125. <ModulePrefs title="Actions by Type">
  126. <Require feature="dynamic-height"></Require>
  127. <Require feature="actions">
  128. <Param name="action-contributions">
  129. <![CDATA[
  130. <actions>
  131. <action id="org-opensocial-explorer-person" dataType="opensocial.Person" label="Person Action" tooltip="Execute the person action" />
  132. <action id="org-opensocial-explorer-message" dataType="opensocial.Message" label="Message Action" tooltip="Execute the message action" />
  133. <action id="org-opensocial-explorer-file" dataType="opensocial.File" label="File Action" tooltip="Execute the file action" />
  134. </actions>
  135. ]]>
  136. </Param>
  137. </Require>
  138. </ModulePrefs>
  139. <Content type="html">
  140. <![CDATA[
  141. <script type="text/javascript">
  142. function initActions() {
  143. gadgets.actions.updateAction({
  144. id: "org-opensocial-explorer-person",
  145. callback: execute
  146. });
  147.  
  148. gadgets.actions.updateAction({
  149. id: "org-opensocial-explorer-message",
  150. callback: execute
  151. });
  152.  
  153. gadgets.actions.updateAction({
  154. id: "org-opensocial-explorer-file",
  155. callback: execute
  156. });
  157. }
  158. function execute(selection) {
  159. var div = document.getElementById("selection");
  160. div.innerHTML = gadgets.json.stringify(selection);
  161. }
  162. // Register the function to run with the gadget is done loading
  163. gadgets.util.registerOnLoadHandler(initActions);
  164. </script>
  165. <div>Run an action bound to a type to see the information for the selected object(s) of that type:</div>
  166. <div id="selection"></div>
  167. ]]>
  168. </Content>
  169. </Module>
  170.  
  171. =======================================================================
  172. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/actions/actions-with-views/gadget.xml
  173. =======================================================================
  174. <?xml version="1.0" encoding="UTF-8"?>
  175. <Module>
  176. <ModulePrefs title="Actions with Views">
  177. <Require feature="dynamic-height"></Require>
  178. <Require feature="actions">
  179. <Param name="action-contributions">
  180. <![CDATA[
  181. <actions>
  182. <action id="org-opensocial-explorer-red" path="container/menus/actions" label="Red Action" tooltip="Execute the red action" view="red"/>
  183. <action id="org-opensocial-explorer-yellow" path="container/menus/actions" label="Yellow Action" tooltip="Execute the yellow action" view="yellow"/>
  184. <action id="org-opensocial-explorer-green" path="container/menus/actions" label="Green Action" tooltip="Execute the green action" view="green"/>
  185. </actions>
  186. ]]>
  187. </Param>
  188. </Require>
  189. </ModulePrefs>
  190. <Content type="html" view="default,red,yellow,green">
  191. <![CDATA[
  192. <script type="text/javascript">
  193. function initActions() {
  194. gadgets.window.adjustHeight();
  195. }
  196. // Register the function to run with the gadget is done loading
  197. gadgets.util.registerOnLoadHandler(initActions);
  198. </script>
  199. <h2>Click on an action to change the background color</h2>
  200. ]]>
  201. </Content>
  202. <Content type="html" view="red">
  203. <![CDATA[
  204. <script type="text/javascript">
  205. document.body.style.backgroundColor="red";
  206. </script>
  207. ]]>
  208. </Content>
  209. <Content type="html" view="yellow">
  210. <![CDATA[
  211. <script type="text/javascript">
  212. document.body.style.backgroundColor="yellow";
  213. </script>
  214. ]]>
  215. </Content>
  216. <Content type="html" view="green">
  217. <![CDATA[
  218. <script type="text/javascript">
  219. document.body.style.backgroundColor="green";
  220. </script>
  221. ]]>
  222. </Content>
  223.  
  224. =======================================================================
  225. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/embedded-experiences/YouTube/YouTubePlayer.xml
  226. =======================================================================
  227. <?xml version="1.0" encoding="UTF-8"?>
  228. <Module>
  229. <ModulePrefs title="YouTube Player" description="YouTube Player Using Embedded Experiences" height="400" width="700">
  230. <Require feature="embedded-experiences"></Require>
  231. <Require feature="dynamic-height"></Require>
  232. </ModulePrefs>
  233. <Content type="html">
  234. <![CDATA[
  235. <script type="text/javascript">
  236. gadgets.util.registerOnLoadHandler(function() {
  237. //Register this listener so we can get the embedded experience context data
  238. gadgets.ee.registerContextListener(function(context) {
  239. showVideo(context);
  240. });
  241. });
  242. function showVideo(context){
  243. document.getElementById("player").innerHTML = '<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/' + context + '?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/' + context + '?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>';
  244. gadgets.window.adjustHeight();
  245. };
  246. </script>
  247.  
  248. <div id="player">
  249. </div>
  250. ]]>
  251. </Content>
  252. </Module>
  253.  
  254. =======================================================================
  255. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/makeRequest/gadget.xml
  256. =======================================================================
  257. <?xml version="1.0" encoding="UTF-8"?>
  258. <Module>
  259. <ModulePrefs title="Make Request Example">
  260. <Require feature="dynamic-height"></Require>
  261. </ModulePrefs>
  262. <Content type="html">
  263. <![CDATA[
  264. <script type="text/javascript" src="makeRequest.js"></script>
  265. <h4>Select an NHL team and press "GO!" to see more information</h4>
  266. <select id="team">
  267. <option value="BOS">Boston</option>
  268. <option value="PHI">Philadelphia</option>
  269. <option value="TBL">Tampa Bay</option>
  270. <option value="CHI">Chicago</option>
  271. <option value="VAN">Vancouver</option>
  272. <option value="SJS">San Jose</option>
  273. </select>
  274. <button type="button" onclick="lookupTeam()">GO!</button>
  275. <br />
  276. Team ID: <span id="teamID"></span><br />
  277. Team Name: <span id="name"></span><br />
  278. Conference: <span id="conference"></span><br />
  279. Division: <span id="division"></span>
  280. <script type="text/javascript">
  281. gadgets.util.registerOnLoadHandler(function(){
  282. gadgets.window.adjustHeight();
  283. });
  284. </script>
  285. ]]>
  286. </Content>
  287.  
  288. </Module>
  289.  
  290. =======================================================================
  291. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/makeRequest/makeRequest.js
  292. =======================================================================
  293. function lookupTeam() {
  294. var index = document.getElementById('team').selectedIndex;
  295. var options = document.getElementById('team').options;
  296. var teamID = options[index].value;
  297. var params = {};
  298. params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON;
  299. var url = 'http://www.nicetimeonice.com/api/teams/' + teamID;
  300. gadgets.io.makeRequest(url, function(response) {
  301. if (response.errors.length == 0) {
  302. var data = response.data;
  303. document.getElementById('teamID').innerHTML = data.teamID;
  304. document.getElementById('name').innerHTML = data.name;
  305. document.getElementById('conference').innerHTML = data.conference;
  306. document.getElementById('division').innerHTML = data.division;
  307. gadgets.window.adjustHeight();
  308. } else {
  309. gadgets.error('There was an error making the request.');
  310. }
  311. }, params);
  312. }
  313.  
  314. =======================================================================
  315. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/oauth/oauth10a/YouTube/YouTube.xml
  316. =======================================================================
  317. <?xml version="1.0" encoding="UTF-8" ?>
  318. <Module>
  319. <ModulePrefs title="YouTube Gadget" width="700" scrolling="true">
  320. <Require feature="dynamic-height" />
  321. <Require feature="embedded-experiences" />
  322. <Require feature="oauthpopup" />
  323. <Require feature="tabs" />
  324. <OAuth>
  325. <Service name="YouTube">
  326. <Request url="https://www.google.com/accounts/OAuthGetRequestToken?scope=http://gdata.youtube.com" />
  327. <Access url="https://www.google.com/accounts/OAuthGetAccessToken" />
  328. <Authorization url="https://www.google.com/accounts/OAuthAuthorizeToken?oauth_callback=http://sandbox.opensocial2.org:8080gadgets/oauthcallback" />
  329. </Service>
  330. </OAuth>
  331. </ModulePrefs>
  332. <Content type="html" view="embedded,default">
  333. <![CDATA[
  334. <style type="text/css">
  335. .youTubeWrapper{
  336. font: 75%/1.5 Arial,Helvetica,sans-serif;
  337. }
  338. #comments{
  339. margin-left: -45px;
  340. }
  341. .comment{
  342. background-color: #F4F5F6;
  343. border-bottom: 1px solid #FFFFFF;
  344. list-style-type: none;
  345. overflow: hidden;
  346. padding: 7px;
  347. }
  348. .comment .commentAvatar{
  349. float: left;
  350. margin-right: 5px;
  351. }
  352. .comment .commentAvatar img{
  353. width: 24px;
  354. }
  355. .comment .commentMeta a{
  356. font-weight: bold;
  357. color: #000000;
  358. }
  359. .comment .commentMeta {
  360. color: #666666;
  361.  
  362. =======================================================================
  363. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/oauth/oauth2/google/gadget.xml
  364. =======================================================================
  365. <?xml version="1.0" encoding="UTF-8" ?>
  366. <Module>
  367. <ModulePrefs title="Demo OAuth2 Authorization Code Gadget (Simple pull from Google Contacts)">
  368. <OAuth2>
  369. <Service name="googleAPI" scope="https://www.google.com/m8/feeds/">
  370. </Service>
  371. </OAuth2>
  372. <Require feature="oauthpopup" />
  373. <!-- <Preload authz="oauth2" oauth_service_name="googleAPI" href="https://www.google.com/m8/feeds/contacts/default/full"
  374. /> -->
  375. </ModulePrefs>
  376. <Content type="html">
  377. <![CDATA[
  378.  
  379. <style>
  380. #main {
  381. margin: 0px;
  382. padding: 0px;
  383. font-size: small;
  384. }
  385. </style>
  386.  
  387. <div id="main" style="display: none">
  388. </div>
  389.  
  390. <div id="approval" style="display: none">
  391. <a href="#" id="personalize">Personalize this gadget</a>
  392. <ol>
  393. <b><u>In order to use this Demo Gadget you must</u></b>
  394. <li>Have or create a Google account and know your userid and password</li>
  395. <li>Register a new application at <a href="https://code.google.com/apis/console">https://code.google.com/apis/console</a></li>
  396. <li>Make sure your app's "Redirect URIs" applies to your shindig environment (e.g. http://localhost:8080/gadgets/oauth2callback)</li>
  397. <li>Update the Google client "Client ID" and "Client Secret" in the OAuth2 persistence (default is <code>config/oauth2.json</code>)</li>
  398. <li>Restart the server</li>
  399. <li>Click the link above to initiate the authorization process</li>
  400. </ol>
  401. </div>
  402.  
  403. <div id="waiting" style="display: none">
  404. Please click
  405. <a href="#" id="approvaldone">I've approved access</a>
  406. once you've approved access to your data.
  407. </div>
  408.  
  409. <div id="error" style="display: none;background-color:yellow;font-size:xx-small;" title="An error occured processing your request">
  410. <div id="error_code"><u>code:</u></div>
  411. <div id="error_uri"><u>uri:</u></div>
  412. <div id="error_description"><u>description:</u></div>
  413. <div id="error_explanation"><u>explanation:</u></div>
  414.  
  415. =======================================================================
  416. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/open-views/all-features/gadget.xml
  417. =======================================================================
  418. <?xml version="1.0" encoding="UTF-8"?>
  419. <Module>
  420. <ModulePrefs title="Open Views Demo">
  421. <Require feature="dynamic-height"></Require>
  422. <Optional feature="open-views"></Optional>
  423. <Optional feature="embedded-experiences"></Optional>
  424. </ModulePrefs>
  425. <Content type="html" href="open-views.html" />
  426. <Content type="html" view="tab">
  427. <![CDATA[
  428. <script type="text/javascript">
  429. gadgets.util.registerOnLoadHandler(function() {
  430. gadgets.views.setReturnValue('Thanks for closing the tab view!');
  431. });
  432. </script>
  433. <h1>Tab View</h1>
  434. <button onclick="gadgets.views.close();">Close</button>
  435. ]]>
  436. </Content>
  437. <Content type="html" view="sidebar">
  438. <![CDATA[
  439. <script type="text/javascript">
  440. gadgets.util.registerOnLoadHandler(function() {
  441. gadgets.views.setReturnValue('Thanks for closing the sidebar view!');
  442. });
  443. </script>
  444. <h1>Sidebar View</h1>
  445. <button onclick="gadgets.views.close();">Close</button>
  446. ]]>
  447. </Content>
  448. <Content type="html" view="dialog">
  449. <![CDATA[
  450. <script type="text/javascript">
  451. gadgets.util.registerOnLoadHandler(function() {
  452. gadgets.views.setReturnValue('Thanks for closing the dialog view!');
  453. });
  454. </script>
  455. <h1>Dialog View</h1>
  456. <button onclick="gadgets.views.close();">Close</button>
  457. ]]>
  458. </Content>
  459. <Content type="html" view="embedded">
  460. <![CDATA[
  461. <script type="text/javascript">
  462. gadgets.util.registerOnLoadHandler(function() {
  463. gadgets.views.setReturnValue('Thanks for closing the embedded experience!');
  464. gadgets.ee.registerContextListener(function(context) {
  465. document.getElementById('contextData').innerHTML =
  466. gadgets.json.stringify(context);
  467. });
  468.  
  469. =======================================================================
  470. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/open-views/all-features/open-views.html
  471. =======================================================================
  472. <html>
  473. <head>
  474. <script type="text/javascript" src="open-views.js"></script>
  475. </head>
  476. <body>
  477. <h3>What would you like to open?</h3>
  478. <select id="type">
  479. <option value="gadget">Gadget</option>
  480. <option value="url">URL</option>
  481. <option value="ee">Embedded Experience</option>
  482. </select>
  483. <h3>Where would you like to open it?</h3>
  484. <select id="viewTarget">
  485. <option></option>
  486. <option value="TAB">Tab</option>
  487. <option value="DIALOG">Dialog</option>
  488. <option value="MODALDIALOG">Modal Dialog</option>
  489. <option value="FLOAT">Float</option>
  490. <option value="SIDEBAR">Sidebar</option>
  491. </select>
  492. <div id="viewSection">
  493. <h3>What view would you like to open?</h3>
  494. <select id="view">
  495. <option value="tab">Tab View</option>
  496. <option value="sidebar">Sidebar View</option>
  497. <option value="dialog">Dialog View</option>
  498. </select>
  499. </div>
  500. <div id="urlSection" style="display: none;">
  501. <h3>URL To Open</h3>
  502. <input type="text" id="url" value="http://opensocial.org"></input>
  503. </div>
  504. <div id="eeSection" style="display: none;">
  505. <h3>Embedded Experience Data Model</h3>
  506. <textarea id="dataModel" rows="10" cols="70"></textarea>
  507. </div>
  508. <br/>
  509. <div>
  510. <button id="open">Open</button>
  511. </div>
  512. </body>
  513. </html>
  514.  
  515. =======================================================================
  516. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/open-views/all-features/open-views.js
  517. =======================================================================
  518. var currentSite;
  519. function initButtons() {
  520. document.getElementById('open').onclick = open;
  521. document.getElementById('type').onchange = typeChange;
  522. setEEDataModel();
  523. gadgets.window.adjustHeight();
  524. }
  525.  
  526. function typeChange(e) {
  527. hideFields();
  528. var type = e.currentTarget.value;
  529. if(type === 'gadget') {
  530. document.getElementById('viewSection').setAttribute('style', 'display: block;');
  531.  
  532. } else if(type === 'url') {
  533. document.getElementById('urlSection').setAttribute('style', 'display: block;');
  534. } else {
  535. document.getElementById('eeSection').setAttribute('style', 'display: block;');
  536. }
  537. gadgets.window.adjustHeight();
  538. }
  539.  
  540. function setEEDataModel() {
  541. //WARNING!!! The below line of code is specific to this container
  542. //not every container will do this do don't rely on it
  543. var gadgetUrl = gadgets.views.getParams().gadgetUrl;
  544. var dataModel = {
  545. "gadget" : gadgetUrl,
  546. "context" : {
  547. "message" : "The open-views feature rocks!"
  548. }
  549. };
  550. document.getElementById('dataModel').value = gadgets.json.stringify(dataModel);
  551.  
  552. }
  553.  
  554. function hideFields() {
  555. document.getElementById('viewSection').setAttribute('style', 'display: none;');
  556. document.getElementById('urlSection').setAttribute('style', 'display: none;');
  557. document.getElementById('eeSection').setAttribute('style', 'display: none;');
  558. }
  559.  
  560. function open() {
  561. var type = document.getElementById('type').value;
  562. if(type === 'url') {
  563. gadgets.views.openUrl(getUrl(), function(site) {
  564. currentSite = site;
  565. }, getViewTarget());
  566.  
  567. } else if(type === 'gadget') {
  568.  
  569. =======================================================================
  570. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/preferences/gadget.xml
  571. =======================================================================
  572. <?xml version="1.0" encoding="UTF-8"?>
  573. <Module>
  574. <ModulePrefs title="Preferences Gadget" description="Tests setting and getting user preferences." width="320" height="400">
  575. <Require feature="setprefs"/>
  576. <Require feature="settitle"/>
  577. <Require feature="dynamic-height"/>
  578. </ModulePrefs>
  579. <UserPref name="hello_pref" display_name="Name" default_value="World" datatype="string" required="true"/>
  580. <UserPref name="number_pref" display_name="Number" default_value="0" datatype="string" required="true"/>
  581. <UserPref name="list_pref" display_name="List" default_value="foo|bar|foobar" datatype="list" required="true"/>
  582. <UserPref name="boolean_pref" display_name="Boolean" default_value="false" datatype="bool" required="true"/>
  583. <UserPref name="enum_pref" display_name="Enum" default_value="Red" datatype="enum" required="true">
  584. <EnumValue value="Red" display_value="Red"/>
  585. <EnumValue value="Green" display_value="Green"/>
  586. <EnumValue value="Blue" display_value="Blue"/>
  587. <EnumValue value="Gray" display_value="Gray"/>
  588. <EnumValue value="Purple" display_value="Purple"/>
  589. <EnumValue value="Black" display_value="Black"/>
  590. </UserPref>
  591. <UserPref name="set_pref" display_name="Set this preference" datatype="string" required="false"/>
  592. <Content type="html">
  593. <![CDATA[
  594. <div id="enum_div"></div>
  595. <div id="boolean_div"</div>
  596. <div id="number_div"</div>
  597. <div id="list_div"></div>
  598. <div id="set_div">
  599. Set the pref value: <input id="setPrefInput" type="text" /><br />
  600. <button id="setPrefBtn" type="button" onclick="setPref()">Set the pref</button>
  601. </div>
  602. <script type="text/javascript">
  603. function setPref(){
  604. var prefs = new gadgets.Prefs();
  605. prefs.set("set_pref", document.getElementById("setPrefInput").value);
  606. }
  607. function displayMsg(){
  608. var enumDiv = document.getElementById('enum_div');
  609. var boolDiv = document.getElementById('boolean_div');
  610. var listDiv = document.getElementById('list_div');
  611. var numberDiv = document.getElementById('number_div');
  612. var setPrefDiv = document.getElementById('set_div');
  613. // Get userprefs
  614. var prefs = new gadgets.Prefs();
  615. // enumDiv
  616. enumDiv.style.color = prefs.getString("enum_pref");
  617. var enumDivHtml = "<br><h1>";
  618. enumDivHtml += "Hello, ";
  619. enumDivHtml += prefs.getString("hello_pref");
  620.  
  621. =======================================================================
  622. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/selection/selection-listener/gadget.xml
  623. =======================================================================
  624. <?xml version="1.0" encoding="UTF-8"?>
  625. <Module>
  626. <ModulePrefs title="Selection Listener">
  627. <Require feature="dynamic-height"></Require>
  628. <Require feature="selection"></Require>
  629. </ModulePrefs>
  630. <Content type="html">
  631. <![CDATA[
  632. <script type="text/javascript">
  633. function execute(selection) {
  634. var div = document.getElementById("selection");
  635. div.innerHTML = gadgets.json.stringify(selection);
  636. // Adjust the height
  637. gadgets.window.adjustHeight();
  638. }
  639. // Register the function to run with the gadget is done loading
  640. gadgets.util.registerOnLoadHandler(function() {
  641. gadgets.selection.addListener(execute);
  642. });
  643. </script>
  644. <div>Select a OpenSocial datatype in the menu to see its value:</div>
  645. <div id="selection"></div>
  646. ]]>
  647. </Content>
  648. </Module>
  649.  
  650. =======================================================================
  651. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/welcome/gadget.xml
  652. =======================================================================
  653. <?xml version="1.0" encoding="UTF-8"?>
  654. <Module>
  655. <ModulePrefs title="Welcome Gadget" description="Welcome people to the OpenSocial Explorer">
  656. <Require feature="minimessage" />
  657. </ModulePrefs>
  658. <Content type="html" href="welcome.html">
  659. </Content>
  660. </Module>
  661.  
  662. =======================================================================
  663. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/welcome/welcome.css
  664. =======================================================================
  665. .mmlib_table {
  666. width: 100%;
  667. font: bold 9px arial,sans-serif;
  668. font-size: medium;
  669. background-color: #fff4c2;
  670. border-collapse: separate;
  671. border-spacing: 3px;
  672. padding: 1px 0px;
  673. }
  674.  
  675. =======================================================================
  676. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/welcome/welcome.html
  677. =======================================================================
  678. <html>
  679. <head>
  680. <link type="text/css" rel="stylesheet" href="welcome.css"/>
  681. <script type="text/javascript" src="welcome.js"></script>
  682. </head>
  683. </html>
  684.  
  685. =======================================================================
  686. ==/Users/ryanjbaxter/git-repos/opensocial/explorer/gadget-specs/src/main/specs/welcome/welcome.js
  687. =======================================================================
  688. function welcome() {
  689. var miniMessage = new gadgets.MiniMessage();
  690. miniMessage.createStaticMessage("Welcome to the OpenSocial Explorer!");
  691. miniMessage.createStaticMessage("Click on the tabs at the top to see all resources that a gadget is using, including HTML, CSS, and JavaScript.");
  692. miniMessage.createStaticMessage("Click on the samples in the navigator on the left to view other sample gadgets.");
  693. }
  694.  
  695. gadgets.util.registerOnLoadHandler(welcome);