From e44a7e37b6c7b5961adaffc62b9042b8d442938e Mon Sep 17 00:00:00 2001 From: mensonge Date: Thu, 13 Nov 2008 09:49:11 +0000 Subject: New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f --- .../js/dojox/data/demos/demo_DataDemoTable.html | 130 ++++++++++ .../js/dojox/data/demos/demo_FlickrRestStore.html | 275 +++++++++++++++++++++ includes/js/dojox/data/demos/demo_FlickrStore.html | 199 +++++++++++++++ includes/js/dojox/data/demos/demo_LazyLoad.html | 66 +++++ includes/js/dojox/data/demos/demo_MultiStores.html | 72 ++++++ includes/js/dojox/data/demos/demo_PicasaStore.html | 188 ++++++++++++++ .../data/demos/demo_QueryReadStore_ComboBox.html | 56 +++++ .../demos/demo_QueryReadStore_FilteringSelect.html | 56 +++++ .../dojox/data/demos/demo_QueryReadStore_grid.html | 129 ++++++++++ includes/js/dojox/data/demos/flickrDemo.css | 29 +++ .../dojox/data/demos/flickrDemo.css.commented.css | 35 +++ includes/js/dojox/data/demos/geography.json | 45 ++++ includes/js/dojox/data/demos/geography.xml | 51 ++++ .../dojox/data/demos/geography/Argentina/data.json | 5 + .../js/dojox/data/demos/geography/Brazil/data.json | 5 + .../data/demos/geography/Canada/Ottawa/data.json | 6 + .../data/demos/geography/Canada/Toronto/data.json | 6 + .../js/dojox/data/demos/geography/Canada/data.json | 10 + .../js/dojox/data/demos/geography/China/data.json | 4 + .../geography/Commonwealth of Australia/data.json | 5 + .../js/dojox/data/demos/geography/Egypt/data.json | 5 + .../js/dojox/data/demos/geography/France/data.json | 4 + .../dojox/data/demos/geography/Germany/data.json | 4 + .../js/dojox/data/demos/geography/India/data.json | 4 + .../js/dojox/data/demos/geography/Italy/data.json | 4 + .../data/demos/geography/Kenya/Mombasa/data.json | 5 + .../data/demos/geography/Kenya/Nairobi/data.json | 5 + .../js/dojox/data/demos/geography/Kenya/data.json | 9 + .../demos/geography/Mexico/Guadalajara/data.json | 7 + .../demos/geography/Mexico/Mexico City/data.json | 6 + .../js/dojox/data/demos/geography/Mexico/data.json | 10 + .../dojox/data/demos/geography/Mongolia/data.json | 4 + .../js/dojox/data/demos/geography/Russia/data.json | 4 + .../js/dojox/data/demos/geography/Spain/data.json | 4 + .../data/demos/geography/Sudan/Khartoum/data.json | 5 + .../js/dojox/data/demos/geography/Sudan/data.json | 6 + .../geography/United States of America/data.json | 4 + includes/js/dojox/data/demos/geography/root.json | 39 +++ includes/js/dojox/data/demos/picasaDemo.css | 37 +++ .../dojox/data/demos/picasaDemo.css.commented.css | 44 ++++ .../js/dojox/data/demos/stores/LazyLoadJSIStore.js | 142 +++++++++++ includes/js/dojox/data/demos/widgets/FlickrView.js | 36 +++ .../js/dojox/data/demos/widgets/FlickrViewList.js | 37 +++ includes/js/dojox/data/demos/widgets/PicasaView.js | 37 +++ .../js/dojox/data/demos/widgets/PicasaViewList.js | 37 +++ .../data/demos/widgets/templates/FlickrView.html | 34 +++ .../demos/widgets/templates/FlickrViewList.html | 2 + .../data/demos/widgets/templates/PicasaView.html | 35 +++ .../demos/widgets/templates/PicasaViewList.html | 2 + 49 files changed, 1944 insertions(+) create mode 100644 includes/js/dojox/data/demos/demo_DataDemoTable.html create mode 100644 includes/js/dojox/data/demos/demo_FlickrRestStore.html create mode 100644 includes/js/dojox/data/demos/demo_FlickrStore.html create mode 100644 includes/js/dojox/data/demos/demo_LazyLoad.html create mode 100644 includes/js/dojox/data/demos/demo_MultiStores.html create mode 100644 includes/js/dojox/data/demos/demo_PicasaStore.html create mode 100644 includes/js/dojox/data/demos/demo_QueryReadStore_ComboBox.html create mode 100644 includes/js/dojox/data/demos/demo_QueryReadStore_FilteringSelect.html create mode 100644 includes/js/dojox/data/demos/demo_QueryReadStore_grid.html create mode 100644 includes/js/dojox/data/demos/flickrDemo.css create mode 100644 includes/js/dojox/data/demos/flickrDemo.css.commented.css create mode 100644 includes/js/dojox/data/demos/geography.json create mode 100644 includes/js/dojox/data/demos/geography.xml create mode 100644 includes/js/dojox/data/demos/geography/Argentina/data.json create mode 100644 includes/js/dojox/data/demos/geography/Brazil/data.json create mode 100644 includes/js/dojox/data/demos/geography/Canada/Ottawa/data.json create mode 100644 includes/js/dojox/data/demos/geography/Canada/Toronto/data.json create mode 100644 includes/js/dojox/data/demos/geography/Canada/data.json create mode 100644 includes/js/dojox/data/demos/geography/China/data.json create mode 100644 includes/js/dojox/data/demos/geography/Commonwealth of Australia/data.json create mode 100644 includes/js/dojox/data/demos/geography/Egypt/data.json create mode 100644 includes/js/dojox/data/demos/geography/France/data.json create mode 100644 includes/js/dojox/data/demos/geography/Germany/data.json create mode 100644 includes/js/dojox/data/demos/geography/India/data.json create mode 100644 includes/js/dojox/data/demos/geography/Italy/data.json create mode 100644 includes/js/dojox/data/demos/geography/Kenya/Mombasa/data.json create mode 100644 includes/js/dojox/data/demos/geography/Kenya/Nairobi/data.json create mode 100644 includes/js/dojox/data/demos/geography/Kenya/data.json create mode 100644 includes/js/dojox/data/demos/geography/Mexico/Guadalajara/data.json create mode 100644 includes/js/dojox/data/demos/geography/Mexico/Mexico City/data.json create mode 100644 includes/js/dojox/data/demos/geography/Mexico/data.json create mode 100644 includes/js/dojox/data/demos/geography/Mongolia/data.json create mode 100644 includes/js/dojox/data/demos/geography/Russia/data.json create mode 100644 includes/js/dojox/data/demos/geography/Spain/data.json create mode 100644 includes/js/dojox/data/demos/geography/Sudan/Khartoum/data.json create mode 100644 includes/js/dojox/data/demos/geography/Sudan/data.json create mode 100644 includes/js/dojox/data/demos/geography/United States of America/data.json create mode 100644 includes/js/dojox/data/demos/geography/root.json create mode 100644 includes/js/dojox/data/demos/picasaDemo.css create mode 100644 includes/js/dojox/data/demos/picasaDemo.css.commented.css create mode 100644 includes/js/dojox/data/demos/stores/LazyLoadJSIStore.js create mode 100644 includes/js/dojox/data/demos/widgets/FlickrView.js create mode 100644 includes/js/dojox/data/demos/widgets/FlickrViewList.js create mode 100644 includes/js/dojox/data/demos/widgets/PicasaView.js create mode 100644 includes/js/dojox/data/demos/widgets/PicasaViewList.js create mode 100644 includes/js/dojox/data/demos/widgets/templates/FlickrView.html create mode 100644 includes/js/dojox/data/demos/widgets/templates/FlickrViewList.html create mode 100644 includes/js/dojox/data/demos/widgets/templates/PicasaView.html create mode 100644 includes/js/dojox/data/demos/widgets/templates/PicasaViewList.html (limited to 'includes/js/dojox/data/demos') diff --git a/includes/js/dojox/data/demos/demo_DataDemoTable.html b/includes/js/dojox/data/demos/demo_DataDemoTable.html new file mode 100644 index 0000000..09761b9 --- /dev/null +++ b/includes/js/dojox/data/demos/demo_DataDemoTable.html @@ -0,0 +1,130 @@ + + + + Dojo Visual Loader Test + + + + + + + + + + +

