admin_common.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. function confirmurl(url,message) {
  2. url = url+'&pc_hash='+pc_hash;
  3. if(confirm(message)) redirect(url);
  4. }
  5. function redirect(url) {
  6. location.href = url;
  7. }
  8. //滚动条
  9. $(function(){
  10. $(":text").addClass('input-text');
  11. })
  12. /**
  13. * 全选checkbox,注意:标识checkbox id固定为为check_box
  14. * @param string name 列表check名称,如 uid[]
  15. */
  16. function selectall(name) {
  17. if ($("#check_box").attr("checked")=='checked') {
  18. $("input[name='"+name+"']").each(function() {
  19. $(this).attr("checked","checked");
  20. });
  21. } else {
  22. $("input[name='"+name+"']").each(function() {
  23. $(this).removeAttr("checked");
  24. });
  25. }
  26. }
  27. function openwinx(url,name,w,h) {
  28. if(!w) w=screen.width-4;
  29. if(!h) h=screen.height-95;
  30. url = url+'&pc_hash='+pc_hash;
  31. window.open(url,name,"top=100,left=400,width=" + w + ",height=" + h + ",toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no");
  32. }
  33. //弹出对话框
  34. function omnipotent(id,linkurl,title,close_type,w,h) {
  35. if(!w) w=700;
  36. if(!h) h=500;
  37. art.dialog({id:id,iframe:linkurl, title:title, width:w, height:h, lock:true},
  38. function(){
  39. if(close_type==1) {
  40. art.dialog({id:id}).close()
  41. } else {
  42. var d = art.dialog({id:id}).data.iframe;
  43. var form = d.document.getElementById('dosubmit');form.click();
  44. }
  45. return false;
  46. },
  47. function(){
  48. art.dialog({id:id}).close()
  49. });void(0);
  50. }