PageRenderTime 20ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 0ms app.codeStats 0ms

/#/template/publish/photo.tpl

https://bitbucket.org/nemo_xiaolan/muyou
Smarty Template | 71 lines | 63 code | 8 blank | 0 comment | 2 complexity | 7a020d68a220bfc395ed5e80b5af02a6 MD5 | raw file
 1{%extends "publish/layout.tpl"%}
 2
 3{%block publisher_title%}发布照片{%/block%}
 4{%block publisher_subject%}
 5<div id="pb_photo_upload">
 6    <input type="file" id="uploadify" />
 7    <span id="spanButtonPlaceholder"></span>
 8    <div id="divFileProgressContainer"></div>
 9    <div id="pb_photo_thumbs"></div>
10</div>
11{%/block%}
12{%block publisher_editor_name%}描述{%/block%}
13
14{%block extra_style append%}
15    <link href="_/vendor/jquery/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
16{%/block%}
17
18{%block extra_js_quote append%}
19<script type="text/javascript" src="_/vendor/jquery/uploadify/jquery.uploadify.js"></script>
20{%/block%}
21
22{%block extra_jquery append%}
23    var thumb_box = $("#thumbnails");
24    var boxes = [];
25    $('#uploadify').uploadify({
26        swf  : '_/vendor/jquery/uploadify/uploadify.swf',
27        uploader : BASE_URL+'{%'publish/ajax_photo'|u%}?UPLOAD_HASH={%$session_id%}',
28        buttonClass: "ui-button-placeholder ui-button-blue",
29        buttonText: '选择图片',
30        fileTypeDesc    : '图片文件',
31        fileTypeExts    : '*.jpg;*.jpeg;*.gif;*.png',
32        multi : true,
33        auto: true,
34        checkExisting: false,
35        buttonImage: '',
36        removeCompleted : true,
37        sizeLimit   : 409600,
38        removeTimeout: 2,
39        queueSizeLimit: 10,
40        cancelImage: '_/vendor/jquery/uploadify/images/uploadify-cancel.png',
41        onUploadSuccess : function(event, response, status){
42            console.debug(response);
43            var img = '_/vendor/jquery/uploadify/images/';
44            response = $.parseJSON(response);
45            if(response.error) {
46                img = img+'error.gif';
47            } else {
48                img = response.thumb;
49            }
50            
51            $('#pb_photo_thumbs').append($('<img />').attr('src', img));
52        },
53
54        onQueueComplete: function (status) {
55            var the_boxes = $(boxes);
56            //thumb_box.append(the_boxes).masonry('appended', the_boxes );
57            //$(".the_img input[type='radio']:first").attr("checked", "checked");
58            boxes = [];
59
60            $("#submit_photos").show().click(function(){
61                thumb_box.submit();
62            });
63        }
64    });
65{%/block%}
66
67{%block before_body_end%}
68<script type="text/javascript">
69function save_photos() {}
70</script>
71{%/block%}