2150 |
mathias |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
|
|
2 |
"http://www.w3.org/TR/html4/strict.dtd">
|
|
|
3 |
<html>
|
|
|
4 |
<head>
|
|
|
5 |
<title>Dojo Lightbox Tests</title>
|
|
|
6 |
|
|
|
7 |
<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true"></script>
|
|
|
8 |
<script type="text/javascript" src="../../../dijit/tests/_testCommon.js"></script>
|
|
|
9 |
<script type="text/javascript" src="../Lightbox.js"></script>
|
|
|
10 |
<script type="text/javascript">
|
|
|
11 |
// dojo.require("dojox.image.Lightbox"); // un-comment when not debugging
|
|
|
12 |
dojo.require("dojo.parser"); // scan page for widgets and instantiate them
|
|
|
13 |
dojo.require("dojox.data.FlickrStore");
|
|
|
14 |
</script>
|
|
|
15 |
|
|
|
16 |
<style type="text/css">
|
|
|
17 |
@import "../../../dojo/resources/dojo.css";
|
|
|
18 |
|
|
|
19 |
@import "../../../dijit/themes/dijit.css";
|
|
|
20 |
@import "../../../dijit/tests/css/dijitTests.css";
|
|
|
21 |
|
|
|
22 |
/* you need this file */
|
|
|
23 |
@import "../resources/image.css";
|
|
|
24 |
|
|
|
25 |
body, html { width:100%; height:100%; margin:0; padding:0; }
|
|
|
26 |
|
|
|
27 |
</style>
|
|
|
28 |
|
|
|
29 |
<script type="text/javascript">
|
|
|
30 |
// programatic flickrstore implementation [basic]
|
|
|
31 |
function onComplete(items,request){
|
|
|
32 |
if (items.length>0){
|
|
|
33 |
dojo.forEach(items,function(item){
|
|
|
34 |
var part = {
|
|
|
35 |
title: flickrStore.getValue(item,"title"),
|
|
|
36 |
href: flickrStore.getValue(item,"imageUrl")
|
|
|
37 |
};
|
|
|
38 |
// FIXME: make addImage more accessible, or do this internally
|
|
|
39 |
dijit.byId('fromStore')._attachedDialog.addImage(part,"flickrStore");
|
|
|
40 |
});
|
|
|
41 |
dojo.byId('flickrButton').disabled = false;
|
|
|
42 |
}
|
|
|
43 |
}
|
|
|
44 |
|
|
|
45 |
function onError(error,request){
|
|
|
46 |
console.warn(error,request);
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
function init(){
|
|
|
50 |
var flickrRequest = {
|
|
|
51 |
query: {},
|
|
|
52 |
onComplete: onComplete,
|
|
|
53 |
onError: onError,
|
|
|
54 |
userid: "jetstreet",
|
|
|
55 |
tags: "jetstreet",
|
|
|
56 |
count: 10
|
|
|
57 |
};
|
|
|
58 |
flickrStore.fetch(flickrRequest);
|
|
|
59 |
}
|
|
|
60 |
dojo.addOnLoad(init);
|
|
|
61 |
</script>
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
</head>
|
|
|
65 |
<body class="tundra">
|
|
|
66 |
|
|
|
67 |
<div style="padding:20px;">
|
|
|
68 |
<h1 class="testTitle">Dojo-base Lightbox implementation</h1>
|
|
|
69 |
|
|
|
70 |
<h3>Individual</h3>
|
|
|
71 |
<p>
|
|
|
72 |
<a href="images/imageVert.jpg" dojoType="dojox.image.Lightbox" title="More Guatemala...">tall</a>
|
|
|
73 |
<a href="images/imageHoriz.jpg" dojoType="dojox.image.Lightbox" title="Antigua, Guatemala">4:3 image</a>
|
|
|
74 |
</p>
|
|
|
75 |
|
|
|
76 |
<h3>Grouped:</h3>
|
|
|
77 |
<p>
|
|
|
78 |
<a href="images/imageHoriz2.jpg" dojoType="dojox.image.Lightbox" group="group1" title="Amterdamn Train Depot">wide image</a>
|
|
|
79 |
<a href="images/square.jpg" dojoType="dojox.image.Lightbox" group="group1" title="1:1 aspect">square</a>
|
|
|
80 |
<a href="images/extraWide.jpg" dojoType="dojox.image.Lightbox" group="group1" title="Greeneville, TN">wide image</a>
|
|
|
81 |
</p>
|
|
|
82 |
|
|
|
83 |
<h3>Alternate Group:</h3>
|
|
|
84 |
<p>
|
|
|
85 |
<a href="images/imageHoriz2.jpg" dojoType="dojox.image.Lightbox" group="group2" title="Amterdamn Train Depot">wide image</a>
|
|
|
86 |
<a href="images/square.jpg" dojoType="dojox.image.Lightbox" group="group2" title="1:1 aspect">square</a>
|
|
|
87 |
<a href="images/imageHoriz.jpg" dojoType="dojox.image.Lightbox" group="group2" title="Antigua, Guatemala">4:3 image</a>
|
|
|
88 |
<a href="images/imageVert.jpg" dojoType="dojox.image.Lightbox" group="group2" title="More Guatemala...">tall</a>
|
|
|
89 |
</p>
|
|
|
90 |
|
|
|
91 |
<h3>From dojox.data.FlickrStore (?)</h3>
|
|
|
92 |
|
|
|
93 |
<div dojoType="dojox.data.FlickrStore" jsId="flickrStore" label="title"></div>
|
|
|
94 |
<div id="fromStore" dojoType="dojox.image.Lightbox" store="flickrStore" group="flickrStore"></div>
|
|
|
95 |
|
|
|
96 |
<input id="flickrButton" type="button" onclick="dijit.byId('fromStore').show()" value="show flickr lightbox" disabled="disabled">
|
|
|
97 |
|
|
|
98 |
</div>
|
|
|
99 |
|
|
|
100 |
</body>
|
|
|
101 |
</html>
|