changeset 3970:69c8c705bea1

fix javascript error on attachment modification. reformating javascript code
author Byeongweon [tasyblue@gmail.com]
date Sat, 05 Jul 2008 06:30:44 +0900
parents 1d0ed74ec4be
children cec23df5a1cf
files wiki/htdocs/applets/moinFCKplugins/moinattachment/fck_attachment.js
diffstat 1 files changed, 17 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/wiki/htdocs/applets/moinFCKplugins/moinattachment/fck_attachment.js	Sat Jul 05 06:26:29 2008 +0900
+++ b/wiki/htdocs/applets/moinFCKplugins/moinattachment/fck_attachment.js	Sat Jul 05 06:30:44 2008 +0900
@@ -78,21 +78,18 @@
 
 function LoadSelection()
 {
- if (!oLink) return;
+  if (!oLink) return;
 
- if (oLink.getAttribute('title') && 
-          oLink.getAttribute('title').startsWith('attachment:'))
- {
-  GetE('txtAttachmentname').value = decodeUrl(
-     oLink.getAttribute('title').Remove(0, 'attachment:'.length));
- }
-
+  if (oLink.getAttribute('title') && oLink.getAttribute('title').StartsWith('attachment:'))
+  {
+    GetE('txtAttachmentname').value = decodeUrl(oLink.getAttribute('title').Remove(0, 'attachment:'.length));
+  }
 }
 
 //#### Link type selection.
 function SetLinkType(linkType)
 {
- ShowE('divLinkTypeAttachment' , (linkType == 'attachment'));
+  ShowE('divLinkTypeAttachment' , (linkType == 'attachment'));
 }
 
 //#### Called when user selects Wikipage.
@@ -104,18 +101,18 @@
 //#### Called while the user types the URL.
 function OnUrlChange()
 {
- var sUrl = GetE('txtUrl').value;
- var sProtocol = oRegex.UrlOnChangeProtocol.exec(sUrl);
+  var sUrl = GetE('txtUrl').value;
+  var sProtocol = oRegex.UrlOnChangeProtocol.exec(sUrl);
 
- if (sProtocol)
- {
-  sUrl = sUrl.substr(sProtocol[0].length);
-  GetE('txtUrl').value = sUrl;
- }
- else if (oRegex.UrlOnChangeTestOther.test(sUrl))
- {
-  GetE('cmbLinkProtocol').value = '';
- }
+  if (sProtocol)
+  {
+    sUrl = sUrl.substr(sProtocol[0].length);
+    GetE('txtUrl').value = sUrl;
+  }
+  else if (oRegex.UrlOnChangeTestOther.test(sUrl))
+  {
+    GetE('cmbLinkProtocol').value = '';
+  }
 }
 
 //#### The OK button was hit.