Beispiel #1
0
def collectionWithPreview(htmlGen, fullPath):
    #htmlGen.write('<div style="white-space:nowrap">')
    htmlGen.write('<div style="max-width:40;float:right;max-height:100px;overflow-y:scroll;min-width:300px"><div id="log"></div></div>')
    htmlGen.write('<div id="collectionListContainer" style="max-height:100%%;float:left;overflow-y:scroll;min-width:200px;" border="1px">')
    htmlGen.write('<div id="collectionListInnerContainer">')
    i = cachedPicIter(fullPath, 0)
    collectionV3.showCollection(htmlGen, i, 0,1, nextPageUrl = "collectionWithPreview.py?path=%s&page="%fullPath.replace('\\','\\\\'))
    if True:
        h.write('''
            <script type="text/javascript">
                $(function() {
                    $("img").livequery(
                        function(){
                            $(this).lazyload({ 
                                failurelimit : 100,
                                effect : "fadeIn",
                                container:$("#collectionListContainer")
                            });
                        }
                    );

                    $(".thumbImage").livequery(
                        function(){
                            $(this).mouseover(function(){
                                    alert('in thumbImageLiveQuery');
                                    $("#previewImage").attr("src", "picList.py?path="+$(this).attr("path"));
                                }
                            );
                        }
                    );
                    $("#previewImage").attr("width",$(window).width());
                    $("#collectionListContainer").scroll(function(){
                        //alert("scrolling");
                        //$("#log").text($("#log").text()+$("#collectionListContainer").scrollTop()+",");
                        //$("#log").text($("#log").text()+$("#collectionListInnerContainer").height()+",");
                        //$("#log").text($("#log").text()+$("#collectionListContainer").height()+"-");
                        if  ($("#collectionListContainer").scrollTop() == $("#collectionListInnerContainer").height() - $("#collectionListContainer").height()){
                            //alert("loading");
                            //$("#log").text($("#log").text()+"loading--");
                            //$("#log").text($("#log").text()+$("#collectionListContainer").scrollTop()+",");
                            //$("#log").text($("#log").text()+$("#collectionListInnerContainer").height()+",");
                            //$("#log").text($("#log").text()+$("#collectionListContainer").height()+"-");
                            lastPostFunc();
                        }
                    });
                });


                $(function() {
                    }
                );
            </script>
        ''')
    htmlGen.write('</div>')
    htmlGen.write('</div>')
    htmlGen.write('<div>')
    htmlGen.write('''
        <img id="previewImage" style="max-width:500px;"/>
    ''')
    htmlGen.write('</div>')
Beispiel #2
0
                $(function() {
                    }
                );
            </script>
        ''')
    htmlGen.write('</div>')
    htmlGen.write('</div>')
    htmlGen.write('<div>')
    htmlGen.write('''
        <img id="previewImage" style="max-width:500px;"/>
    ''')
    htmlGen.write('</div>')

if __name__=='__main__':
    fields = libs.http.queryParam.queryInfo().getAllFieldStorage()
    path = fields["path"][0]    
    page = int(fields.get("page",[0])[0])
    thumbPerLine = int(fields.get("thumbPerLine", [5])[0])
    #print 'calling album'
    #i = albumIterator(path)
    #print 'after calling'
    h = libs.html.response.html()
    h.genHead('Collections')
    h.write('<link rel="stylesheet" type="text/css" href="/webapproot/static/css/class.css" />')
    if page == 0:
        collectionWithPreview(h, path)
    else:
        i = cachedPicIter(path, page)
        collectionV3.showCollection(h, i, page,1, nextPageUrl = "collectionWithPreview.py?path=%s&page="%path.replace('\\','\\\\'))
    h.genEnd()