Dojox Data Demo Table

+ + + + + + + + + + + + + + +
+ + + + + + + + + + diff --git a/includes/js/dojox/data/demos/demo_FlickrRestStore.html b/includes/js/dojox/data/demos/demo_FlickrRestStore.html new file mode 100644 index 0000000..a094bc6 --- /dev/null +++ b/includes/js/dojox/data/demos/demo_FlickrRestStore.html @@ -0,0 +1,275 @@ + + + + Demo of FlickrRestStore + + + + + + + +

+ DEMO: FlickrRestStore Search +

+
+

+ Description: +

+

+ This simple demo shows how services, such as Flickr, can be wrapped by the datastore API. + In this demo, you can search public Flickr images through a FlickrRestStore by specifying + a series of tags (separated by spaces) to search on. The results will be displayed below the search box. +

+

+ For fun, search on the 3dny tag! +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Status: + +
+
+ User ID: + +
+
+ Set ID + +
+
+ Tags: + +
+
+ Full Text + +
+
+ Tagmode: + + + + Sort + + + +
+ Number of Pictures: + +
+
+ Page: + +
+
+ +
+
+
+
+
+ + + diff --git a/includes/js/dojox/data/demos/demo_FlickrStore.html b/includes/js/dojox/data/demos/demo_FlickrStore.html new file mode 100644 index 0000000..5ca48cf --- /dev/null +++ b/includes/js/dojox/data/demos/demo_FlickrStore.html @@ -0,0 +1,199 @@ + + + + Demo of FlickrStore + + + + + + + +

+ DEMO: FlickrStore Search +

+
+

+ Description: +

+

+ This simple demo shows how services, such as Flickr, can be wrapped by the datastore API. In this demo, you can search public Flickr images through a simple FlickrStore by specifying a series of tags (separated by spaces) to search on. The results will be displayed below the search box. +

+

+ For fun, search on the 3dny tag! +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Status: + +
+
+ ID: + +
+
+ Tags: + +
+
+ Tagmode: + + +
+ Number of Pictures: + +
+
+ +
+
+
+
+
+ + + diff --git a/includes/js/dojox/data/demos/demo_LazyLoad.html b/includes/js/dojox/data/demos/demo_LazyLoad.html new file mode 100644 index 0000000..358ce84 --- /dev/null +++ b/includes/js/dojox/data/demos/demo_LazyLoad.html @@ -0,0 +1,66 @@ + + + + Demo of Lazy Loading Datastore + + + + + + + +

+ DEMO: Lazy Loading Datastore used by dijit.Tree +

+
+

+ Description: +

+

+ This simple demo shows how the dijit.Tree widget can work with a Datastore that does lazy-loading of values into the tree. + In this demo, the Datastore is an extension of ItemFileReadStore that overrides the isItemLoaded() and loadItem() functions of + with ones that can detect 'stub' items and use the data in the stub item to load the real data for that item when it + is required. In this demo, the real data is required when one of the tree nodes is expanded. +

+

