/trunk/api/js/dojo1.0/dojox/image/tests/test_Gallery.html |
---|
New file |
0,0 → 1,67 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
<html> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
<title>Testing the Image Gallery</title> |
<style type="text/css"> |
@import "../../../dijit/tests/css/dijitTests.css"; |
@import "../resources/image.css"; |
</style> |
<script type="text/javascript" src="../../../dojo/dojo.js" djconfig="parseOnLoad:true, isDebug: true, defaultTestTheme:'soria'"></script> |
<script type="text/javascript" src="../../../dijit/tests/_testCommon.js"></script> |
<script type="text/javascript" src="../ThumbnailPicker.js"></script> |
<script type="text/javascript" src="../SlideShow.js"></script> |
<script type="text/javascript" src="../Gallery.js"></script> |
<script type="text/javascript" src="../../../dojo/data/util/simpleFetch.js"></script> |
<script type="text/javascript" src="../../data/FlickrStore.js"></script> |
<script type="text/javascript" src="../../data/FlickrRestStore.js"></script> |
<script type="text/javascript" src="../../../dojo/data/ItemFileReadStore.js"></script> |
<script type="text/javascript"> |
// dojo.require("dojox.image.Gallery"); |
dojo.require("dojox.data.FlickrRestStore"); |
dojo.require("dojo.parser"); // find widgets |
dojo.addOnLoad(function(){ |
var flickrRestStore = new dojox.data.FlickrRestStore(); |
var req = { |
query: { |
userid: "44153025@N00", |
apikey: "8c6803164dbc395fb7131c9d54843627", |
sort: [ |
{ |
attribute: "interestingness", |
descending: true |
} |
], |
// tags: ["superhorse", "redbones", "beachvolleyball"], |
tag_mode: "any" |
}, |
count: 20 |
}; |
dijit.byId('gallery1').setDataStore(flickrRestStore, req); |
/* |
dijit.byId('gallery2').setDataStore(imageItemStore,{ count:20 },{ |
imageThumbAttr: "thumb", |
imageLargeAttr: "large" |
}); |
*/ |
}); |
</script> |
</head> |
<body> |
<h1 class="testTitle">dojox.image.Gallery</h1> |
<h2>From FlickrRestStore:</h2> |
<div id="gallery1" dojoType="dojox.image.Gallery" numberThumbs="4"></div> |
<!-- |
<h2>From ItemFileReadStore:</h2> |
<div id="gallery2" dojoType="dojox.image.Gallery"></div> |
--> |
</body> |
</html> |
/trunk/api/js/dojo1.0/dojox/image/tests/test_Lightbox.html |
---|
New file |
0,0 → 1,101 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
"http://www.w3.org/TR/html4/strict.dtd"> |
<html> |
<head> |
<title>Dojo Lightbox Tests</title> |
<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true"></script> |
<script type="text/javascript" src="../../../dijit/tests/_testCommon.js"></script> |
<script type="text/javascript" src="../Lightbox.js"></script> |
<script type="text/javascript"> |
// dojo.require("dojox.image.Lightbox"); // un-comment when not debugging |
dojo.require("dojo.parser"); // scan page for widgets and instantiate them |
dojo.require("dojox.data.FlickrStore"); |
</script> |
<style type="text/css"> |
@import "../../../dojo/resources/dojo.css"; |
@import "../../../dijit/themes/dijit.css"; |
@import "../../../dijit/tests/css/dijitTests.css"; |
/* you need this file */ |
@import "../resources/image.css"; |
body, html { width:100%; height:100%; margin:0; padding:0; } |
</style> |
<script type="text/javascript"> |
// programatic flickrstore implementation [basic] |
function onComplete(items,request){ |
if (items.length>0){ |
dojo.forEach(items,function(item){ |
var part = { |
title: flickrStore.getValue(item,"title"), |
href: flickrStore.getValue(item,"imageUrl") |
}; |
// FIXME: make addImage more accessible, or do this internally |
dijit.byId('fromStore')._attachedDialog.addImage(part,"flickrStore"); |
}); |
dojo.byId('flickrButton').disabled = false; |
} |
} |
function onError(error,request){ |
console.warn(error,request); |
} |
function init(){ |
var flickrRequest = { |
query: {}, |
onComplete: onComplete, |
onError: onError, |
userid: "jetstreet", |
tags: "jetstreet", |
count: 10 |
}; |
flickrStore.fetch(flickrRequest); |
} |
dojo.addOnLoad(init); |
</script> |
</head> |
<body class="tundra"> |
<div style="padding:20px;"> |
<h1 class="testTitle">Dojo-base Lightbox implementation</h1> |
<h3>Individual</h3> |
<p> |
<a href="images/imageVert.jpg" dojoType="dojox.image.Lightbox" title="More Guatemala...">tall</a> |
<a href="images/imageHoriz.jpg" dojoType="dojox.image.Lightbox" title="Antigua, Guatemala">4:3 image</a> |
</p> |
<h3>Grouped:</h3> |
<p> |
<a href="images/imageHoriz2.jpg" dojoType="dojox.image.Lightbox" group="group1" title="Amterdamn Train Depot">wide image</a> |
<a href="images/square.jpg" dojoType="dojox.image.Lightbox" group="group1" title="1:1 aspect">square</a> |
<a href="images/extraWide.jpg" dojoType="dojox.image.Lightbox" group="group1" title="Greeneville, TN">wide image</a> |
</p> |
<h3>Alternate Group:</h3> |
<p> |
<a href="images/imageHoriz2.jpg" dojoType="dojox.image.Lightbox" group="group2" title="Amterdamn Train Depot">wide image</a> |
<a href="images/square.jpg" dojoType="dojox.image.Lightbox" group="group2" title="1:1 aspect">square</a> |
<a href="images/imageHoriz.jpg" dojoType="dojox.image.Lightbox" group="group2" title="Antigua, Guatemala">4:3 image</a> |
<a href="images/imageVert.jpg" dojoType="dojox.image.Lightbox" group="group2" title="More Guatemala...">tall</a> |
</p> |
<h3>From dojox.data.FlickrStore (?)</h3> |
<div dojoType="dojox.data.FlickrStore" jsId="flickrStore" label="title"></div> |
<div id="fromStore" dojoType="dojox.image.Lightbox" store="flickrStore" group="flickrStore"></div> |
<input id="flickrButton" type="button" onclick="dijit.byId('fromStore').show()" value="show flickr lightbox" disabled="disabled"> |
</div> |
</body> |
</html> |
/trunk/api/js/dojo1.0/dojox/image/tests/test_SlideShow.html |
---|
New file |
0,0 → 1,68 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
<html> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
<title>Testing dojox.image.SlideShow</title> |
<style type="text/css"> |
@import "../../../dijit/tests/css/dijitTests.css"; |
@import "../resources/image.css"; |
</style> |
<script type="text/javascript" src="../../../dojo/dojo.js" djconfig="parseOnLoad:false, isDebug: true, defaultTestTheme: 'soria'"></script> |
<script type="text/javascript" src="../../../dijit/tests/_testCommon.js"></script> |
<script type="text/javascript" src="../SlideShow.js"></script> |
<script type="text/javascript" src="../../../dojo/data/ItemFileReadStore.js"></script> |
<script type="text/javascript" src="../../data/FlickrRestStore.js"></script> |
<script type="text/javascript"> |
// dojo.require("dojox.image.SlideShow"); |
// dojo.require("dojox.data.FlickrRestStore"); |
// dojo.require("dojo.data.ItemFileReadStore"); |
dojo.require("dojo.parser"); // find widgets |
dojo.addOnLoad(function(){ |
//Initialize the first SlideShow with an ItemFileReadStore |
dojo.parser.parse(dojo.body()); |
dijit.byId('slideshow1').setDataStore(imageItemStore, |
{ query: {}, count:20 }, |
{ |
imageThumbAttr: "thumb", |
imageLargeAttr: "large" |
} |
); |
//INitialize the second store with a FlickrRestStore |
var flickrRestStore = new dojox.data.FlickrRestStore(); |
var req = { |
query: { |
userid: "44153025@N00", |
apikey: "8c6803164dbc395fb7131c9d54843627" |
}, |
count: 20 |
}; |
dijit.byId('slideshow2').setDataStore(flickrRestStore, req); |
}); |
</script> |
</head> |
<body> |
<h1 class="testTitle">dojox.image.SlideShow</h1> |
<h2>from dojo.data.ItemFileReadStore</h2> |
<div jsId="imageItemStore" dojoType="dojo.data.ItemFileReadStore" url="images.json"></div> |
This SlideShow should display five photos, and loop. It should also |
open a URL when the image is clicked. The widget should also resize to |
fit the image. |
<div id="slideshow1" dojoType="dojox.image.SlideShow"></div> |
<h2>from dojox.data.FlickrRestStore</h2> |
This SlideShow should display five photos, and not loop. It should also not |
open a URL when the image is clicked. AutoLoading of images is also disabled. |
The time between images in a SlideShow is 1 second. The widget should not resize to fit the image |
<div id="slideshow2" dojoType="dojox.image.SlideShow" noLink="true" loop="false" autoLoad="false" |
slideshowInterval="1" fixedHeight="true"></div> |
</body> |
</html> |
/trunk/api/js/dojo1.0/dojox/image/tests/test_ThumbnailPicker.html |
---|
New file |
0,0 → 1,134 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
<html> |
<head> |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
<title>Testing the ThumbnailPicker</title> |
<style type="text/css"> |
@import "../../../dijit/tests/css/dijitTests.css"; |
@import "../resources/image.css"; |
</style> |
<script type="text/javascript" src="../../../dojo/dojo.js" djconfig="parseOnLoad:true, isDebug: true, defaultTestTheme:'soria'"></script> |
<script type="text/javascript" src="../../../dijit/tests/_testCommon.js"></script> |
<script type="text/javascript" src="../ThumbnailPicker.js"></script> |
<script type="text/javascript"> |
// dojo.require("dojox.image.Gallery"); |
dojo.require("dojox.data.FlickrRestStore"); |
dojo.require("dojo.data.ItemFileReadStore"); |
dojo.require("dojo.parser"); // find widgets |
/* |
Initializes the ThumbnailPicker with a data store that |
reads from the Flickr REST APIs. |
*/ |
function initFlickrGallery() { |
var flickrRestStore = new dojox.data.FlickrRestStore(); |
var req = { |
query: { |
userid: "44153025@N00",//The Flickr user id to use |
apikey: "8c6803164dbc395fb7131c9d54843627",//An API key is required. |
sort: [ |
{ |
descending: true //Use descending sort order, ascending is default. |
} |
], |
tags: ["superhorse", "redbones", "beachvolleyball","dublin","croatia"], |
tag_mode: "any" //Match any of the tags |
}, |
count: 20 |
}; |
//Set the flickr data store on two of the dojox.image.ThumbnailPicker widgets |
dijit.byId('thumbPicker1').setDataStore(flickrRestStore, req); |
dijit.byId('thumbPicker3').setDataStore(flickrRestStore, req); |
} |
/* |
Initializes the second ThumbnailPicker widget with a data store that |
reads information from a JSON URL. This also tells the ThumbnailPicker |
the name of the JSON attributes to read from each data item retrieved |
from the JSON URL. |
*/ |
function initItemStoreGallery(){ |
var itemRequest = { |
query: {}, |
count: 20 |
}; |
var itemNameMap = { |
imageThumbAttr: "thumb", |
imageLargeAttr: "large" |
}; |
//Set the dojo.data.ItemFileReadStore on two of the dojox.image.ThumbnailPicker widgets |
//Note the use of the 'itemNameMap', which tells the widget what attributes to |
//read from the store. Look in the 'images.json' file in the same folder as this |
//file to see the data being read by the widget. |
dijit.byId('thumbPicker2').setDataStore(imageItemStore, itemRequest, itemNameMap); |
dijit.byId('thumbPicker4').setDataStore(imageItemStore, itemRequest, itemNameMap); |
} |
//Subscribe to clicks on the thumbnails, and print out the information provided |
function doSubscribe(){ |
function updateDiv(packet){ |
dojo.byId('PublishedData').innerHTML = "You selected the thumbnail:" |
+ "<br/><b>Index:</b> " + packet.index |
+ "<br/><b>Url:</b> " + packet.url |
+ "<br/><b>Large Url:</b> " + packet.largeUrl |
+ "<br/><b>Title:</b> " + packet.title |
+ "<br/><b>Link:</b> " + packet.link |
; |
}; |
//When an image in the ThumbnailPicker is clicked on, it publishes |
//information on the image to a topic, whose name is found by calling |
//the 'getTopicName' function on the widget. |
dojo.subscribe(dijit.byId('thumbPicker1').getClickTopicName(), updateDiv); |
dojo.subscribe(dijit.byId('thumbPicker2').getClickTopicName(), updateDiv); |
} |
dojo.addOnLoad(initFlickrGallery); |
dojo.addOnLoad(initItemStoreGallery); |
dojo.addOnLoad(doSubscribe); |
</script> |
</head> |
<body> |
<h1 class="testTitle">dojox.image.ThumbnailPicker</h1> |
<div id="PublishedData" style="background-color:light-grey"> |
When you click on a thumbnail image, it's information is placed here |
</div> |
<h2>From FlickrRestStore:</h2> |
This ThumbnailPicker should have 8 thumbnails, with each of them linking |
to a URL when clicked on. The cursor should also change when over an image. |
<div id="thumbPicker1" dojoType="dojox.image.ThumbnailPicker" size="500" |
useHyperlink="true" ></div> |
<h2>From ItemFileReadStore:</h2> |
This ThumbnailPicker should have 5 thumbnails. Clicking on a thumbnail should NOT |
open a URL, and the cursor should not change when over an image that is not an arrow. |
<div id="thumbPicker2" dojoType="dojox.image.ThumbnailPicker" size="400" |
isClickable="false"></div> |
<div jsId="imageItemStore" dojoType="dojo.data.ItemFileReadStore" url="images.json"></div> |
<h2>From FlickrRestStore:</h2> |
This ThumbnailPicker should have 6 thumbnails, with each of them linking |
to a URL when clicked on. The cursor should also change when over an image. |
Unlike the ThumbnailPicker above, when these links are clicked on, this page |
changes, instead of a popup window. |
<div id="thumbPicker3" dojoType="dojox.image.ThumbnailPicker" size="600" |
useHyperLink="true" hyperlinkTarget="this"></div> |
<h2>From ItemFileReadStore, and vertical:</h2> |
This ThumbnailPicker should have 5 thumbnails. Clicking on a thumbnail should NOT |
open a URL, and the cursor should not change when over an image that is not an arrow. |
The thumbnails should also be aligned vertically. |
<div id="thumbPicker4" dojoType="dojox.image.ThumbnailPicker" size="300" |
isClickable="false" isHorizontal="false"></div> |
</body> |
</html> |
/trunk/api/js/dojo1.0/dojox/image/tests/images/extraWide.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/api/js/dojo1.0/dojox/image/tests/images/extraWide.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/api/js/dojo1.0/dojox/image/tests/images/imageHoriz.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/api/js/dojo1.0/dojox/image/tests/images/imageHoriz.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/api/js/dojo1.0/dojox/image/tests/images/imageHoriz2.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/api/js/dojo1.0/dojox/image/tests/images/imageHoriz2.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/api/js/dojo1.0/dojox/image/tests/images/square.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/api/js/dojo1.0/dojox/image/tests/images/square.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/api/js/dojo1.0/dojox/image/tests/images/imageVert.jpg |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/trunk/api/js/dojo1.0/dojox/image/tests/images/imageVert.jpg |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/trunk/api/js/dojo1.0/dojox/image/tests/images.json |
---|
New file |
0,0 → 1,32 |
{ items: [ |
{ |
"thumb":"images/extraWide.jpg", |
"large":"images/extraWide.jpg", |
"title":"I'm wide, me", |
"link":"http://www.flickr.com/photos/44153025@N00/748348847" |
}, |
{ |
"thumb":"images/imageHoriz.jpg", |
"large":"images/imageHoriz.jpg", |
"title":"I'm a horizontal picture", |
"link":"http://www.flickr.com/photos/44153025@N00/735656038" |
}, |
{ |
"thumb":"images/imageHoriz2.jpg", |
"large":"images/imageHoriz2.jpg", |
"title":"I'm another horizontal picture", |
"link":"http://www.flickr.com/photos/44153025@N00/714540483" |
}, |
{ |
"thumb":"images/imageVert.jpg", |
"large":"images/imageVert.jpg", |
"title":"I'm a vertical picture", |
"link":"http://www.flickr.com/photos/44153025@N00/715392758" |
}, |
{ |
"large":"images/square.jpg", |
"thumb":"images/square.jpg", |
"link" :"images/square.jpg", |
"title":"1:1 aspect ratio" |
} |
]} |