Thumbnail.aspx
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:8k
源码类别:

OA系统

开发平台:

C#

  1. <%@ Page Language="C#" Inherits="CuteEditor.Dialogs.ThumbnailPage" %>
  2. <script runat="server">
  3. override protected void OnInit(EventArgs args)
  4. {
  5. if(Context.Request.QueryString["IsFrame"]==null)
  6. {
  7. string FrameSrc="Thumbnail.aspx?IsFrame=1&"+Request.ServerVariables["QUERY_STRING"];
  8. CuteEditor.CEU.WriteDialogOuterFrame(Context,"[[AutoThumbnail]]",FrameSrc);
  9. Context.Response.End();
  10. }
  11. base.OnInit(args);
  12. }
  13. </script>
  14. <html xmlns="http://www.w3.org/1999/xhtml">
  15. <head>
  16. <title>[[AutoThumbnail]] 
  17. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  18. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  19. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  20. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  21. </title>
  22. <meta http-equiv="Page-Enter" content="blendTrans(Duration=0.1)" />
  23. <meta http-equiv="Page-Exit" content="blendTrans(Duration=0.1)" />
  24. <link href="Load.ashx?type=style&file=dialog.css" type="text/css" rel="stylesheet" />
  25. <script type="text/javascript" src="Load.ashx?type=dialogscript&file=DialogHead.js"></script>
  26. </head>
  27. <body style="margin:0px;border-width:0px;padding:4px;">
  28. <form runat="server" id="Form1">
  29. <input type="hidden" runat="server" id="hiddenDirectory" name="hiddenDirectory" /> 
  30. <input type="hidden" runat="server" id="hiddenFile" name="hiddenFile" />
  31. <input type="hidden" runat="server" enableviewstate="false" id="hiddenAlert" name="hiddenAlert" /> 
  32. <input type="hidden" runat="server" enableviewstate="false" id="hiddenAction" name="hiddenAction" />
  33. <table border="0" cellpadding="4" cellspacing="0" width="100%">
  34. <tr>
  35. <td>
  36. <table border="0" cellpadding="1" cellspacing="4" class="normal">
  37. <tr>
  38. <td style="white-space:nowrap"  valign="top">
  39. <fieldset style="height:80px;">
  40. <table border="0" cellpadding="1" cellspacing="0" class="normal">
  41. <tr>
  42. <td style="white-space:nowrap; width:60" >[[Width]]:</td>
  43. <td>
  44. <input runat="server" id="inp_width" value="80" maxlength="3" onkeyup="checkConstrains('width');"  onkeypress="return CancelEventIfNotDigit()" style="WIDTH : 70px" name="inp_width" />
  45. </td>
  46. <td rowspan="2" align="right" valign="middle"><img src="Load.ashx?type=image&file=locked.gif" id="imgLock" width="25" height="32" alt="[[ConstrainProportions]]" /></td>
  47. </tr>
  48. <tr>
  49. <td>[[Height]]:</td>
  50. <td>
  51. <input runat="server" id="inp_height" value="80" maxlength="3" onkeyup="checkConstrains('height');"  onkeypress="return CancelEventIfNotDigit()" style="WIDTH : 70px" name="inp_height" />
  52. </td>
  53. </tr>
  54. <tr>
  55. <td colspan="2">
  56. <input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains();" />
  57. Constrain Proportions</td>
  58. </tr>
  59. </table>
  60. </fieldset>
  61. </td>
  62. <td valign="top" style="white-space:nowrap" >
  63. <div style="width:100px; height:80px; vertical-align:top;overflow:hidden;BACKGROUND-COLOR: #ffffff;BORDER-RIGHT: buttonhighlight 1px solid;BORDER-TOP: buttonshadow 1px solid;BORDER-LEFT: buttonshadow 1px solid;BORDER-BOTTOM: buttonhighlight 1px solid;">
  64. <img alt="" id="img_demo" src="Load.ashx?type=image&file=1x1.gif" />
  65. </div>
  66. </td>
  67. </tr>
  68. <tr>
  69. <td>
  70. <div style="margin-top:8px;text-align:center">
  71. <asp:Button id="okButton" Text="  [[OK]]  " Runat="server" OnClick="thumbnailButton_Click" />
  72. &nbsp;&nbsp;
  73. <input type="button" value="[[Cancel]]" onclick="top.returnValue=false;top.close()" />
  74. </div>
  75. </td>
  76. </tr>
  77. </table>
  78. </td>
  79. </tr>
  80. </table>
  81. </form>
  82. </body>
  83. </html>
  84. <script type="text/javascript">
  85. var OxO3e6f=["src","img_demo","inp_width","inp_height","hiddenFile","hiddenAlert","hiddenDirectory","hiddenAction","onload","value","","width","height","[[ImagetooSmall]]","dir","imgLock","constrain_prop","checked","Load.ashx?type=imagex26file=locked.gif","Load.ashx?type=imagex26file=1x1.gif","preview_image","DIV","cssText","style","position:absolute","body","offsetWidth","offsetHeight","length"];var obj=Window_GetDialogArguments(window);var src=obj[OxO3e6f[0x0]];var img_demo=document.getElementById(OxO3e6f[0x1]);var inp_width=document.getElementById(OxO3e6f[0x2]);var inp_height=document.getElementById(OxO3e6f[0x3]);var hiddenFile=Window_GetElement(window,OxO3e6f[0x4],true);var hiddenAlert=Window_GetElement(window,OxO3e6f[0x5],true);var hiddenDirectory=Window_GetElement(window,OxO3e6f[0x6],true);var hiddenAction=Window_GetElement(window,OxO3e6f[0x7],true);var defaultwidth=<%= secset.ThumbnailWidth %>;var defaultheight=<%= secset.ThumbnailHeight %>; window[OxO3e6f[0x8]]=reset_hiddens ; function reset_hiddens(){if(hiddenAction[OxO3e6f[0x9]]!=OxO3e6f[0xa]){if(hiddenAlert[OxO3e6f[0x9]]){ alert(hiddenAlert.value) ;} ; Window_SetDialogReturnValue(window,hiddenAction.value) ; Window_CloseDialog(window) ;} else { hiddenAlert[OxO3e6f[0x9]]=OxO3e6f[0xa] ; hiddenAction[OxO3e6f[0x9]]=OxO3e6f[0xa] ;} ;}  ; SyncToView() ; function SyncToView(){if(src){var img= new Image(); img[OxO3e6f[0x0]]=src ; img_demo[OxO3e6f[0x0]]=src ;var p1=parseInt(img[OxO3e6f[0xb]]/defaultwidth);var Oxd3=parseInt(img[OxO3e6f[0xc]]/defaultheight);if(p1>Oxd3){if(img[OxO3e6f[0xb]]<defaultwidth){ alert(OxO3e6f[0xd]) ; inp_width[OxO3e6f[0x9]]=img[OxO3e6f[0xb]] ; inp_height[OxO3e6f[0x9]]=img[OxO3e6f[0xc]] ;} else { inp_width[OxO3e6f[0x9]]=defaultwidth ;var Oxd4=parseInt(defaultwidth*img[OxO3e6f[0xc]]/img.width); inp_height[OxO3e6f[0x9]]=Oxd4 ;} ;} else {if(img[OxO3e6f[0xc]]<defaultheight){ alert(OxO3e6f[0xd]) ; inp_width[OxO3e6f[0x9]]=img[OxO3e6f[0xb]] ; inp_height[OxO3e6f[0x9]]=img[OxO3e6f[0xc]] ;} else { inp_height[OxO3e6f[0x9]]=defaultheight ;var Oxd5=parseInt(defaultwidth*img[OxO3e6f[0xb]]/img.height); inp_width[OxO3e6f[0x9]]=Oxd5 ;} ;} ; hiddenFile[OxO3e6f[0x9]]=src ; hiddenDirectory[OxO3e6f[0x9]]=obj[OxO3e6f[0xe]] ; do_preview() ;} ;}  ; function toggleConstrains(){var Oxd7=document.getElementById(OxO3e6f[0xf]);var Oxd8=document.getElementById(OxO3e6f[0x10]);if(Oxd8[OxO3e6f[0x11]]){ Oxd7[OxO3e6f[0x0]]=OxO3e6f[0x12] ; checkConstrains(OxO3e6f[0xb]) ;} else { Oxd7[OxO3e6f[0x0]]=OxO3e6f[0x13] ;} ;}  ;var checkingConstrains=false; function checkConstrains(Oxdb){if(checkingConstrains){return ;} ; checkingConstrains=true ;try{var Oxd8=document.getElementById(OxO3e6f[0x10]);if(Oxd8[OxO3e6f[0x11]]){var Oxdc=document.getElementById(OxO3e6f[0x14]);if(Oxdc){var Oxdd=document.createElement(OxO3e6f[0x15]); Oxdd[OxO3e6f[0x17]][OxO3e6f[0x16]]=OxO3e6f[0x18] ; document[OxO3e6f[0x19]].appendChild(Oxdd) ; Oxdd.appendChild(Oxdc) ; Oxdc.removeAttribute(OxO3e6f[0xb]) ; Oxdc.removeAttribute(OxO3e6f[0xc]) ; Oxdc[OxO3e6f[0x17]][OxO3e6f[0xb]]=OxO3e6f[0xa] ; Oxdc[OxO3e6f[0x17]][OxO3e6f[0xc]]=OxO3e6f[0xa] ; original_width=Oxdc[OxO3e6f[0x1a]] ; original_height=Oxdc[OxO3e6f[0x1b]] ; Oxdd.removeNode(true) ;} else {var Oxde= new Image(); Oxde[OxO3e6f[0x0]]=src ; original_width=Oxde[OxO3e6f[0xb]] ; original_height=Oxde[OxO3e6f[0xc]] ;} ;if((original_width>0x0)&&(original_height>0x0)){ width=inp_width[OxO3e6f[0x9]] ; height=inp_height[OxO3e6f[0x9]] ;if(Oxdb==OxO3e6f[0xb]){if(width[OxO3e6f[0x1c]]==0x0||isNaN(width)){ inp_width[OxO3e6f[0x9]]=OxO3e6f[0xa] ; inp_height[OxO3e6f[0x9]]=OxO3e6f[0xa] ;} else { height=parseInt(width*original_height/original_width) ; inp_height[OxO3e6f[0x9]]=height ;} ;} ;if(Oxdb==OxO3e6f[0xc]){if(height[OxO3e6f[0x1c]]==0x0||isNaN(height)){ inp_width[OxO3e6f[0x9]]=OxO3e6f[0xa] ; inp_height[OxO3e6f[0x9]]=OxO3e6f[0xa] ;} else { width=parseInt(height*original_width/original_height) ; inp_width[OxO3e6f[0x9]]=width ;} ;} ;} ;} ; do_preview() ;} finally{ checkingConstrains=false ;} ;}  ; function do_preview(){ img_demo[OxO3e6f[0xb]]=inp_width[OxO3e6f[0x9]] ; img_demo[OxO3e6f[0xc]]=inp_height[OxO3e6f[0x9]] ;}  ;
  86. </script>