content.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. /*
  2. [DESTOON B2B System] Copyright (c) 2008-2018 www.destoon.com
  3. This is NOT a freeware, use is subject to license.txt
  4. */
  5. function fontZoom(z, i) {
  6. var i = i ? i : 'content';
  7. var size = $('#'+i).css('font-size');
  8. var new_size = Number(size.replace('px', ''));
  9. new_size += z == '+' ? 1 : -1;
  10. if(new_size < 12) new_size = 12;
  11. $('#'+i).css('font-size', new_size+'px');
  12. $('#'+i+' *').css('font-size', new_size+'px');
  13. }
  14. $(function(){
  15. $(content_id ? '#'+content_id+' img' : 'img').each(function(i){
  16. var m = img_max_width ? img_max_width : 550;
  17. var w = $(this).width();
  18. if(w >= m) {
  19. $(this).css({'width':m+'px','height':parseInt($(this).height()*m/w)+'px'});
  20. $(this).attr('title', L['click_open']);
  21. $(this).click(function(){window.open(DTPath+'api/view.php?img='+$(this).attr('src'));});
  22. } else if(w == 0) {
  23. //$(this).css({'display':'none'});
  24. }
  25. });
  26. if(CKDomain) {
  27. $('#'+(content_id ? content_id : 'content')+' a').each(function(i){
  28. if($(this).attr('target') != '_blank') {if($(this).attr('href').indexOf(CKDomain) == -1) $(this).attr('target', '_blank');}
  29. });
  30. }
  31. });