home *** CD-ROM | disk | FTP | other *** search
/ Kompuutteri Kaikille K-CD 2003 #3 / K-CD_2003-03.iso / Explorer6 / DA / IEW2K_2.CAB / mshtmler.dll / HTML / INSIMAGE.DLG < prev    next >
Text File  |  2002-09-10  |  12KB  |  378 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
  2. <HTML id=dlgImage STYLE="font-family: MS Shell Dlg; font-size: 8pt;
  3. width: 40.1em; height: 18em">
  4. <HEAD>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <meta http-equiv="MSThemeCompatible" content="Yes">
  7. <TITLE>
  8. Billede
  9. </TITLE>
  10. <SCRIPT defer>
  11. function callHelp(elm)
  12. {
  13. if (null != elm.helpid)
  14. {
  15. window.showHelp(elm.helpfile, "" + parseInt(elm.helpid),
  16. "popup");
  17. }
  18. else
  19. {
  20. if ("BODY" != elm.tagName)
  21. {
  22. callHelp(elm.parentElement);
  23. }
  24. }
  25. }
  26. function btnCancelClick()
  27. {
  28. window.close();
  29. }
  30. function getTextRange(elm)
  31. {
  32. var r = elm.parentTextEdit.createTextRange();
  33. r.moveToElementText(elm);
  34. return r;
  35. }
  36. function mouseClick()
  37. {
  38. if (window.event.srcElement.id.substring(0,3)
  39. == "txt")
  40. {
  41. return;
  42. }
  43. if (window.event.button == 2)
  44. {
  45. callHelp(window.event.srcElement);
  46. }
  47. }
  48. function txtDefaultESC()
  49. {
  50. if (event.keyCode == 27)
  51. {
  52. window.close();
  53. return;
  54. }
  55. }
  56. window.onerror = HandleError
  57. var L_Dialog_ErrorMessage = "Der opstod en fejl i denne dialogboks.";
  58. var L_ErrorNumber_Text = "Fejl: ";
  59. function HandleError(message, url, line)
  60. {
  61. var str = L_Dialog_ErrorMessage + "\n\n"
  62. + L_ErrorNumber_Text + line + "\n"
  63. + message;
  64. alert (str);
  65. window.close();
  66. return true;
  67. }
  68. 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;
  69. function btnBrowseClick()
  70. {
  71. var L_Picture_DIALOG_Title_DialogTitle = "Billede";
  72. var L_Picture_DIALOG_FileTypes_Text = "GIF og JPEG (*.gif, *.jpg)|*.gif;*.jpg|Bitmap (*.bmp)|*.bmp|Windows-metafil (*.wmf)|*.wmf|XBM (*.xbm)|*.xbm|ART (*.art)|*.art|Alle filer (*.*)|*.*|";
  73. var strFileName;
  74. strFileName = dialogHelper.openfiledlg("", "",
  75. L_Picture_DIALOG_FileTypes_Text,L_Picture_DIALOG_Title_DialogTitle);
  76. if ("" != strFileName)
  77. {
  78. txtFileName.value = strFileName;
  79. }
  80. setOKState(false);
  81. }
  82. function getProtocolFromURL(strURL)
  83. {
  84. var index;
  85. return strURL.substring(0, strURL.indexOf(":") + 1);
  86. }
  87. function bdyLoad()
  88. {
  89. var elmSelectedImage;
  90. var htmlSelectionControl = "Control";
  91. var globalDoc = window.dialogArguments;
  92. var grngMaster = globalDoc.selection.createRange();
  93. txtFileName.onfocus = new Function("txtFileName.select()");
  94. txtFileName.onkeypress = new Function("txtDefaultESC()");
  95. txtAltText.onfocus = new Function("txtAltText.select()");
  96. txtAltText.onkeypress = new Function("txtDefaultESC()");
  97. txtHorizontal.onfocus = new Function("txtHorizontal.select()");
  98. txtHorizontal.onkeypress = new Function("txtDefaultESC()");
  99. txtBorder.onfocus = new Function("txtBorder.select()");
  100. txtBorder.onkeypress = new Function("txtDefaultESC()");
  101. txtVertical.onfocus = new Function("txtVertical.select()");
  102. txtVertical.onkeypress = new Function("txtDefaultESC()");
  103. btnBrowse.onclick = new Function("btnBrowseClick()");
  104. btnOK.onclick = new Function("btnOKClick()");
  105. btnCancel.onclick = new Function("btnCancelClick()");
  106. document.onhelp = new Function("callHelp(window.event.srcElement)");
  107. document.onmouseup = new Function("mouseClick()");
  108. txtFileName.onpropertychange = new Function("setOKState(true)");
  109. txtFileName.fImageLoaded = false;
  110. txtFileName.intImageWidth = 0;
  111. txtFileName.intImageHeight = 0;
  112. if (globalDoc.selection.type == htmlSelectionControl)
  113. {
  114. if (grngMaster.length == 1)
  115. {
  116. elmSelectedImage = grngMaster.item(0);
  117. if (elmSelectedImage.tagName == "IMG")
  118. {
  119. txtFileName.fImageLoaded = true;
  120. if (elmSelectedImage.src)
  121. txtFileName.value = elmSelectedImage.src;
  122. txtFileName.intImageHeight = elmSelectedImage.height;
  123. txtFileName.intImageWidth = elmSelectedImage.width;
  124. txtVertical.value = elmSelectedImage.vspace;
  125. txtHorizontal.value = elmSelectedImage.hspace;
  126. txtBorder.value = elmSelectedImage.border;
  127. txtAltText.value = elmSelectedImage.alt;
  128. selAlignment.value = elmSelectedImage.align;
  129. }
  130. }
  131. }
  132. setOKState(false);
  133. txtFileName.focus();
  134. }
  135. function testTextValue(txtBox)
  136. {
  137. var val = parseInt(txtBox.value);
  138. if (isNaN(val) || val < 0 || val > 999)
  139. {
  140. return false;
  141. }
  142. return true;
  143. }
  144. function btnOKClick()
  145. {
  146. var elmImage;
  147. var intAlignment;
  148. var L_HorizontalNotNumber_ErrorMessage
  149. = "Den vandrette afstand skal angives som et tal mellem 0 og 999.";
  150. var L_VerticalNotNumber_ErrorMessage
  151. = "Den lodrette afstand skal angives som et tal mellem 0 og 999.";
  152. var L_BoderNotNumber_ErrorMessage
  153. = "Rammebredden skal angives som et tal mellem 0 og 999.";
  154. var cmdInsertImage = "InsertImage";
  155. var cmdDelete = "Delete";
  156. var htmlSelectionControl = "Control";
  157. var globalDoc = window.dialogArguments;
  158. var grngMaster = globalDoc.selection.createRange();
  159. if ("" != txtHorizontal.value)
  160. {
  161. if (!testTextValue(txtHorizontal))
  162. {
  163. alert(L_HorizontalNotNumber_ErrorMessage);
  164. txtHorizontal.focus();
  165. return;
  166. }
  167. }
  168. if ("" != txtBorder.value)
  169. {
  170. if (!testTextValue(txtBorder))
  171. {
  172. alert(L_BoderNotNumber_ErrorMessage);
  173. txtBorder.focus();
  174. return;
  175. }
  176. }
  177. if ("" != txtVertical.value)
  178. {
  179. if (!testTextValue(txtVertical))
  180. {
  181. alert(L_VerticalNotNumber_ErrorMessage);
  182. txtVertical.focus();
  183. return;
  184. }
  185. }
  186. if (globalDoc.selection.type == htmlSelectionControl
  187. && !txtFileName.fImageLoaded)
  188. {
  189. grngMaster.execCommand(cmdDelete);
  190. grngMaster = globalDoc.selection.createRange();
  191. }
  192. idstr = "\" id=\"c2eec6217e1a474eb649bfedd577334a";
  193. if (!txtFileName.fImageLoaded)
  194. {
  195. grngMaster.execCommand(cmdInsertImage, false, idstr);
  196. elmImage = globalDoc.all.c2eec6217e1a474eb649bfedd577334a;
  197. elmImage.removeAttribute("id");
  198. elmImage.removeAttribute("src");
  199. grngMaster.moveStart("character", -1);
  200. }
  201. else
  202. {
  203. elmImage = grngMaster.item(0);
  204. if (elmImage.src != txtFileName.value)
  205. {
  206. grngMaster.execCommand(cmdDelete);
  207. grngMaster = globalDoc.selection.createRange();
  208. grngMaster.execCommand(cmdInsertImage, false, idstr);
  209. elmImage = globalDoc.all.c2eec6217e1a474eb649bfedd577334a;
  210. elmImage.removeAttribute("id");
  211. elmImage.removeAttribute("src");
  212. grngMaster.moveStart("character", -1);
  213. txtFileName.fImageLoaded = false;
  214. }
  215. grngMaster = getTextRange(elmImage);
  216. }
  217. if (txtFileName.fImageLoaded)
  218. {
  219. elmImage.style.width = txtFileName.intImageWidth;
  220. elmImage.style.height = txtFileName.intImageHeight;
  221. }
  222. if (txtFileName.value.length > 2040)
  223. txtFileName.value = txtFileName.value.substring(0,2040);
  224. if ("" == getProtocolFromURL(txtFileName.value))
  225. {
  226. elmImage.src = "file://" + txtFileName.value;
  227. }
  228. else
  229. {
  230. elmImage.src = txtFileName.value;
  231. }
  232. if (txtHorizontal.value != "")
  233. {
  234. elmImage.hspace = parseInt(txtHorizontal.value);
  235. }
  236. else
  237. {
  238. elmImage.hspace = 0;
  239. }
  240. if (txtVertical.value != "")
  241. {
  242. elmImage.vspace = parseInt(txtVertical.value);
  243. }
  244. else
  245. {
  246. elmImage.vspace = 0;
  247. }
  248. elmImage.alt = txtAltText.value;
  249. if (txtBorder.value != "")
  250. {
  251. elmImage.border = parseInt(txtBorder.value);
  252. }
  253. else
  254. {
  255. elmImage.border = 0;
  256. }
  257. elmImage.align = selAlignment.value;
  258. grngMaster.collapse(false);
  259. grngMaster.select();
  260. window.close();
  261. }
  262. </SCRIPT>
  263. </HEAD>
  264. <BODY id=bdy onload="bdyLoad()" style="font-family: MS Shell Dlg;
  265. font-size: 8pt; background: threedface; color: windowtext;" scroll=no>
  266. <OBJECT ID="dialogHelper" CLASSID="CLSID:3050f4e1-98b5-11cf-bb82-00aa00bdce0b"
  267. HEIGHT=0 WIDTH=0 tabindex=-1>
  268. </OBJECT>
  269. <DIV id=divFileName style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
  270. left: 0.98em; top: 1.2168em; width: 7em; height: 1.2168em; ">
  271. <LABEL id=lblFileName FOR=txtFileName tabIndex=-1
  272. helpid="35450" helpfile=msoe.hlp>
  273. Billed<U>k</U>ilde:
  274. </LABEL>
  275. </DIV>
  276. <INPUT ID=txtFileName type=text style="font-family: MS Shell Dlg; font-size: 8pt;
  277. position: absolute; left: 8.54em; top: 1.0647em; width: 13.58em;
  278. height: 2.1294em; " tabIndex=10 ACCESSKEY=k
  279. helpid="35450" helpfile=msoe.hlp>
  280. <DIV id=divAltText style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
  281. left: 0.98em; top: 4.1067em; width: 6.58em; height: 1.2168em; ">
  282. <LABEL id=lblAltText FOR=txtAltText tabIndex=-1
  283. helpid="35455" helpfile=msoe.hlp>
  284. Alternativ <u>t</u>ekst:
  285. </LABEL>
  286. </DIV>
  287. <INPUT type=text ID=txtAltText tabIndex=15 ACCESSKEY=t
  288. style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
  289. left: 8.54em; top: 3.8025em; width: 21.5em; height: 2.1294em; "
  290. helpid="35455" helpfile=msoe.hlp>
  291. <BUTTON ID=btnBrowse style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
  292. left: 22.96em; top: 1.0647em; width: 7em; height: 2.2em; "
  293. ACCESSKEY=g tabIndex=12 helpid="35462" helpfile=msoe.hlp>
  294. <U>G</U>ennemse...
  295. </BUTTON>
  296. <FIELDSET id=fldLayout style="font-family: MS Shell Dlg; font-size: 8pt;
  297. position: absolute; left: .9em; top: 7.1em; width: 17.08em;
  298. height: 7.6em;">
  299. <LEGEND id=lgdLayout>
  300. Layout
  301. </LEGEND>
  302. </FIELDSET>
  303. <FIELDSET id=fldSpacing style="font-family: MS Shell Dlg; font-size: 8pt;
  304. position: absolute; left: 18.9em; top: 7.1em; width: 11em;
  305. height: 7.6em;">
  306. <LEGEND id=lgdSpacing>
  307. Afstand
  308. </LEGEND>
  309. </FIELDSET>
  310. <DIV id=divAlign style="font-family: MS Shell Dlg; font-size: 8pt;
  311. position: absolute; left: 1.82em; top: 9.126em; width: 4.76em;
  312. height: 1.2168em; ">
  313. <LABEL id=lblAlignment FOR=selAlignment tabIndex=-1 helpid="35465"
  314. helpfile=msoe.hlp>
  315. <U>J</U>ustering:
  316. </LABEL>
  317. </DIV>
  318. <SELECT size=1 ID=selAlignment tabIndex=20 ACCESSKEY=j
  319. style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
  320. left: 10.36em; top: 8.8218em; width: 6.72em; height: 1.2168em; "
  321. helpid="35465" helpfile=msoe.hlp>
  322. <OPTION id=optNotSet value=""> Not set </OPTION>
  323. <OPTION id=optLeft value=left> Left </OPTION>
  324. <OPTION id=optRight value=right> Right </OPTION>
  325. <OPTION id=optTexttop value=textTop> Texttop </OPTION>
  326. <OPTION id=optAbsMiddle value=absMiddle> Absmiddle </OPTION>
  327. <OPTION id=optBaseline value=baseline SELECTED> Grundlinje </OPTION>
  328. <OPTION id=optAbsBottom value=absBottom> Absolut bund </OPTION>
  329. <OPTION id=optBottom value=bottom> Bottom </OPTION>
  330. <OPTION id=optMiddle value=middle> Middle </OPTION>
  331. <OPTION id=optTop value=top> Top </OPTION>
  332. </SELECT>
  333. <DIV id=divHoriz style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
  334. left: 19.88em; top: 9.126em; width: 4.76em; height: 1.2168em; ">
  335. <LABEL id=lblHorizontal FOR=txtHorizontal tabIndex=-1 helpid="35475"
  336. helpfile=msoe.hlp>
  337. <U>V</U>andret:
  338. </LABEL>
  339. </DIV>
  340. <INPUT ID=txtHorizontal style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
  341. left: 24.92em; top: 8.8218em; width: 4.2em; height: 2.1294em; ime-mode: disabled;"
  342. type=text size=3 value="" tabIndex=25 ACCESSKEY=v
  343. helpid="35475" helpfile=msoe.hlp>
  344. <DIV id=divBorder style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
  345. left: 1.82em; top: 12.0159em; width: 8.12em; height: 1.2168em; ">
  346. <LABEL id=lblBorder tabIndex=-1 FOR=txtBorder helpid="35470"
  347. helpfile=msoe.hlp>
  348. <u>B</u>redde:
  349. </LABEL>
  350. </DIV>
  351. <INPUT ID=txtBorder style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
  352. left: 10.36em; top: 11.5596em; width: 6.72em; height: 2.1294em; ime-mode: disabled;"
  353. type=text size=3 value="" tabIndex=21 ACCESSKEY=b
  354. helpid="35470" helpfile=msoe.hlp>
  355. <DIV id=divVert style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
  356. left: 19.88em; top: 12.0159em; width: 3.64em; height: 1.2168em; ">
  357. <LABEL id=lblVertical FOR=txtVertical tabIndex=-1 helpid="35480"
  358. helpfile=msoe.hlp>
  359. <U>L</U>odret:
  360. </LABEL>
  361. </DIV>
  362. <INPUT ID=txtVertical style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
  363. left: 24.92em; top: 11.5596em; width: 4.2em; height: 2.1294em; ime-mode: disabled;"
  364. type=text size=3 value="" tabIndex=30 ACCESSKEY=l
  365. helpid="35480" helpfile=msoe.hlp>
  366. <BUTTON ID=btnOK style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
  367. left: 31.36em; top: 1.0647em; width: 7em; height: 2.2em; " type=submit
  368. tabIndex=40 DISABLED=1 helpid="28443" helpfile="windows.hlp">
  369. OK
  370. </BUTTON>
  371. <BUTTON ID=btnCancel style="font-family: MS Shell Dlg; font-size: 8pt; position: absolute;
  372. left: 31.36em; top: 3.6504em; width: 7em; height: 2.2em; " type=reset
  373. tabIndex=45 helpid="28444" helpfile="windows.hlp">
  374. Annuller
  375. </BUTTON>
  376. </BODY>
  377. </HTML>
  378.