home *** CD-ROM | disk | FTP | other *** search
/ Di Gi Charat Mail / disc2.iso / disc2 / ie5 / IE_S4.CAB / IE_4.CAB / MSHTMLER.DLL / HTML / INSIMAGE.DLG < prev    next >
Text File  |  1999-04-01  |  12KB  |  371 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
  2. <HTML id=dlgImage STYLE="font-family: MS UI Gothic; font-size: 9pt;
  3. width: 40.1em; height: 18em">
  4. <HEAD>
  5. <meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
  6. <TITLE>
  7. ëµæ£
  8. </TITLE>
  9. <SCRIPT defer>
  10. function callHelp(elm)
  11. {
  12. if (null != elm.helpid)
  13. {
  14.  window.showHelp(elm.helpfile, "" + parseInt(elm.helpid),
  15.   "popup");
  16. }
  17. else
  18. {
  19.  if ("BODY" != elm.tagName)
  20.  {
  21.   callHelp(elm.parentElement);
  22.  }
  23. }
  24. function btnCancelClick()
  25. {
  26. window.close();
  27. function getTextRange(elm)
  28. {
  29. var r = elm.parentTextEdit.createTextRange();
  30. r.moveToElementText(elm);
  31. return r;
  32. function mouseClick()
  33. {
  34. if (window.event.srcElement.id.substring(0,3)
  35.  == "txt")
  36. {
  37.  return;
  38. }
  39. if (window.event.button == 2)
  40. {
  41.  callHelp(window.event.srcElement);
  42. }
  43. function txtDefaultESC()
  44. {
  45. if (event.keyCode == 27)
  46. {
  47.  window.close();
  48.  return;
  49. }
  50. window.onerror = HandleError
  51. var L_Dialog_ErrorMessage = "é▒é╠â_âCâAâìâOé┼âGâëü[é¬ö¡É╢é╡é▄é╡é╜üB";
  52. var L_ErrorNumber_Text = "âGâëü[: ";
  53. function HandleError(message, url, line)
  54. {
  55. var str = L_Dialog_ErrorMessage + "\n\n" 
  56.  + L_ErrorNumber_Text + line + "\n"
  57.  + message;
  58. alert (str);
  59. window.close();
  60. return true;
  61. }
  62. function setOKState(fEvent) { if (fEvent && (event.propertyName != "value")) { return; } if (("" == txtFileName.value) == g_fOKEnabled) { btnOK.disabled = g_fOKEnabled; g_fOKEnabled = !g_fOKEnabled; } } var g_fOKEnabled = false;
  63. function btnBrowseClick()
  64. {
  65. var L_Picture_DIALOG_Title_DialogTitle = "ëµæ£";
  66. var L_Picture_DIALOG_FileTypes_Text = "GIF é¿éµé╤ JPEG (*.gif, *.jpg)|*.gif;*.jpg|ârâbâgâ}âbâv (*.bmp)|*.bmp|Windows âüâ^âtâ@âCâï (*.wmf)|*.wmf|XBM (*.xbm)|*.xbm|ART (*.art)|*.art|é╖é╫é─é╠âtâ@âCâï (*.*)|*.*|";
  67. var strFileName;
  68. strFileName = dialogHelper.openfiledlg("", "",
  69.  L_Picture_DIALOG_FileTypes_Text,L_Picture_DIALOG_Title_DialogTitle);
  70. if ("" != strFileName)
  71. {
  72.  txtFileName.value = strFileName;
  73. }
  74. setOKState(false);
  75. function getProtocolFromURL(strURL)
  76. {
  77. var index;
  78. return strURL.substring(0, strURL.indexOf(":") + 1);
  79. function bdyLoad()
  80. {
  81. var elmSelectedImage;  
  82. var htmlSelectionControl = "Control";
  83. var globalDoc = window.dialogArguments;
  84. var grngMaster = globalDoc.selection.createRange();
  85. txtFileName.onfocus = new Function("txtFileName.select()");
  86. txtFileName.onkeypress = new Function("txtDefaultESC()");
  87. txtAltText.onfocus = new Function("txtAltText.select()");
  88. txtAltText.onkeypress = new Function("txtDefaultESC()");
  89. txtHorizontal.onfocus = new Function("txtHorizontal.select()");
  90. txtHorizontal.onkeypress = new Function("txtDefaultESC()");
  91. txtBorder.onfocus = new Function("txtBorder.select()");
  92. txtBorder.onkeypress = new Function("txtDefaultESC()");
  93. txtVertical.onfocus = new Function("txtVertical.select()");
  94. txtVertical.onkeypress = new Function("txtDefaultESC()");
  95. btnBrowse.onclick = new Function("btnBrowseClick()");
  96. btnOK.onclick = new Function("btnOKClick()");
  97. btnCancel.onclick = new Function("btnCancelClick()");
  98. document.onhelp  = new Function("callHelp(window.event.srcElement)");
  99. document.onmouseup = new Function("mouseClick()");
  100. txtFileName.onpropertychange = new Function("setOKState(true)");
  101. txtFileName.fImageLoaded = false; 
  102. txtFileName.intImageWidth = 0; 
  103. txtFileName.intImageHeight = 0; 
  104. if (globalDoc.selection.type == htmlSelectionControl)  
  105. {
  106.  if (grngMaster.length == 1) 
  107.  {
  108.   elmSelectedImage = grngMaster.item(0);
  109.   if (elmSelectedImage.tagName == "IMG") 
  110.   {
  111.    txtFileName.fImageLoaded = true;
  112.    txtFileName.value = elmSelectedImage.src;
  113.    txtFileName.intImageHeight = elmSelectedImage.height;
  114.    txtFileName.intImageWidth = elmSelectedImage.width;
  115.    txtVertical.value = elmSelectedImage.vspace;
  116.    txtHorizontal.value = elmSelectedImage.hspace;
  117.    txtBorder.value = elmSelectedImage.border;
  118.    txtAltText.value = elmSelectedImage.alt;
  119.    selAlignment.value = elmSelectedImage.align;
  120.   }
  121.  }
  122. }
  123. setOKState(false);
  124. txtFileName.focus();
  125. function testTextValue(txtBox)
  126. {
  127. var val = parseInt(txtBox.value);
  128. if (isNaN(val) || val < 0 || val > 999)
  129. {
  130.  return false;
  131. }
  132. return true;
  133. function btnOKClick()
  134. {
  135. var elmImage;  
  136. var intAlignment; 
  137. var L_HorizontalNotNumber_ErrorMessage
  138.  = "ëíé╠è╘èué╔é═ 0 é⌐éτ 999 é╠ÉöÄÜé≡ôⁿù═é╡é─é¡é╛é│éóüB";
  139. var L_VerticalNotNumber_ErrorMessage
  140.  = "Åcé╠è╘èué╔é═ 0 é⌐éτ 999 é╠ÉöÄÜé≡ôⁿù═é╡é─é¡é╛é│éóüB";
  141. var L_BoderNotNumber_ErrorMessage
  142.  = "èOÿgé╠æ╛é│é╔é═ 0 é⌐éτ 999 é╠ÉöÄÜé≡ôⁿù═é╡é─é¡é╛é│éóüB";
  143. var cmdInsertImage = "InsertImage";
  144. var cmdDelete = "Delete";
  145. var htmlSelectionControl = "Control";
  146. var globalDoc = window.dialogArguments;
  147. var grngMaster = globalDoc.selection.createRange();
  148. if ("" != txtHorizontal.value)
  149. {
  150.  if (!testTextValue(txtHorizontal))
  151.  {
  152.   alert(L_HorizontalNotNumber_ErrorMessage);
  153.   txtHorizontal.focus();
  154.   return;
  155.  }
  156. }
  157. if ("" != txtBorder.value)
  158. {
  159.  if (!testTextValue(txtBorder))
  160.  {
  161.   alert(L_BoderNotNumber_ErrorMessage);
  162.   txtBorder.focus();
  163.   return;
  164.  }
  165. }
  166. if ("" != txtVertical.value)
  167. {
  168.  if (!testTextValue(txtVertical))
  169.  {
  170.   alert(L_VerticalNotNumber_ErrorMessage);
  171.   txtVertical.focus();
  172.   return;
  173.  }
  174. }
  175. if (globalDoc.selection.type == htmlSelectionControl
  176.  && !txtFileName.fImageLoaded)
  177. {
  178.  grngMaster.execCommand(cmdDelete);
  179.  grngMaster = globalDoc.selection.createRange();
  180. }
  181. if (!txtFileName.fImageLoaded)
  182. {
  183.  grngMaster.execCommand(cmdInsertImage);
  184.  grngMaster.moveStart("character", -1);
  185.  elmImage = grngMaster.parentElement();
  186. }
  187. else 
  188. {
  189.  elmImage = grngMaster.item(0);
  190.  if (elmImage.src != txtFileName.value)
  191.  {
  192.   grngMaster.execCommand(cmdDelete);
  193.   grngMaster = globalDoc.selection.createRange();
  194.   grngMaster.execCommand(cmdInsertImage);
  195.   grngMaster.moveStart("character", -1);
  196.   elmImage = grngMaster.parentElement();
  197.   txtFileName.fImageLoaded = false;
  198.  }
  199.  grngMaster = getTextRange(elmImage);
  200. }
  201. if (txtFileName.fImageLoaded)
  202. {
  203.  elmImage.style.width = txtFileName.intImageWidth;
  204.  elmImage.style.height = txtFileName.intImageHeight;
  205. }
  206. if (txtFileName.value.length > 2040)
  207.  txtFileName.value = txtFileName.value.substring(0,2040);
  208. if ("" == getProtocolFromURL(txtFileName.value))
  209. {
  210.  elmImage.src = "file://" + txtFileName.value;
  211. }
  212. else
  213. {
  214.  elmImage.src = txtFileName.value;
  215. }
  216. if (txtHorizontal.value != "")
  217. {
  218.  elmImage.hspace = parseInt(txtHorizontal.value);
  219. }
  220. else
  221. {
  222.  elmImage.hspace = 0;
  223. }
  224. if (txtVertical.value != "")
  225. {
  226.  elmImage.vspace = parseInt(txtVertical.value);
  227. }
  228. else
  229. {
  230.  elmImage.vspace = 0;
  231. }
  232. elmImage.alt = txtAltText.value;
  233. if (txtBorder.value != "")
  234. {
  235.  elmImage.border = parseInt(txtBorder.value);
  236. }
  237. else
  238. {
  239.  elmImage.border = 0;
  240. }
  241. elmImage.align = selAlignment.value;
  242. grngMaster.collapse(false); 
  243. grngMaster.select();
  244. window.close();
  245. </SCRIPT>
  246. </HEAD>
  247. <BODY id=bdy onload="bdyLoad()" style="font-family: MS UI Gothic; 
  248. font-size: 9pt; background: threedface; color: windowtext;" scroll=no>
  249. <OBJECT ID="dialogHelper" CLASSID="CLSID:3050f4e1-98b5-11cf-bb82-00aa00bdce0b"
  250.  HEIGHT=0 WIDTH=0 tabindex=-1>
  251. </OBJECT>
  252. <DIV id=divFileName style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
  253. left: 0.98em; top: 1.2168em; width: 7em; height: 1.2168em; ">
  254. <LABEL id=lblFileName FOR=txtFileName tabIndex=-1
  255. helpid="35450" helpfile=msoe.hlp>
  256. âtâ@âCâïû╝(<U>P</U>):
  257. </LABEL>
  258. </DIV>
  259. <INPUT ID=txtFileName type=text style="font-family: MS UI Gothic; font-size: 9pt;
  260. position: absolute; left: 8.54em; top: 1.0647em; width: 13.58em;
  261. height: 1.7em; " tabIndex=10 ACCESSKEY=p 
  262. helpid="35450" helpfile=msoe.hlp>
  263. <DIV id=divAltText style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
  264. left: 0.98em; top: 4.1067em; width: 7.5em; height: 1.2168em; ">
  265. <LABEL id=lblAltText FOR=txtAltText tabIndex=-1
  266. helpid="35455" helpfile=msoe.hlp>
  267. æπæ╓âeâLâXâg(<U>T</U>):
  268. </LABEL>
  269. </DIV>
  270. <INPUT type=text ID=txtAltText tabIndex=15 ACCESSKEY=t
  271. style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
  272. left: 8.54em; top: 3.8025em; width: 21.5em; height: 1.7em; "
  273. helpid="35455" helpfile=msoe.hlp>
  274. <BUTTON ID=btnBrowse style="font-family: MS UI Gothic; font-size: 9pt; po