| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| <Module> |
| <ModulePrefs title="Photo Album Viewer" description="View Photos From An Album" height="400" width="650"> |
| <Require feature="embedded-experiences"></Require> |
| <Require feature="dynamic-height"></Require> |
| <Require feature="open-views"></Require> |
| </ModulePrefs> |
| <Content type="html" view="embedded, default"> |
| <![CDATA[ |
| <style type="text/css"> |
| .photo { |
| float: left; |
| margin-left: 20px; |
| margin-right: 20px; |
| margin-bottom: 70px; |
| maring-top: 20px; |
| padding: 2px 2px 2px 2px; |
| border: 1px solid black; |
| } |
| |
| #wrapper{ |
| border: 1px solid black; |
| } |
| |
| #header{ |
| font-size: 120%; |
| padding: 10px 10px 10px 10px; |
| color: #0F67A1; |
| } |
| |
| .clear{ |
| clear: both; |
| } |
| </style> |
| |
| |
| <script type="text/javascript"> |
| function initAlbum(){ |
| opensocial.data.getDataContext().registerListener('org.opensocial.ee.context', function(key){ |
| createAlbumHTML(opensocial.data.getDataContext().getDataSet(key)); |
| }); |
| } |
| |
| function createAlbumHTML(context){ |
| var photos = context.photoUrls; |
| var result = ""; |
| for(var i = 0; i < photos.length; i++){ |
| result = result + '<div class="photo"><img src="' + photos[i] + '"/></div>'; |
| } |
| document.getElementById('header').innerHTML = context.albumName; |
| document.getElementById("album").innerHTML = result; |
| gadgets.views.setReturnValue("Rendered Album"); |
| } |
| |
| gadgets.util.registerOnLoadHandler(initAlbum); |
| </script> |
| |
| <div id="wrapper"> |
| <div id="header"></div> |
| <div id="album"></div> |
| <div class="clear"/> |
| </div> |
| ]]> |
| </Content> |
| </Module> |