+ The key thing to note is that all the lazy-loading logic (how to locate the data from the backend and so forth) is encapsulated + into the store functions. The dijit.Tree widget only knows about and uses the dojo.data.Read API interfaces to call to the store to + get items, test if child items are fully loaded or not, and to invoke the loadItem() function on items that are not yet fully + loaded but have been requested to be expanded into view. It has no knowledge of how the store actually goes and gets the data. +

+ +
+ + +
+ + + Continents +
+
+ + + diff --git a/includes/js/dojox/data/demos/demo_MultiStores.html b/includes/js/dojox/data/demos/demo_MultiStores.html new file mode 100644 index 0000000..9faa8be --- /dev/null +++ b/includes/js/dojox/data/demos/demo_MultiStores.html @@ -0,0 +1,72 @@ + + + + Demo of Multiple Widgets using different Datastores + + + + + + + +

+ DEMO: Multiple DataStore implementations with dojo.data aware Widgets +

+
+

+ Description: +

+

+ This simple demo shows how widgets which know only the dojo.data interfaces can work with data sources of varying formats. In this case an OpmlStore + and a ItemFileReadStore are used to house the same data in different formats. +

+ +
+ + +
+
+ +

+ Widgets using OpmlStore: +

+
+ ComboBox:
+ +
+
+ + Tree:
+
+
+ +

+ Widgets using ItemFileReadStore: +

+
+ ComboBox:
+ +
+
+ + Tree:
+
+
+ + diff --git a/includes/js/dojox/data/demos/demo_PicasaStore.html b/includes/js/dojox/data/demos/demo_PicasaStore.html new file mode 100644 index 0000000..78bc961 --- /dev/null +++ b/includes/js/dojox/data/demos/demo_PicasaStore.html @@ -0,0 +1,188 @@ + + + + Demo of PicasaStore + + + + + + + +

+ DEMO: PicasaStore Search +

+
+

+ Description: +

+

+ This simple demo shows how services, such as Flickr, can be wrapped by the datastore API. In this demo, you can search public Flickr images through a simple FlickrStore by specifying a series of tags (separated by spaces) to search on. The results will be displayed below the search box. +

+

+ For fun, search on the 3dny tag! +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ Status: + +
+
+ ID: + +
+
+ Query: + +
+
+ Number of Pictures: + +
+
+
+ +
+
+
+
+
+ + + diff --git a/includes/js/dojox/data/demos/demo_QueryReadStore_ComboBox.html b/includes/js/dojox/data/demos/demo_QueryReadStore_ComboBox.html new file mode 100644 index 0000000..f6d187f --- /dev/null +++ b/includes/js/dojox/data/demos/demo_QueryReadStore_ComboBox.html @@ -0,0 +1,56 @@ + + + + Dojox QueryReadStore+ComboBox Demo + + + + + + +

Dojox QueryReadStore + ComboBox demo

+ +

Everything is created ONLY in markup

+
+
+
+ +
+
+ var w = dijit.byId("cb1"); +
= w.value +
= w.item ? w.store.getValue(w.item, "id") : "-" +
= w.getDisplayedValue() +
= w.isValid() +
+
+ + + + diff --git a/includes/js/dojox/data/demos/demo_QueryReadStore_FilteringSelect.html b/includes/js/dojox/data/demos/demo_QueryReadStore_FilteringSelect.html new file mode 100644 index 0000000..addaeca --- /dev/null +++ b/includes/js/dojox/data/demos/demo_QueryReadStore_FilteringSelect.html @@ -0,0 +1,56 @@ + + + + Dojox QueryReadStore+FilteringSelect Demo + + + + + + +

Dojox QueryReadStore + FilteringSelect demo

+ +

Everything is created ONLY in markup

+
+
+
+ +
+
+ var w = dijit.byId("fs1"); +
= w.value +
= w.item ? w.store.getValue(w.item, "id") : "-" +
= w.getDisplayedValue() +
= w.isValid() +
+
+ + + + diff --git a/includes/js/dojox/data/demos/demo_QueryReadStore_grid.html b/includes/js/dojox/data/demos/demo_QueryReadStore_grid.html new file mode 100644 index 0000000..3f7db7e --- /dev/null +++ b/includes/js/dojox/data/demos/demo_QueryReadStore_grid.html @@ -0,0 +1,129 @@ + + + + Dojox QueryReadStore+grid Demo + + + + + + +

Dojox QueryReadStore + Grid demo - paging, sortable and filterable all server-side

+ +

The grid is in HTML, store, model, etc. are JS, sorting is added by extending the model class

+ Capabilities: load data from server, show data, paging (30 rows at a time), sort, filter
+ You can see that data are loaded upon demand by scrolling down in the grid below line #30, + open FireBug and you see a server request being issued, to retreive another 30 rows/items.
+

+ +
+ +

The store and grid are "generated" and connected in HTML, filtering is done via JS

