tony-landis (owner)

Revisions

gist: 32478 Download_button fork
public
Description:
AgileGallery Source Code
Public Clone URL: git://gist.github.com/32478.git
Embed All Files: show embed
agilegallery.lzx.xml #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<!--
AgileGallery Source Code
Author: Tony Landis
Link: http://www.agilegallery.com
Link: http://www.tonylandis.com
License: GPL
Restrictions: Free for personal/commerical use, the link/credit must remain intact and visible
-->
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE canvas SYSTEM "C:\Program Files\OpenLaszlo Server 3.2\Server\lps-3.2\tools\lzx.dtd">
<canvas bgcolor="#000000">
 
<!-- RESOURCES -->
<font name="san" src="helmetr.ttf" />
 
<!-- check for picasa php parser url -->
<script>
if (typeof(xmlURL) == 'undefined') xmlURL=false;
    </script>
 
<!-- load the parsed XML data -->
    <dataset name="picasaImages" request="true" type="http" src="${xmlURL}" />
    <datapointer id="pager" xpath="picasaImages:/gallery/images/img[1]" />
     
<!-- BASE CLASS -->
<class name="basestuff">
<attribute name="baseURL" value="" type="string" />
<attribute name="galleryName" value="" type="string" />
<attribute name="galleryCount" value="0" type="number" />
<attribute name="firstImageUrl" value="" type="string" />
<attribute name="firstImageCaption" value="" type="string" />
<datapointer xpath="picasaImages:/gallery" ondata="processData()">
<method name="processData">
parent.setAttribute("baseURL", this.xpathQuery('url/text()'));
parent.setAttribute("galleryName", this.xpathQuery('name/text()'));
parent.setAttribute("galleryCount", this.xpathQuery('count/text()'));
</method>
</datapointer>
<handler name="oninit">
var cm = new LzContextMenu();
canvas.setDefaultContextMenu(cm);
var item1 = cm.makeMenuItem('About AgileGallery', new LzDelegate(this, "aboutagilegallery"));
cm.addItem(item1);
</handler>
<method name="aboutagilegallery">
LzBrowser.loadURL('http://www.agilegallery.com/', '_blank')
</method>
<!-- animation to hide current photo -->
<method name="showImagePre" args="url,captiontxt">
animate('opacity', 1, 300, false);
captionborder.animate('opacity', 0, 0, false);
caption.animate('opacity', 0, 0, false);
fullsized.animate('opacity', 0, 0, false);
 
fullsized.setAttribute('src', baseURL + url);
caption.setText(captiontxt);
 
//copyright.animate('opacity', 0, 0, false);
</method>
<!-- animation reveal current photo -->
<method name="showImagePost">
fullsized.animate('opacity', 1, 300, false);
captionborder.animate('opacity', .4, 600, false);
caption.animate('opacity', 1, 500, false);
//copyright.animate('opacity', .25, 600, false);
</method>
</class>
   
<!-- GALLERY CLASS -->
<class name="agilegallery" extends="basestuff">
<attribute name="imgId" value="1" type="string"/>
<attribute name="activeImg" value="" type="string"/>
<attribute name="timerDelay" value="3500" type="number"/>
<datapointer id="initxml" xpath="picasaImages:/gallery/images/img[1]" />
 
<handler name="oninit">
header.animate('y', 0, 1700, false);
results.animate('x', 0, 1900, false);
footer.animate('opacity' , .8, 1900, false);
</handler>
<handler name="ondata" args="d">
if(pager.selectNext()) showImage();
</handler>
<!-- set new photo -->
<method name="showImage">
showImagePre();
var url = baseURL + pager.p.getAttr("photo");
fullsized.setAttribute('src', url);
caption.setText(pager.getNodeText());
this.setAttribute('activeImg',pager.p.getAttr("photo"));
showImagePost();
</method>
<method name="setDelay" args="delay">
if(delay == 0) {
this.delayedView();
return;
}
this.slideDeligate = new LzDelegate( this, 'delayedView' );
LzTimer.addTimer( this.slideDeligate, this.timerDelay);
</method>
<method name="delayedView">
if (pager.selectNext()) {
this.showImage();
this.setDelay();
} else {
buttonPrev.animate('opacity', 1, 300);
buttonNext.animate('opacity', 1, 300);
}
</method>
<method name="stopSlideShow">
LzTimer.removeTimer( this.slideDeligate );
</method>
 
