changeset 3956:d7364eb0f4d8

add comment to fckeditor moinmoin select plugin.
author Byeongweon [tasyblue@gmail.com]
date Wed, 25 Jun 2008 16:24:29 +0900
parents 3e5a2c8b6b3d
children 579699ec0c23
files wiki/htdocs/applets/moinFCKplugins/restrict_actions/fckplugin.js wiki/htdocs/applets/moinFCKplugins/selection/fckplugin.js wiki/htdocs/applets/moinfckconfig.js
diffstat 3 files changed, 25 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/wiki/htdocs/applets/moinFCKplugins/restrict_actions/fckplugin.js	Sat Jun 21 21:09:23 2008 +0900
+++ b/wiki/htdocs/applets/moinFCKplugins/restrict_actions/fckplugin.js	Wed Jun 25 16:24:29 2008 +0900
@@ -134,10 +134,10 @@
 
 var StyleButtonCommand = function(stylename, unique)
 {
-  this.StylesLoader = new FCKStylesLoader() ; 
-  this.StylesLoader.Load( FCKConfig.StylesXmlPath ) ; 
-  this.style = this.StylesLoader.Styles[stylename];
-  this.unique = unique;
+ // this.StylesLoader = new FCKStylesLoader() ; 
+ // this.StylesLoader.Load( FCKConfig.StylesXmlPath ) ; 
+ // this.style = this.StylesLoader.Styles[stylename];
+ // this.unique = unique;
 }
 
 StyleButtonCommand.prototype = new FCKStyleCommand();
@@ -164,10 +164,11 @@
  * RestrictedStyleButtonCommand
  * ####################################################################
  */
-
+/*
 var RestrictedStyleButtonCommand = function(stylename, forbidden, unique)
 {
   this.style = this.StylesLoader.Styles[stylename];
+// this.style = stylename;
   this.forbidden = forbidden;
   this.unique = unique;
 }
@@ -186,7 +187,7 @@
     return FCK_TRISTATE_OFF;
   }
 }
-
+*/
 // ####################################################################
 
 var noformat = "H1|H2|H3|H4|H5|H6|PRE|A|TT|IMG";
@@ -200,8 +201,7 @@
 var noTable = new RegExp("^(?:" + noextendedformat + "|TABLE|UL|OL|DL)$", "i");
 
 // Register some context sensitive commands
-
-if (1 || !FCKBrowserInfo.IsIE){
+// register commands every browser
 
 // formats
 FCKCommands.RegisterCommand('Bold', 
@@ -214,20 +214,24 @@
 FCKCommands.RegisterCommand('StrikeThrough',
  new RestrictedNamedCommand('StrikeThrough', noExtendedFormat));
 
+
 FCKCommands.RegisterCommand('Small',
  new RestrictedStyleButtonCommand('Small', noExtendedFormat));
 FCKCommands.RegisterCommand('Big',
  new RestrictedStyleButtonCommand('Big', noExtendedFormat));
 
+
 // formats no allowing formats inside
 FCKCommands.RegisterCommand('Subscript',
  new RestrictedUniqueNamedFormat('Subscript', noFormat));
 FCKCommands.RegisterCommand('Superscript',
  new RestrictedUniqueNamedFormat('Superscript', noFormat));
 
+
 FCKCommands.RegisterCommand('Typewriter',
  new RestrictedStyleButtonCommand('Typewriter', noTT, true));
 
+
 // lists, hline
 FCKCommands.RegisterCommand('Outdent',
  new RestrictedNamedCommand('Outdent', noFormatandIndent));
@@ -263,16 +267,6 @@
  ('Table', FCKLang.InsertTableLbl, FCKLang.InsertTable, null, false, true));
 
 
-}
-else // IE
-{
-
-FCKCommands.RegisterCommand('Small', new StyleButtonCommand('Small'));
-FCKCommands.RegisterCommand('Big', new StyleButtonCommand('Big'));
-FCKCommands.RegisterCommand('Typewriter', 
-  new StyleButtonCommand('Typewriter', true));
-}
-
 FCKToolbarItems.RegisterItem('Big', new FCKToolbarButton
 			     ('Big', 'Big>', 'Big', 
 			      FCK_TOOLBARITEM_ONLYICON, false, true));
@@ -282,4 +276,3 @@
 FCKToolbarItems.RegisterItem('Typewriter', new FCKToolbarButton
 			     ('Typewriter', 'Typewriter', 'Typewriter', 
 			      FCK_TOOLBARITEM_ONLYICON, false, true));
-
--- a/wiki/htdocs/applets/moinFCKplugins/selection/fckplugin.js	Sat Jun 21 21:09:23 2008 +0900
+++ b/wiki/htdocs/applets/moinFCKplugins/selection/fckplugin.js	Wed Jun 25 16:24:29 2008 +0900
@@ -1,3 +1,5 @@
+// debug function.
+// TODO : can bind this kind of function
 function showObj(title, obj)
 { // show an object in a alert box
   var res = '';
@@ -11,7 +13,9 @@
 }
 
 // --------------------------------
-if (FCKSelection.GetSelection) // Gecko
+// Gecko. it changed. also able to use FCKSelection.GetSelection in IE
+// --------------------------------
+if (FCKSelection.GetSelection) 
 { 
   // assume exactly one selection
   
@@ -311,6 +315,9 @@
     //Alert("No End");
     return 0;
   }
+  if (!pattern) {
+	  return 0;
+  }
   
   /* Crashes IE
   if ((FCKSelection.GetType()=="None") && (oStart!=oEnd))
@@ -326,7 +333,7 @@
 
   while (oElement)
   {
-    if (pattern != null && pattern.test(oElement.nodeName))
+    if (pattern.test(oElement.nodeName))
       { 
         //Alert("Start:" + oStart.nodeName + ':' + oElement.nodeName + 
         //      ':' + oEnd.nodeName);
@@ -334,10 +341,11 @@
       }
     oElement = oElement.parentNode;
   }
+
   oElement = oEnd;
   while (oElement)
   {
-    if (pattern != null && pattern.test(oElement.nodeName))
+    if (pattern.test(oElement.nodeName))
       { 
         //Alert("End:" + oStart.nodeName + ':' + oElement.nodeName + 
         //      ':' + oEnd.nodeName);
@@ -346,6 +354,7 @@
     oElement = oElement.parentNode;
   }
 
+
   if (FCKSelection.IsCollapsed()) 
   {
     return 0;
--- a/wiki/htdocs/applets/moinfckconfig.js	Sat Jun 21 21:09:23 2008 +0900
+++ b/wiki/htdocs/applets/moinfckconfig.js	Wed Jun 25 16:24:29 2008 +0900
@@ -34,7 +34,7 @@
  ['Undo','Redo'], ['Find','Replace'],
  ['MoinFormat'],
  // disabled some styles until IE endless loop is fixed:
- // ['Bold', 'Italic', 'Typewriter', 'Underline', 'StrikeThrough', '-', 'Big', 'Small', 'Superscript', 'Subscript'],
+ //['Bold', 'Italic', 'Typewriter', 'Underline', 'StrikeThrough', '-', 'Big', 'Small', 'Superscript', 'Subscript'],
  ['Bold', 'Italic', 'Underline', 'StrikeThrough', 'RemoveFormat'],
  ['OrderedList','UnorderedList','-','Indent','Outdent'],
  ['Link','Unlink','Attachment','Image','Smiley'],