+ This store is by default sorted descending by name (not as the one above, which is ascending). +
+
+
+ + + + + + diff --git a/includes/js/dojox/data/demos/flickrDemo.css b/includes/js/dojox/data/demos/flickrDemo.css new file mode 100644 index 0000000..793d1c6 --- /dev/null +++ b/includes/js/dojox/data/demos/flickrDemo.css @@ -0,0 +1,29 @@ +.flickrView { + padding: 3 3 3 3; + border-width: 1px; + border-style: solid; + border-color: #000000; + border-collapse: separate; + width: 100%; +} +.flickrView th { + text-align: left; +} +.flickrView tr { + padding: 3 3 3 3; + border-width: 1px; + border-style: solid; + border-color: #000000; +} +.flickrView tr td { + padding: 3 3 3 3; + border-width: 1px; + border-style: solid; + border-color: #000000; +} +.flickrView { + background-color: #EFEFEF; +} +.flickrTitle { + background-color: #CCCCCC; +} diff --git a/includes/js/dojox/data/demos/flickrDemo.css.commented.css b/includes/js/dojox/data/demos/flickrDemo.css.commented.css new file mode 100644 index 0000000..7e75a5d --- /dev/null +++ b/includes/js/dojox/data/demos/flickrDemo.css.commented.css @@ -0,0 +1,35 @@ +.flickrView { + padding: 3 3 3 3; + border-width: 1px; + border-style: solid; + border-color: #000000; + border-collapse: separate; + width: 100%; +} + +.flickrView th { + text-align: left; +} + +.flickrView tr { + padding: 3 3 3 3; + border-width: 1px; + border-style: solid; + border-color: #000000; +} + +.flickrView tr td { + padding: 3 3 3 3; + border-width: 1px; + border-style: solid; + border-color: #000000; +} + +.flickrView { + background-color: #EFEFEF; +} + +.flickrTitle { + background-color: #CCCCCC; +} + diff --git a/includes/js/dojox/data/demos/geography.json b/includes/js/dojox/data/demos/geography.json new file mode 100644 index 0000000..c2f01bb --- /dev/null +++ b/includes/js/dojox/data/demos/geography.json @@ -0,0 +1,45 @@ +{ identifier: 'name', + label: 'name', + items: [ + { name:'Africa', type:'continent', children:[ + { name:'Egypt', type:'country' }, + { name:'Kenya', type:'country', children:[ + { name:'Nairobi', type:'city' }, + { name:'Mombasa', type:'city' } ] + }, + { name:'Sudan', type:'country', children: + { name:'Khartoum', type:'city' } + } ] + }, + { name:'Asia', type:'continent', children:[ + { name:'China', type:'country' }, + { name:'India', type:'country' }, + { name:'Russia', type:'country' }, + { name:'Mongolia', type:'country' } ] + }, + { name:'Australia', type:'continent', population:'21 million', children: + { name:'Commonwealth of Australia', type:'country', population:'21 million'} + }, + { name:'Europe', type:'continent', children:[ + { name:'Germany', type:'country' }, + { name:'France', type:'country' }, + { name:'Spain', type:'country' }, + { name:'Italy', type:'country' } ] + }, + { name:'North America', type:'continent', children:[ + { name:'Mexico', type:'country', population:'108 million', area:'1,972,550 sq km', children:[ + { name:'Mexico City', type:'city', population:'19 million', timezone:'-6 UTC'}, + { name:'Guadalajara', type:'city', population:'4 million', timezone:'-6 UTC' } ] + }, + { name:'Canada', type:'country', population:'33 million', area:'9,984,670 sq km', children:[ + { name:'Ottawa', type:'city', population:'0.9 million', timezone:'-5 UTC'}, + { name:'Toronto', type:'city', population:'2.5 million', timezone:'-5 UTC' }] + }, + { name:'United States of America', type:'country' } ] + }, + { name:'South America', type:'continent', children:[ + { name:'Brazil', type:'country', population:'186 million' }, + { name:'Argentina', type:'country', population:'40 million' } ] + } ] +} + diff --git a/includes/js/dojox/data/demos/geography.xml b/includes/js/dojox/data/demos/geography.xml new file mode 100644 index 0000000..070a8c1 --- /dev/null +++ b/includes/js/dojox/data/demos/geography.xml @@ -0,0 +1,51 @@ + + + + geography.opml + 2006-11-10 + 2006-11-13 + Magellan, Ferdinand + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/includes/js/dojox/data/demos/geography/Argentina/data.json b/includes/js/dojox/data/demos/geography/Argentina/data.json new file mode 100644 index 0000000..17ba291 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Argentina/data.json @@ -0,0 +1,5 @@ +{ + name:'Argentina', + type:'country', + population:'40 million' +} diff --git a/includes/js/dojox/data/demos/geography/Brazil/data.json b/includes/js/dojox/data/demos/geography/Brazil/data.json new file mode 100644 index 0000000..a326c24 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Brazil/data.json @@ -0,0 +1,5 @@ +{ + name:'Brazil', + type:'country', + population:'186 million' +} diff --git a/includes/js/dojox/data/demos/geography/Canada/Ottawa/data.json b/includes/js/dojox/data/demos/geography/Canada/Ottawa/data.json new file mode 100644 index 0000000..df3bbc8 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Canada/Ottawa/data.json @@ -0,0 +1,6 @@ +{ + name:'Ottawa', + type:'city', + population:'0.9 million', + timezone:'-5 UTC' +} diff --git a/includes/js/dojox/data/demos/geography/Canada/Toronto/data.json b/includes/js/dojox/data/demos/geography/Canada/Toronto/data.json new file mode 100644 index 0000000..534409b --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Canada/Toronto/data.json @@ -0,0 +1,6 @@ +{ + name:'Toronto', + type:'city', + population:'2.5 million', + timezone:'-5 UTC' +} diff --git a/includes/js/dojox/data/demos/geography/Canada/data.json b/includes/js/dojox/data/demos/geography/Canada/data.json new file mode 100644 index 0000000..6ef34ed --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Canada/data.json @@ -0,0 +1,10 @@ +{ + name:'Canada', + type:'country', + population:'33 million', area:'9,984,670 sq km', + children:[ + {stub:'Ottawa'}, + {stub:'Toronto'} + ] +} + diff --git a/includes/js/dojox/data/demos/geography/China/data.json b/includes/js/dojox/data/demos/geography/China/data.json new file mode 100644 index 0000000..72c29cc --- /dev/null +++ b/includes/js/dojox/data/demos/geography/China/data.json @@ -0,0 +1,4 @@ +{ + name:'China', + type:'country' +} diff --git a/includes/js/dojox/data/demos/geography/Commonwealth of Australia/data.json b/includes/js/dojox/data/demos/geography/Commonwealth of Australia/data.json new file mode 100644 index 0000000..e093295 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Commonwealth of Australia/data.json @@ -0,0 +1,5 @@ +{ + name:'Commonwealth of Australia', + type:'country', + population:'21 million' +} diff --git a/includes/js/dojox/data/demos/geography/Egypt/data.json b/includes/js/dojox/data/demos/geography/Egypt/data.json new file mode 100644 index 0000000..d355537 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Egypt/data.json @@ -0,0 +1,5 @@ +{ + name:'Egypt', + type:'country' +} + diff --git a/includes/js/dojox/data/demos/geography/France/data.json b/includes/js/dojox/data/demos/geography/France/data.json new file mode 100644 index 0000000..5b5f3c3 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/France/data.json @@ -0,0 +1,4 @@ +{ + name:'France', + type:'country' +} diff --git a/includes/js/dojox/data/demos/geography/Germany/data.json b/includes/js/dojox/data/demos/geography/Germany/data.json new file mode 100644 index 0000000..1656257 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Germany/data.json @@ -0,0 +1,4 @@ +{ + name:'Germany', + type:'country' +} diff --git a/includes/js/dojox/data/demos/geography/India/data.json b/includes/js/dojox/data/demos/geography/India/data.json new file mode 100644 index 0000000..3103f89 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/India/data.json @@ -0,0 +1,4 @@ +{ + name:'India', + type:'country' +} diff --git a/includes/js/dojox/data/demos/geography/Italy/data.json b/includes/js/dojox/data/demos/geography/Italy/data.json new file mode 100644 index 0000000..6e6b076 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Italy/data.json @@ -0,0 +1,4 @@ +{ + name:'Italy', + type:'country' +} diff --git a/includes/js/dojox/data/demos/geography/Kenya/Mombasa/data.json b/includes/js/dojox/data/demos/geography/Kenya/Mombasa/data.json new file mode 100644 index 0000000..28aa849 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Kenya/Mombasa/data.json @@ -0,0 +1,5 @@ +{ + name:'Mombasa', + type:'city', + population: "Unknown" +} diff --git a/includes/js/dojox/data/demos/geography/Kenya/Nairobi/data.json b/includes/js/dojox/data/demos/geography/Kenya/Nairobi/data.json new file mode 100644 index 0000000..f5658ec --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Kenya/Nairobi/data.json @@ -0,0 +1,5 @@ +{ + name:'Nairobi', + type:'city', + population: "Unknown" +} diff --git a/includes/js/dojox/data/demos/geography/Kenya/data.json b/includes/js/dojox/data/demos/geography/Kenya/data.json new file mode 100644 index 0000000..9253c25 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Kenya/data.json @@ -0,0 +1,9 @@ +{ + name:'Kenya', + type:'country', + children:[ + {stub:'Nairobi'}, + {stub:'Mombasa'} + ] +} + diff --git a/includes/js/dojox/data/demos/geography/Mexico/Guadalajara/data.json b/includes/js/dojox/data/demos/geography/Mexico/Guadalajara/data.json new file mode 100644 index 0000000..059fc82 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Mexico/Guadalajara/data.json @@ -0,0 +1,7 @@ +{ + name:'Guadalajara', + type:'city', + population:'4 million', + timezone:'-6 UTC' +} + diff --git a/includes/js/dojox/data/demos/geography/Mexico/Mexico City/data.json b/includes/js/dojox/data/demos/geography/Mexico/Mexico City/data.json new file mode 100644 index 0000000..8c67622 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Mexico/Mexico City/data.json @@ -0,0 +1,6 @@ +{ + name:'Mexico City', + type:'city', + population:'19 million', + timezone:'-6 UTC' +} diff --git a/includes/js/dojox/data/demos/geography/Mexico/data.json b/includes/js/dojox/data/demos/geography/Mexico/data.json new file mode 100644 index 0000000..aa381e4 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Mexico/data.json @@ -0,0 +1,10 @@ +{ + name:'Mexico', + type:'country', + population:'108 million', + area:'1,972,550 sq km', + children:[ + {stub:'Mexico City'}, + {stub:'Guadalajara'} + ] +} diff --git a/includes/js/dojox/data/demos/geography/Mongolia/data.json b/includes/js/dojox/data/demos/geography/Mongolia/data.json new file mode 100644 index 0000000..4c60b22 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Mongolia/data.json @@ -0,0 +1,4 @@ +{ + name:'Mongolia', + type:'country' +} diff --git a/includes/js/dojox/data/demos/geography/Russia/data.json b/includes/js/dojox/data/demos/geography/Russia/data.json new file mode 100644 index 0000000..5d9a6ba --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Russia/data.json @@ -0,0 +1,4 @@ +{ + name:'Russia', + type:'country' +} diff --git a/includes/js/dojox/data/demos/geography/Spain/data.json b/includes/js/dojox/data/demos/geography/Spain/data.json new file mode 100644 index 0000000..d9a1210 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Spain/data.json @@ -0,0 +1,4 @@ +{ + name:'Spain', + type:'country' +} diff --git a/includes/js/dojox/data/demos/geography/Sudan/Khartoum/data.json b/includes/js/dojox/data/demos/geography/Sudan/Khartoum/data.json new file mode 100644 index 0000000..befa3c7 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Sudan/Khartoum/data.json @@ -0,0 +1,5 @@ +{ + name:'Khartoum', + type:'city' +} + diff --git a/includes/js/dojox/data/demos/geography/Sudan/data.json b/includes/js/dojox/data/demos/geography/Sudan/data.json new file mode 100644 index 0000000..fe7585b --- /dev/null +++ b/includes/js/dojox/data/demos/geography/Sudan/data.json @@ -0,0 +1,6 @@ +{ + name:'Sudan', + type:'country', + children:{stub:'Khartoum'} +} + diff --git a/includes/js/dojox/data/demos/geography/United States of America/data.json b/includes/js/dojox/data/demos/geography/United States of America/data.json new file mode 100644 index 0000000..7dbdd61 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/United States of America/data.json @@ -0,0 +1,4 @@ +{ + name:'United States of America', + type:'country' +} diff --git a/includes/js/dojox/data/demos/geography/root.json b/includes/js/dojox/data/demos/geography/root.json new file mode 100644 index 0000000..dda74f5 --- /dev/null +++ b/includes/js/dojox/data/demos/geography/root.json @@ -0,0 +1,39 @@ +{ + identifier: 'name', + label: 'name', + items: [ + { name:'Africa', type:'continent', + children:[{_reference:'Egypt'}, {_reference:'Kenya'}, {_reference:'Sudan'}] }, + { name:'Egypt', type:'stub', parent: 'geography'}, + { name:'Kenya', type:'stub', parent: 'geography'}, + { name:'Sudan', type:'stub', parent: 'geography'}, + + { name:'Asia', type:'continent', + children:[{_reference:'China'}, {_reference:'India'}, {_reference:'Russia'}, {_reference:'Mongolia'}] }, + { name:'China', type:'stub', parent: 'geography'}, + { name:'India', type:'stub', parent: 'geography'}, + { name:'Russia', type:'stub', parent: 'geography'}, + { name:'Mongolia', type:'stub', parent: 'geography'}, + + { name:'Australia', type:'continent', population:'21 million', + children:{_reference:'Commonwealth of Australia'}}, + { name:'Commonwealth of Australia', type:'stub', parent:'geography'}, + + { name:'Europe', type:'continent', + children:[{_reference:'Germany'}, {_reference:'France'}, {_reference:'Spain'}, {_reference:'Italy'}] }, + { name:'Germany', type:'stub', parent: 'geography'}, + { name:'France', type:'stub', parent: 'geography'}, + { name:'Spain', type:'stub', parent: 'geography'}, + { name:'Italy', type:'stub', parent: 'geography'}, + + { name:'North America', type:'continent', + children:[{_reference:'Mexico'}, {_reference:'Canada'}, {_reference:'United States of America'}] }, + { name:'Mexico', type:'stub', parent: 'geography'}, + { name:'Canada', type:'stub', parent: 'geography'}, + { name:'United States of America', type:'stub', parent: 'geography'}, + + { name:'South America', type:'continent', + children:[{_reference:'Brazil'}, {_reference:'Argentina'}] }, + { name:'Brazil', type:'stub', parent: 'geography'}, + { name:'Argentina', type:'stub', parent: 'geography'} +]} diff --git a/includes/js/dojox/data/demos/picasaDemo.css b/includes/js/dojox/data/demos/picasaDemo.css new file mode 100644 index 0000000..9163d40 --- /dev/null +++ b/includes/js/dojox/data/demos/picasaDemo.css @@ -0,0 +1,37 @@ +.picasaView { + padding: 3 3 3 3; + border-width: 1px; + border-style: solid; + border-color: #000000; + border-collapse: separate; + width: 100%; +} +.picasaView th { + text-align: left; +} +.picasaView tr { + padding: 3 3 3 3; + border-width: 1px; + border-style: solid; + border-color: #000000; +} +.picasaView tr td { + padding: 3 3 3 3; + border-width: 1px; + border-style: solid; + border-color: #000000; +} +.picasaView { + background-color: #EFEFEF; + float: left; + width: 250px; + height: 250px; +} +.picasaSummary { + width: 250px; + height: 30px; + overflow: hidden; + } +.picasaTitle { + background-color: #CCCCCC; +} diff --git a/includes/js/dojox/data/demos/picasaDemo.css.commented.css b/includes/js/dojox/data/demos/picasaDemo.css.commented.css new file mode 100644 index 0000000..e274f87 --- /dev/null +++ b/includes/js/dojox/data/demos/picasaDemo.css.commented.css @@ -0,0 +1,44 @@ +.picasaView { + padding: 3 3 3 3; + border-width: 1px; + border-style: solid; + border-color: #000000; + border-collapse: separate; + width: 100%; +} + +.picasaView th { + text-align: left; +} + +.picasaView tr { + padding: 3 3 3 3; + border-width: 1px; + border-style: solid; + border-color: #000000; +} + +.picasaView tr td { + padding: 3 3 3 3; + border-width: 1px; + border-style: solid; + border-color: #000000; +} + +.picasaView { + background-color: #EFEFEF; + float: left; + width: 250px; + height: 250px; +} + +.picasaSummary { + width: 250px; + height: 30px; + overflow: hidden; + } + +.picasaTitle { + background-color: #CCCCCC; +} + diff --git a/includes/js/dojox/data/demos/stores/LazyLoadJSIStore.js b/includes/js/dojox/data/demos/stores/LazyLoadJSIStore.js new file mode 100644 index 0000000..e7acff7 --- /dev/null +++ b/includes/js/dojox/data/demos/stores/LazyLoadJSIStore.js @@ -0,0 +1,142 @@ +if(!dojo._hasResource["dojox.data.demos.stores.LazyLoadJSIStore"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.data.demos.stores.LazyLoadJSIStore"] = true; +dojo.provide("dojox.data.demos.stores.LazyLoadJSIStore"); +dojo.require("dojo.data.ItemFileReadStore"); + +dojo.declare("dojox.data.demos.stores.LazyLoadJSIStore", dojo.data.ItemFileReadStore, { + constructor: function(/* object */ keywordParameters){ + // LazyLoadJSIStore extends ItemFileReadStore to implement an + // example of lazy-loading/faulting in items on-demand. + // Note this is certianly not a perfect implementation, it is + // an example. + }, + + isItemLoaded: function(/*object*/ item) { + // summary: + // Overload of the isItemLoaded function to look for items of type 'stub', which indicate + // the data hasn't been loaded in yet. + // + // item: + // The item to examine. + + //For this store, if it has the value of stub for its type attribute, + //then the item basn't been fully loaded yet. It's just a placeholder. + if(this.getValue(item, "type") === "stub"){ + return false; + } + return true; + }, + + loadItem: function(keywordArgs){ + // summary: + // Overload of the loadItem function to fault in items. This assumes the data for an item is laid out + // in a RESTful sort of pattern name0/name1/data.json and so on and uses that to load the data. + // It will also detect stub items in the newly loaded item and insert the stubs into the ItemFileReadStore + // list so they can also be loaded in on-demand. + // + // item: + // The item to examine. + + var item = keywordArgs.item; + this._assertIsItem(item); + + //Build the path to the data.json for this item + //The path consists of where its parent was loaded from + //plus the item name. + var itemName = this.getValue(item, "name"); + var parent = this.getValue(item, "parent"); + var dataUrl = ""; + if (parent){ + dataUrl += (parent + "/"); + } + + //For this store, all child input data is loaded from a url that ends with data.json + dataUrl += itemName + "/data.json"; + + //Need a reference to the store to call back to its structures. + var self = this; + + // Callback for handling a successful load. + var gotData = function(data){ + //Now we need to modify the existing item a bit to take it out of stub state + //Since we extend the store and have knowledge of the internal + //structure, this can be done here. Now, is we extended + //a write store, we could call the write APIs to do this too + //But for a simple demo the diretc modification in the store function + //is sufficient. + + //Clear off the stub indicators. + delete item.type; + delete item.parent; + + //Set up the loaded values in the format ItemFileReadStore uses for attributes. + for (i in data) { + if (dojo.isArray(data[i])) { + item[i] = data[i]; + }else{ + item[i] = [data[i]]; + } + } + + //Reset the item in the reference. + self._arrayOfAllItems[item[self._itemNumPropName]] = item; + + //Scan the new values in the item for extra stub items we need to + //add to the items array of the store so they can be lazy-loaded later... + var attributes = self.getAttributes(item); + for(i in attributes){ + var values = self.getValues(item, attributes[i]); + for (var j = 0; j < values.length; j++) { + var value = values[j]; + + if(typeof value === "object"){ + if(value["stub"] ){ + //We have a stub reference here, we need to create the stub item + var stub = { + type: ["stub"], + name: [value["stub"]], // + parent: [itemName] //The child stub item is parented by this item name... + }; + if (parent) { + //Add in any parents to your parent so URL construstruction is accurate. + stub.parent[0] = parent + "/" + stub.parent[0]; + } + //Finalize the addition of the new stub item into the ItemFileReadStore list. + self._arrayOfAllItems.push(stub); + stub[self._storeRefPropName] = self; + stub[self._itemNumPropName] = (self._arrayOfAllItems.length - 1); //Last one pushed in should be the item + values[j] = stub; //Set the stub item back in its place and replace the stub notation. + } + } + } + } + + //Done processing! Call the onItem, if any. + if(keywordArgs.onItem){ + var scope = keywordArgs.scope ? keywordArgs.scope : dojo.global; + keywordArgs.onItem.call(scope, item); + } + }; + + //Callback for any errors that occur during load. + var gotError = function(error){ + //Call the onComplete, if any + if(keywordArgs.onError){ + var scope = keywordArgs.scope ? keywordArgs.scope : dojo.global; + keywordArgs.onError.call(scope, error); + } + }; + + //Fire the get and pass the proper callbacks to the deferred. + var xhrArgs = { + url: dataUrl, + handleAs: "json-comment-optional" + }; + var d = dojo.xhrGet(xhrArgs); + d.addCallback(gotData); + d.addErrback(gotError); + } +}); + + +} diff --git a/includes/js/dojox/data/demos/widgets/FlickrView.js b/includes/js/dojox/data/demos/widgets/FlickrView.js new file mode 100644 index 0000000..cacb127 --- /dev/null +++ b/includes/js/dojox/data/demos/widgets/FlickrView.js @@ -0,0 +1,36 @@ +if(!dojo._hasResource["dojox.data.demos.widgets.FlickrView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.data.demos.widgets.FlickrView"] = true; +dojo.provide("dojox.data.demos.widgets.FlickrView"); +dojo.require("dijit._Templated"); +dojo.require("dijit._Widget"); + +dojo.declare("dojox.data.demos.widgets.FlickrView", [dijit._Widget, dijit._Templated], { + //Simple demo widget for representing a view of a Flickr Item. + + templateString:"\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t\n
\n\t\t\t\t\n\t\t\t\t\tTitle:\n\t\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\tAuthor:\n\t\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\tImage:\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\n", + + //Attach points for reference. + titleNode: null, + descriptionNode: null, + imageNode: null, + authorNode: null, + + title: "", + author: "", + imageUrl: "", + iconUrl: "", + + postCreate: function(){ + this.titleNode.appendChild(document.createTextNode(this.title)); + this.authorNode.appendChild(document.createTextNode(this.author)); + var href = document.createElement("a"); + href.setAttribute("href", this.imageUrl); + href.setAttribute("target", "_blank"); + var imageTag = document.createElement("img"); + imageTag.setAttribute("src", this.iconUrl); + href.appendChild(imageTag); + this.imageNode.appendChild(href); + } +}); + +} diff --git a/includes/js/dojox/data/demos/widgets/FlickrViewList.js b/includes/js/dojox/data/demos/widgets/FlickrViewList.js new file mode 100644 index 0000000..2c3c881 --- /dev/null +++ b/includes/js/dojox/data/demos/widgets/FlickrViewList.js @@ -0,0 +1,37 @@ +if(!dojo._hasResource["dojox.data.demos.widgets.FlickrViewList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.data.demos.widgets.FlickrViewList"] = true; +dojo.provide("dojox.data.demos.widgets.FlickrViewList"); +dojo.require("dijit._Templated"); +dojo.require("dijit._Widget"); +dojo.require("dojox.data.demos.widgets.FlickrView"); + +dojo.declare("dojox.data.demos.widgets.FlickrViewList", [dijit._Widget, dijit._Templated], { + //Simple demo widget that is just a list of FlickrView Widgets. + + templateString:"
\n\n", + + //Attach points for reference. + listNode: null, + + postCreate: function(){ + this.fViewWidgets = []; + }, + + clearList: function(){ + while(this.list.firstChild){ + this.list.removeChild(this.list.firstChild); + } + for(var i = 0; i < this.fViewWidgets.length; i++){ + this.fViewWidgets[i].destroy(); + } + this.fViewWidgets = []; + }, + + addView: function(viewData){ + var newView = new dojox.data.demos.widgets.FlickrView(viewData); + this.fViewWidgets.push(newView); + this.list.appendChild(newView.domNode); + } +}); + +} diff --git a/includes/js/dojox/data/demos/widgets/PicasaView.js b/includes/js/dojox/data/demos/widgets/PicasaView.js new file mode 100644 index 0000000..6b100ac --- /dev/null +++ b/includes/js/dojox/data/demos/widgets/PicasaView.js @@ -0,0 +1,37 @@ +if(!dojo._hasResource["dojox.data.demos.widgets.PicasaView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.data.demos.widgets.PicasaView"] = true; +dojo.provide("dojox.data.demos.widgets.PicasaView"); +dojo.require("dijit._Templated"); +dojo.require("dijit._Widget"); + +dojo.declare("dojox.data.demos.widgets.PicasaView", [dijit._Widget, dijit._Templated], { + //Simple demo widget for representing a view of a Picasa Item. + + templateString:"\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t\n
\n\t\t\t\t\n\t\t\t\t\tTitle:\n\t\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\tAuthor:\n\t\t\t\t\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\tSummary:\n\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\n", + + //Attach points for reference. + titleNode: null, + descriptionNode: null, + imageNode: null, + authorNode: null, + + title: "", + author: "", + imageUrl: "", + iconUrl: "", + + postCreate: function(){ + this.titleNode.appendChild(document.createTextNode(this.title)); + this.authorNode.appendChild(document.createTextNode(this.author)); + this.descriptionNode.appendChild(document.createTextNode(this.description)); + var href = document.createElement("a"); + href.setAttribute("href", this.imageUrl); + href.setAttribute("target", "_blank"); + var imageTag = document.createElement("img"); + imageTag.setAttribute("src", this.iconUrl); + href.appendChild(imageTag); + this.imageNode.appendChild(href); + } +}); + +} diff --git a/includes/js/dojox/data/demos/widgets/PicasaViewList.js b/includes/js/dojox/data/demos/widgets/PicasaViewList.js new file mode 100644 index 0000000..45371cd --- /dev/null +++ b/includes/js/dojox/data/demos/widgets/PicasaViewList.js @@ -0,0 +1,37 @@ +if(!dojo._hasResource["dojox.data.demos.widgets.PicasaViewList"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dojox.data.demos.widgets.PicasaViewList"] = true; +dojo.provide("dojox.data.demos.widgets.PicasaViewList"); +dojo.require("dijit._Templated"); +dojo.require("dijit._Widget"); +dojo.require("dojox.data.demos.widgets.PicasaView"); + +dojo.declare("dojox.data.demos.widgets.PicasaViewList", [dijit._Widget, dijit._Templated], { + //Simple demo widget that is just a list of PicasaView Widgets. + + templateString:"
\n\n", + + //Attach points for reference. + listNode: null, + + postCreate: function(){ + this.fViewWidgets = []; + }, + + clearList: function(){ + while(this.list.firstChild){ + this.list.removeChild(this.list.firstChild); + } + for(var i = 0; i < this.fViewWidgets.length; i++){ + this.fViewWidgets[i].destroy(); + } + this.fViewWidgets = []; + }, + + addView: function(viewData){ + var newView = new dojox.data.demos.widgets.PicasaView(viewData); + this.fViewWidgets.push(newView); + this.list.appendChild(newView.domNode); + } +}); + +} diff --git a/includes/js/dojox/data/demos/widgets/templates/FlickrView.html b/includes/js/dojox/data/demos/widgets/templates/FlickrView.html new file mode 100644 index 0000000..b9d3bf9 --- /dev/null +++ b/includes/js/dojox/data/demos/widgets/templates/FlickrView.html @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + +
+ + Title: + + +
+ + Author: + + +
+ + Image: + +
+
+ diff --git a/includes/js/dojox/data/demos/widgets/templates/FlickrViewList.html b/includes/js/dojox/data/demos/widgets/templates/FlickrViewList.html new file mode 100644 index 0000000..3a9f565 --- /dev/null +++ b/includes/js/dojox/data/demos/widgets/templates/FlickrViewList.html @@ -0,0 +1,2 @@ +
+ diff --git a/includes/js/dojox/data/demos/widgets/templates/PicasaView.html b/includes/js/dojox/data/demos/widgets/templates/PicasaView.html new file mode 100644 index 0000000..88dbb31 --- /dev/null +++ b/includes/js/dojox/data/demos/widgets/templates/PicasaView.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + +
+ + Title: + + +
+ + Author: + + +
+ + Summary: + + +
+
+ diff --git a/includes/js/dojox/data/demos/widgets/templates/PicasaViewList.html b/includes/js/dojox/data/demos/widgets/templates/PicasaViewList.html new file mode 100644 index 0000000..3a9f565 --- /dev/null +++ b/includes/js/dojox/data/demos/widgets/templates/PicasaViewList.html @@ -0,0 +1,2 @@ +
+ -- cgit v1.2.3