def collectionWithPreview(htmlGen, fullPath, page): #htmlGen.write('<div style="white-space:nowrap">') h=htmlGen i = collectionIterator.cachedPicIter(fullPath, 0) h.write('<div style="float:left;min-width:25%">') collectionV4.showCollection(htmlGen, i, fullPath, page) h.write('</div>') if True: h.write(''' <script type="text/javascript"> $(function() { $("img").livequery( function(){ $(this).lazyload({ failurelimit : 100, effect : "fadeIn", container:$("#collectionList") }); } ); $(".thumbImage").livequery( function(){ $(this).mouseover(function(){ //alert('in thumbImageLiveQuery'); $("#previewImage").attr("src", "picList.py?path="+$(this).attr("path")); } ); $(this).dblclick(function(){ $.get("execute.py?path=" + $(this).attr("path"),function(data){}); } ); } ); $("#previewImage").attr("width",$(window).width()); }); </script> ''') htmlGen.write('<div style="white-space:nowrap">') htmlGen.write(''' <img id="previewImage" style="max-width:500px;"/> ''') htmlGen.write('</div>')
res += '<img class="%s" src="%s%s" width="100px" height="100px" path="%s"/>' % ( imgClass, thumbViewScript, urllib.quote(thumbPath), urllib.quote(i), ) res += "</div>\n" return res def showCollectionPerPage(h, i, page, path): h.write("<div>") h.write(showThumbCollection(i)) # h.write('before gen end') h.write("</div>") if __name__ == "__main__": fields = libs.http.queryParam.queryInfo().getAllFieldStorage() path = fields["path"][0] path = transformDirToInternal(path) page = int(fields.get("page", [0])[0]) thumbPerLine = int(fields.get("thumbPerLine", [5])[0]) # print 'calling album' i = collectionIterator.cachedPicIter(path, page) # print 'after calling' h = libs.html.response.html() h.genHead("Collections") showCollection(h, i, page, path) h.genEnd()
h.write('</div>') class tmpLog: def __init__(self): self.s = '' def l(self, s): self.s += s if __name__=='__main__': fields = libs.http.queryParam.queryInfo().getAllFieldStorage() path = fields["path"][0] path = transformDirToInternal(path) h = libs.html.response.html() #h.write(path) page = fields.get("page",[None])[0] #h.write(str(page)) thumbPerLine = int(fields.get("thumbPerLine", [5])[0]) #h.write('calling album') if page is None: realPage = 0 else: page = int(page) realPage = page l = tmpLog() i = collectionIterator.cachedPicIter(path, realPage, l) #h.write('after calling') h.genHead('Collections') showCollection(h, i, path, page) #h.write(l.s) h.genEnd()