changeset 3987:561cd7560781

make moinmoin fckeditor plugin dialog select first text element on load
author Byeongweon [tasyblue@gmail.com]
date Tue, 29 Jul 2008 02:44:33 +0900
parents 79956dda436a
children be43e3973baa
files wiki/htdocs/applets/moinFCKplugins/moinattachment/fck_attachment.js wiki/htdocs/applets/moinFCKplugins/moinimage/fck_image.js wiki/htdocs/applets/moinFCKplugins/moinlink/fck_link.js
diffstat 3 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/wiki/htdocs/applets/moinFCKplugins/moinattachment/fck_attachment.js	Tue Jul 29 02:25:00 2008 +0900
+++ b/wiki/htdocs/applets/moinFCKplugins/moinattachment/fck_attachment.js	Tue Jul 29 02:44:33 2008 +0900
@@ -74,6 +74,9 @@
 
  // Activate the "OK" button.
  window.parent.SetOkButton(true);
+
+  // select first text input element of dialog for usability
+  SelectField('txtAttachmentname');
 }
 
 function LoadSelection()
--- a/wiki/htdocs/applets/moinFCKplugins/moinimage/fck_image.js	Tue Jul 29 02:25:00 2008 +0900
+++ b/wiki/htdocs/applets/moinFCKplugins/moinimage/fck_image.js	Tue Jul 29 02:44:33 2008 +0900
@@ -45,6 +45,9 @@
 
   // Activate the "OK" button.
   window.parent.SetOkButton( true ) ;
+
+  // select first text input element of dialog for usability
+  SelectField('txtUrl');
 }
 
 function LoadSelection()
--- a/wiki/htdocs/applets/moinFCKplugins/moinlink/fck_link.js	Tue Jul 29 02:25:00 2008 +0900
+++ b/wiki/htdocs/applets/moinFCKplugins/moinlink/fck_link.js	Tue Jul 29 02:44:33 2008 +0900
@@ -113,7 +113,7 @@
  oEditor.FCKLanguageManager.TranslatePage(document);
 
  // Load the selected link information (if any).
- LoadSelection();
+ var firstElement = LoadSelection();
 
  // Update the dialog box.
  SetLinkType(GetE('cmbLinkType').value);
@@ -123,11 +123,17 @@
 
  // Activate the "OK" button.
  window.parent.SetOkButton(true);
+
+ // select first text input element of dialog for usability
+ SelectField(firstElement);
 }
 
 function LoadSelection()
 {
- if (!oLink) return;
+ // variable for first element of dialog
+ var firstElement = 'txtPagename';
+
+ if (!oLink) return firstElement;
 
  var sType = 'url';
 
@@ -155,6 +161,7 @@
    sType = 'url';
    GetE('txtUrl').value = sUrl;
   }
+  firstElement  = 'txtUrl';
  }
  else if (oLink.getAttribute('class')=='interwiki' || 
           oLink.getAttribute('class')=='badinterwiki') 
@@ -162,6 +169,7 @@
   sType = 'interwiki';
   GetE('sctInterwiki').value = oLink.getAttribute('title');
   GetE('txtInterwikipagename').value = decodeUrl(sHRef);
+  firstElement = 'txtInterwikipagename';
  }
  else if (sHRef.StartsWith(FCKConfig['WikiBasePath']))
  {
@@ -171,6 +179,7 @@
   if (sHRef.StartsWith(FCKConfig['WikiPage']))
       sHRef = sHRef.Remove(0, FCKConfig['WikiPage'].length);
   GetE('txtPagename').value = decodeUrl(sHRef);
+  firstElement  = 'txtPagename';
  }
  else     // It is another type of link.
  {
@@ -178,10 +187,13 @@
 
   GetE('cmbLinkProtocol').value = '';
   GetE('txtUrl').value = sHRef;
+  firstElement  = 'txtUrl';
  }
 
  // Update the Link type combo.
  GetE('cmbLinkType').value = sType;
+
+ return firstElement;
 }
 
 //#### Link type selection.