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