display.html 1.1 KB

123456789101112131415161718192021222324252627
  1. {template 'common/header'}
  2. {if $do == 'system'}
  3. <div style="z-index: 1;" class="iframe-div">
  4. <iframe src="//s.w7.cc/index.php?c=wiki&a=view&id=2&list=29&simple=1{if $_W['isfounder'] && !user_is_vice_founder()}&role=admin{/if}" marginheight="0" marginwidth="0" frameborder="0" width="100%" height="100%" allowTransparency="true"></iframe>
  5. </div>
  6. {/if}
  7. {if $do == 'custom'}
  8. <div style="z-index: 1;" class="iframe-div">
  9. {if !empty($wiki_id)}
  10. <iframe src="//s.w7.cc/index.php?c=wiki&a=view&id={$wiki_id}&simple=1" marginheight="0" marginwidth="0" frameborder="0" width="100%" height="100%" allowTransparency="true"></iframe>
  11. {else}
  12. <div class="we7-margin-vertical text-center font-lg">暂无内容</div>
  13. {/if}
  14. </div>
  15. {/if}
  16. <script>
  17. var targetOrigin = "{php echo $_W['sitescheme']}" + 's.w7.cc';
  18. function _mainFrame() {
  19. window.frames[0].postMessage('getHeight', targetOrigin);
  20. }
  21. window.addEventListener('message',function(e) {
  22. var canvasHeight = e.data;
  23. $('.iframe-div').css({'height': canvasHeight + 'px', 'overflow': 'hidden'});
  24. })
  25. window.setInterval("_mainFrame()", 100);
  26. </script>
  27. {template 'common/footer'}