<!-- HEADER -->
<view id="header" width="100%" height="50" bgcolor="#999999" y="-50">
<view width="99.9%" height="95%" bgcolor="#CCCCCC" align="center" valign="middle">
<view x="150" y="150" />
<simplelayout axis="x" spacing="10"/>
<button id="buttonPrev" y="10" opacity=".3" font="san" fontsize="12"> Previous
<handler name="onclick">
buttonNext.animate('opacity', 1, 300);
if (pager.selectPrev())
parent.parent.parent.showImage();
else
this.animate('opacity', .3, 300);
</handler>
</button>
<button id="buttonNext" y="10" font="san" fontsize="12"> Next
<handler name="onclick">
buttonPrev.animate('opacity', 1, 300);
if (pager.selectNext())
parent.parent.parent.showImage();
else
this.animate('opacity', .3, 300);
</handler>
</button>
<button id="buttonSlideShow" y="10" font="san" fontsize="12"> Start Slideshow
<handler name="onclick">
buttonPrev.animate('opacity', 0, 0);
buttonNext.animate('opacity', 0, 0);
parent.parent.parent.setDelay(0);
buttonSlideShow.animate('opacity', 0, 0);
buttonSlideShowStop.animate('opacity', 1, 300);
results.animate('x', "-130", 300);
photo.animate('x', "10", 400);
</handler>
</button>
<button id="buttonSlideShowStop" y="10" opacity="0" font="san" fontsize="12"> Stop Slideshow
<handler name="onclick">
buttonPrev.animate('opacity', 1, 0);
buttonNext.animate('opacity', 1, 0);
buttonSlideShow.animate('opacity', 1, 0);
buttonSlideShowStop.animate('opacity', 0, 0);
parent.parent.parent.stopSlideShow();
results.animate('x', "0", 400);
photo.animate('x', "130", 300);
</handler>
</button>
<!-- show gallery name -->
<text y="10" width="400" font="san" fontsize="20" clip="false" fgcolor="#666666" text="${parent.parent.parent.galleryName}" />
</view>
</view>
 
<!-- THUMBS -->
<view id="results" width="130" height="${canvas.height-70}" clip="true" y="50" x="-130" bgcolor="#ffffff">
<view name="results" x="15" y="15" width="85%" align="center">
<wrappinglayout axis="x" spacing="5" />
<thumbs datapath="picasaImages:/gallery[1]/images[1]/*" />
</view>
<scrollbar axis="y" />
</view>
 
<!-- PHOTO -->
<view id="photo" x="130" y="50" bgcolor="#000000" width="100%" height="100%">
<image id="fullsized" x="20" y="20"/>
<view id="captionborder" x="30" y="30" height="20" width="${fullsized.width-20}" bgcolor="#CCCCCC" opacity="0">
<text id="caption" y="1" height="18" width="100%" opacity="0" font="san" fontsize="12" bgcolor="#FFFFFF" multiline="true"></text>
</view>
<!--
<text id="copyright" x="30" y="${fullsized.height-10}" height="20" width="${fullsized.width-20}" opacity="0" bgcolor="#FFFFFF" multiline="true">
<font color="#333333">
<b>Copyright ???. All Rights Reserved.</b>
</font>
</text>
-->
</view>
 
<!-- FOOTER -->
<view id="footer" x="0" y="${canvas.height-20}" width="100%" height="25" bgcolor="#999999" opacity="0">
<view y="1" width="100%" height="24" bgcolor="#CCCCCC" align="center" valign="middle">
<text x="5" y="3" width="400" font="san" fontsize="11" clip="false" fgcolor="#003399"
text="Powered by AgileGallery. Copyright 2006. All Rights Reserved."
onclick="parent.parent.parent.aboutagilegallery()" />
</view>
</view>
</class>
 
    <!-- THUMBNAIL CLASS -->
<class name="thumbs" extends="basestuff">
<attribute name="activeImg" value="" type="string"/>
<handler name="oninit">
setAttribute('opacity', .6);
</handler>
<handler name="ondata" args="d">
var url = baseURL + datapath.p.getAttr('thumbnail');
this.setSource(url);
this.setAttribute('id', datapath.p.getAttr("photo"));
</handler>
<method event="onclick">
showImagePre();
var url = baseURL + datapath.p.getAttr("photo");
fullsized.setAttribute('src', url);
caption.setText(datapath.getNodeText());
showImagePost();
this.setAttribute('activeImg', datapath.p.getAttr("photo"));
pager.setFromPointer(datapath);
buttonPrev.animate('opacity', 1, 300);
</method>
<method event="onmouseover">
 
animate('opacity', 1, 300, false);
</method>
<method event="onmouseout">
if(this.activeImg != datapath.p.getAttr("photo")) animate('opacity', .7, 300, false);
</method>
</class>
 
  <agilegallery width="100%" height="100%" datapath="picasaImages:/gallery/images/img[1]" />
 
  <!-- VIEW Initial Photo -->
<view>
<datapointer xpath="picasaImages:/gallery" ondata="processData()">
<method name="processData">
var URL = this.xpathQuery('url/text()');
this.setXPath("images/img[1]");
var PHOTO = this.p.getAttr("photo");
var CAPTION = this.getNodeText();
fullsized.setAttribute('src', URL + PHOTO);
caption.setText(CAPTION);
fullsized.animate('opacity', 1, 600, false);
captionborder.animate('opacity', .4, 600, false);
caption.animate('opacity', 1, 500, false);
</method>
</datapointer>
</view>
</canvas>